Skip to content

Commit

Permalink
flip default
Browse files Browse the repository at this point in the history
  • Loading branch information
francoiscampbell committed Oct 16, 2023
1 parent 1bfc082 commit 10b47e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,11 @@ Pull down multiple pre-built images. By default only the service that is being r

### `collapse-run-log-group` (optional, boolean, run only)

Whether to collapse or expand the log group that is created for the output of `docker-compose run`. When this setting is `true`, the output is collected into a `---` group, when `false` the output is collected into a `+++` group. Setting this to `false` can be useful to highlight your command's output if it does not create its own `+++` group.
Whether to collapse or expand the log group that is created for the output of `docker-compose run`. When this setting is `true`, the output is collected into a `---` group, when `false` the output is collected into a `+++` group. Setting this to `true` can be useful to de-emphasize plugin output if your command creates its own `+++` group.

For more information see [Managing log output](https://buildkite.com/docs/pipelines/managing-log-output).

Default `true`
Default `false`

### `config` (optional)

Expand Down
2 changes: 1 addition & 1 deletion commands/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ ensure_stopped() {

trap ensure_stopped SIGINT SIGTERM SIGQUIT

if [[ "${BUILDKITE_PLUGIN_DOCKER_COMPOSE_COLLAPSE_RUN_LOG_GROUP:-true}" = "true" ]]; then
if [[ "${BUILDKITE_PLUGIN_DOCKER_COMPOSE_COLLAPSE_RUN_LOG_GROUP:-false}" = "true" ]]; then
group_type="---"
else
group_type="+++"
Expand Down
10 changes: 5 additions & 5 deletions tests/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ export BUILDKITE_JOB_ID=1111
unstub buildkite-agent
}

@test "Run with collapsed run log group by default" {
@test "Run with expanded run log group by default" {
export BUILDKITE_JOB_ID=1111
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
export BUILDKITE_PIPELINE_SLUG=test
Expand All @@ -1643,20 +1643,20 @@ export BUILDKITE_JOB_ID=1111
run "$PWD"/hooks/command

assert_success
assert_output --partial "--- :docker: Running /bin/sh -e -c 'echo hello world' in service myservice"
assert_output --partial "+++ :docker: Running /bin/sh -e -c 'echo hello world' in service myservice"
unstub docker-compose
unstub buildkite-agent
}

@test "Run with expanded run log group" {
@test "Run with collapsed run log group" {
export BUILDKITE_JOB_ID=1111
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
export BUILDKITE_PIPELINE_SLUG=test
export BUILDKITE_BUILD_NUMBER=1
export BUILDKITE_COMMAND="echo hello world"
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_CHECK_LINKED_CONTAINERS=false
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_CLEANUP=false
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_COLLAPSE_RUN_LOG_GROUP=false
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_COLLAPSE_RUN_LOG_GROUP=true

stub docker-compose \
"-f docker-compose.yml -p buildkite1111 build --pull myservice : echo built myservice" \
Expand All @@ -1669,7 +1669,7 @@ export BUILDKITE_JOB_ID=1111
run "$PWD"/hooks/command

assert_success
assert_output --partial "+++ :docker: Running /bin/sh -e -c 'echo hello world' in service myservice"
assert_output --partial "--- :docker: Running /bin/sh -e -c 'echo hello world' in service myservice"
unstub docker-compose
unstub buildkite-agent

Expand Down

0 comments on commit 10b47e7

Please sign in to comment.