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 {
46
46
fi
47
47
48
48
local count=0
49
- until " $@ " ; do
49
+ until eval " $@ " ; do
50
50
# Command failed, otherwise until would have skipped the loop
51
51
52
52
# 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
24
24
. " ${BASH_LIB_DIR_RELATIVE} /${lib} /lib"
25
25
done
26
26
27
+ # Export functions to subshells
28
+ eval " $( declare -F | sed -e ' s/-f /-fx /' ) "
29
+
27
30
# Export the absolute path
28
31
# shellcheck disable=SC2086
29
32
BASH_LIB_DIR=" $( abs_path ${BASH_LIB_DIR_RELATIVE} ) "
Original file line number Diff line number Diff line change @@ -111,4 +111,8 @@ teardown(){
111
111
assert [ ! -e " ${temp_dir} /appendfile" ]
112
112
}
113
113
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