Skip to content

Commit 5369b80

Browse files
committed
Added test for undocumented option
1 parent 17ac2ad commit 5369b80

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

tests/run.bats

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ load "${BATS_PLUGIN_PATH}/load.bash"
44
load '../lib/shared.bash'
55
load '../lib/run.bash'
66

7-
# export DOCKER_COMPOSE_STUB_DEBUG=/dev/tty
8-
# export BUILDKITE_AGENT_STUB_DEBUG=/dev/tty
9-
# export BATS_MOCK_TMPDIR=$PWD
7+
export DOCKER_COMPOSE_STUB_DEBUG=/dev/tty
8+
export BUILDKITE_AGENT_STUB_DEBUG=/dev/tty
9+
export BATS_MOCK_TMPDIR=$PWD
1010

1111
setup_file() {
1212
export BUILDKITE_JOB_ID=1111
@@ -43,6 +43,22 @@ teardown() {
4343
unstub buildkite-agent
4444
}
4545

46+
@test "Fail running without a prebuilt image and require-prebuild" {
47+
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
48+
export BUILDKITE_COMMAND="echo hello world"
49+
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_REQUIRE_PREBUILD=true
50+
51+
stub buildkite-agent \
52+
"meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 1"
53+
54+
run "$PWD"/hooks/command
55+
56+
assert_failure
57+
assert_output --partial "No pre-built image found"
58+
59+
unstub buildkite-agent
60+
}
61+
4662
@test "Run without a prebuilt image and an empty command" {
4763
export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
4864
export BUILDKITE_COMMAND=""

0 commit comments

Comments
 (0)