From 10b47e7bcf64a7a28288d59a169ac3e658b3a523 Mon Sep 17 00:00:00 2001 From: Francois Campbell Date: Mon, 16 Oct 2023 14:56:07 -0400 Subject: [PATCH] flip default --- README.md | 4 ++-- commands/run.sh | 2 +- tests/run.bats | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9a0f0e1f..4a7d81b3 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/commands/run.sh b/commands/run.sh index ac25b9de..c24240e4 100755 --- a/commands/run.sh +++ b/commands/run.sh @@ -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="+++" diff --git a/tests/run.bats b/tests/run.bats index 9e79c8d2..3569addd 100644 --- a/tests/run.bats +++ b/tests/run.bats @@ -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 @@ -1643,12 +1643,12 @@ 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 @@ -1656,7 +1656,7 @@ export BUILDKITE_JOB_ID=1111 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" \ @@ -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