File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,27 @@ teardown() {
5959 unstub buildkite-agent
6060}
6161
62+ @test " Fail running without a prebuilt image for pull service and require-prebuild" {
63+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
64+ export BUILDKITE_COMMAND=" echo hello world"
65+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_REQUIRE_PREBUILD=true
66+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_PULL=other-service
67+
68+ stub buildkite-agent \
69+ " meta-data exists docker-compose-plugin-built-image-tag-myservice : exit 0" \
70+ " meta-data get docker-compose-plugin-built-image-tag-myservice : echo myservice-image" \
71+ " meta-data exists docker-compose-plugin-built-image-tag-other-service : exit 1"
72+
73+ run " $PWD " /hooks/command
74+
75+ assert_failure
76+
77+ assert_output --partial " Found a pre-built image for myservice"
78+ assert_output --partial " No pre-built image found"
79+
80+ unstub buildkite-agent
81+ }
82+
6283@test " Run without a prebuilt image and an empty command" {
6384 export BUILDKITE_PLUGIN_DOCKER_COMPOSE_RUN=myservice
6485 export BUILDKITE_COMMAND=" "
You can’t perform that action at this time.
0 commit comments