From 9eac919abb44d5363b0f4be58ce6fb4a577aceaa Mon Sep 17 00:00:00 2001 From: Francois Campbell Date: Mon, 6 Mar 2023 14:22:58 -0500 Subject: [PATCH] remove unnecessary setup_file, order env vars in test --- tests/push.bats | 4 ---- tests/run.bats | 17 ++++++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/push.bats b/tests/push.bats index 0d71f238..cefe7996 100644 --- a/tests/push.bats +++ b/tests/push.bats @@ -8,10 +8,6 @@ load '../lib/shared' # export BUILDKITE_AGENT_STUB_DEBUG=/dev/tty # export BATS_MOCK_TMPDIR=$PWD -setup_file() { - export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN_LABELS="false" -} - @test "Push a single service with an image in it's config" { export BUILDKITE_JOB_ID=1111 export BUILDKITE_PLUGIN_DOCKER_COMPOSE_PUSH=app diff --git a/tests/run.bats b/tests/run.bats index 0a1bf3f5..b0754d2b 100644 --- a/tests/run.bats +++ b/tests/run.bats @@ -1505,17 +1505,20 @@ export BUILDKITE_JOB_ID=1111 } @test "Run with Docker labels" { - export BUILDKITE_JOB_ID=1111 - export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice - export BUILDKITE_PIPELINE_SLUG=test + # Pipeline vars + export BUILDKITE_AGENT_ID="1234" + export BUILDKITE_AGENT_NAME="agent" export BUILDKITE_BUILD_NUMBER=1 export BUILDKITE_COMMAND=pwd - export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN_LABELS="true" - export BUILDKITE_PIPELINE_NAME="label-test" + export BUILDKITE_JOB_ID=1111 export BUILDKITE_LABEL="Testjob" + export BUILDKITE_PIPELINE_NAME="label-test" + export BUILDKITE_PIPELINE_SLUG=test export BUILDKITE_STEP_KEY="test-job" - export BUILDKITE_AGENT_NAME="agent" - export BUILDKITE_AGENT_ID="1234" + + # Plugin config + export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice + export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN_LABELS="true" stub docker-compose \ "-f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml pull myservice : echo pulled myservice" \