File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,6 +214,25 @@ setup() {
214214 unstub docker
215215}
216216
217+ @test " Runs BUILDKITE_COMMAND with workdir with variables and option turned on" {
218+ # shellcheck disable=2016 # we want the variable not interpreted now
219+ export BUILDKITE_PLUGIN_DOCKER_WORKDIR=' $ONE_VAR'
220+ export BUILDKITE_PLUGIN_DOCKER_EXPAND_VOLUME_VARS=true
221+ export BUILDKITE_COMMAND=" pwd"
222+
223+ export ONE_VAR=/my/path
224+
225+ stub docker \
226+ " run -t -i --rm --init --volume $PWD :/my/path --workdir /my/path --label com.buildkite.job-id=1-2-3-4 image:tag /bin/sh -e -c 'pwd' : echo ran command in docker"
227+
228+ run " $PWD " /hooks/command
229+
230+ assert_success
231+ assert_output --partial " ran command in docker"
232+
233+ unstub docker
234+ }
235+
217236@test " Runs BUILDKITE_COMMAND with devices" {
218237 export BUILDKITE_PLUGIN_DOCKER_WORKDIR=/app
219238 export BUILDKITE_PLUGIN_DOCKER_DEVICES_0=/dev/bus/usb/001/001
You can’t perform that action at this time.
0 commit comments