Skip to content

Commit

Permalink
Add test for new option
Browse files Browse the repository at this point in the history
  • Loading branch information
toote committed Oct 6, 2022
1 parent 6241660 commit d9ccb60
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,33 @@ export BUILDKITE_JOB_ID=1111
unstub buildkite-agent
}


@test "Run without pull" {
export BUILDKITE_JOB_ID=1111
export BUILDKITE_PIPELINE_SLUG=test
export BUILDKITE_BUILD_NUMBER=1
export BUILDKITE_COMMAND=pwd
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_SKIP_PULL=true

stub docker-compose \
"-f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml up -d --scale myservice=0 myservice : echo started dependencies for myservice" \
"-f docker-compose.yml -p buildkite1111 -f docker-compose.buildkite-1-override.yml run --name buildkite1111_myservice_build_1 --rm myservice /bin/sh -e -c 'pwd' : echo ran myservice without pull"

stub buildkite-agent \
"meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \
"meta-data get docker-compose-plugin-built-image-tag-myservice : echo myimage"

run "$PWD"/hooks/command

assert_success
assert_output --partial "Running /bin/sh -e -c 'pwd' in service myservice"
assert_output --partial "ran myservice without pull"

unstub docker-compose
unstub buildkite-agent
}

@test "Run with use aliases" {
export BUILDKITE_JOB_ID=1111
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
Expand Down

0 comments on commit d9ccb60

Please sign in to comment.