File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ load "${BATS_PLUGIN_PATH}/load.bash"
44load ' ../lib/shared.bash'
55load ' ../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
1111setup_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=" "
You can’t perform that action at this time.
0 commit comments