Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helpers/lib
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function retry {
fi

local count=0
until "$@"; do
until eval "$@"; do
# Command failed, otherwise until would have skipped the loop

# Store return code so it can be reported to the user
Expand Down
3 changes: 3 additions & 0 deletions init
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ for lib in helpers logging filehandling git k8s test-utils; do
. "${BASH_LIB_DIR_RELATIVE}/${lib}/lib"
done

# Export functions to subshells
eval "$(declare -F | sed -e 's/-f /-fx /')"

# Export the absolute path
# shellcheck disable=SC2086
BASH_LIB_DIR="$(abs_path ${BASH_LIB_DIR_RELATIVE})"
Expand Down
6 changes: 5 additions & 1 deletion tests-for-this-repo/helpers.bats
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,8 @@ teardown(){
assert [ ! -e "${temp_dir}/appendfile" ]
}


@test "retry succeeds with compound statements" {
run retry 3 "true && date >> ${afile}"
assert_success
assert_equal $(wc -l <${afile}) 1
}