Skip to content

Commit d369054

Browse files
committed
Corrected tests for S3 cache backend
1 parent a238204 commit d369054

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tests/cache_s3.bats

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ setup() {
6161
@test 'Verbose flag passed when environment is set' {
6262
export BUILDKITE_PLUGIN_S3_CACHE_ONLY_SHOW_ERRORS=1
6363
stub aws \
64-
's3 sync --only-show-errors \* \* : echo ' \
65-
's3 sync --only-show-errors \* \* : echo ' \
66-
's3 sync \* \* : echo ' \
67-
's3 sync \* \* : echo '
64+
's3 cp --recursive --only-show-errors \* \* : echo ' \
65+
's3 cp --recursive --only-show-errors \* \* : echo ' \
66+
's3 cp --recursive \* \* : echo ' \
67+
's3 cp --recursive \* \* : echo '
6868

6969
run "${PWD}/backends/cache_s3" save from to
7070

71-
assert_success
72-
assert_output ''
71+
assert_success
72+
assert_output ''
7373

7474
run "${PWD}/backends/cache_s3" get from to
7575

@@ -95,11 +95,11 @@ setup() {
9595
export BUILDKITE_PLUGIN_S3_CACHE_ENDPOINT=https://s3.somewhere.com
9696

9797
stub aws \
98-
's3 sync --endpoint-url https://s3.somewhere.com \* \* : echo ' \
99-
's3 sync --endpoint-url https://s3.somewhere.com \* \* : echo ' \
98+
's3 cp --recursive --endpoint-url https://s3.somewhere.com \* \* : echo ' \
99+
's3 cp --recursive --endpoint-url https://s3.somewhere.com \* \* : echo ' \
100100
's3api list-objects-v2 --bucket \* --prefix \* --max-items 1 --endpoint-url https://s3.somewhere.com : echo exists' \
101-
's3 sync \* \* : echo ' \
102-
's3 sync \* \* : echo ' \
101+
's3 cp --recursive \* \* : echo ' \
102+
's3 cp --recursive \* \* : echo ' \
103103
's3api list-objects-v2 --bucket \* --prefix \* --max-items 1 : echo exists'
104104

105105
run "${PWD}/backends/cache_s3" save from to
@@ -142,9 +142,9 @@ setup() {
142142
mkdir "${BATS_TEST_TMPDIR}/s3-cache"
143143
stub aws \
144144
"echo" \
145-
"ln -s \$3 $BATS_TEST_TMPDIR/s3-cache/\$(echo \$4 | md5sum | cut -c-32)" \
145+
"ln -s \$4 $BATS_TEST_TMPDIR/s3-cache/\$(echo \$5 | md5sum | cut -c-32)" \
146146
"echo 'exists'" \
147-
"cp -r $BATS_TEST_TMPDIR/s3-cache/\$(echo \$3 | md5sum | cut -c-32) \$4"
147+
"cp -r $BATS_TEST_TMPDIR/s3-cache/\$(echo \$4 | md5sum | cut -c-32) \$5"
148148

149149
run "${PWD}/backends/cache_s3" exists new-file
150150

@@ -180,9 +180,9 @@ setup() {
180180

181181
stub aws \
182182
"echo" \
183-
"ln -s \$3 $BATS_TEST_TMPDIR/s3-cache/\$(echo \$4 | md5sum | cut -c-32)" \
183+
"ln -s \$4 $BATS_TEST_TMPDIR/s3-cache/\$(echo \$5 | md5sum | cut -c-32)" \
184184
"echo 'exists'" \
185-
"cp -r $BATS_TEST_TMPDIR/s3-cache/\$(echo \$3 | md5sum | cut -c-32) \$4"
185+
"cp -r $BATS_TEST_TMPDIR/s3-cache/\$(echo \$4 | md5sum | cut -c-32) \$5"
186186

187187
run "${PWD}/backends/cache_s3" exists new-folder
188188

0 commit comments

Comments
 (0)