File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ function retry {
4646 fi
4747
4848 local count=0
49- until " $@ " ; do
49+ until eval " $@ " ; do
5050 # Command failed, otherwise until would have skipped the loop
5151
5252 # Store return code so it can be reported to the user
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ for lib in helpers logging filehandling git k8s test-utils; do
2424 . " ${BASH_LIB_DIR_RELATIVE} /${lib} /lib"
2525done
2626
27+ # Export functions to subshells
28+ eval " $( declare -F | sed -e ' s/-f /-fx /' ) "
29+
2730# Export the absolute path
2831# shellcheck disable=SC2086
2932BASH_LIB_DIR=" $( abs_path ${BASH_LIB_DIR_RELATIVE} ) "
Original file line number Diff line number Diff line change @@ -111,4 +111,8 @@ teardown(){
111111 assert [ ! -e " ${temp_dir} /appendfile" ]
112112}
113113
114-
114+ @test " retry succeeds with compound statements" {
115+ run retry 3 " true && date >> ${afile} "
116+ assert_success
117+ assert_equal $( wc -l < ${afile} ) 1
118+ }
You can’t perform that action at this time.
0 commit comments