Skip to content

Commit 5b65ca6

Browse files
committed
Added new test for when command fails
1 parent 8932460 commit 5b65ca6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/post-command.bats

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ teardown() {
3636
assert_output --partial 'Cache not setup for saving'
3737
}
3838

39+
@test 'If command failed, do nothing' {
40+
export BUILDKITE_COMMAND_EXIT_STATUS=127
41+
42+
run "$PWD/hooks/post-command"
43+
44+
assert_success
45+
assert_output --partial 'Aborting cache post-command hook because command exited with status 127'
46+
}
47+
3948
@test "Missing path fails" {
4049
unset BUILDKITE_PLUGIN_CACHE_PATH
4150

0 commit comments

Comments
 (0)