File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,3 +89,30 @@ teardown() {
8989 " ~~~ :docker: Not Creating Builder Instance 'builder-name' as already exists
9090~~~ :docker: Using Default Builder 'test' with Driver 'driver'"
9191}
92+
93+ @test " Use Builder Instance that does not Exist" {
94+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_BUILDER_USE=true
95+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_BUILDER_NAME=builder-name
96+
97+ stub docker \
98+ " buildx inspect builder-name : exit 1"
99+
100+ run " $PWD " /hooks/pre-command
101+
102+ assert_failure
103+ assert_output " +++ 🚨 Builder Instance 'builder-name' does not exist"
104+ }
105+
106+ @test " Use Builder Instance that Exists" {
107+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_BUILDER_USE=true
108+ export BUILDKITE_PLUGIN_DOCKER_COMPOSE_BUILDER_NAME=builder-name
109+
110+ stub docker \
111+ " buildx inspect builder-name : exit 0" \
112+ " buildx use builder-name : exit 0"
113+
114+ run " $PWD " /hooks/pre-command
115+
116+ assert_success
117+ assert_output " ~~~ :docker: Using Builder Instance '$BUILDKITE_PLUGIN_DOCKER_COMPOSE_BUILDER_NAME '"
118+ }
You can’t perform that action at this time.
0 commit comments