e2e: set RUNS to repeat tests
This commit is contained in:
parent
1253f82cd9
commit
950e391018
47
test_e2e.sh
47
test_e2e.sh
|
|
@ -2697,29 +2697,42 @@ export GIT_CONFIG_SYSTEM=/dev/null
|
||||||
|
|
||||||
# Iterate over the chosen tests and run them.
|
# Iterate over the chosen tests and run them.
|
||||||
FAILS=()
|
FAILS=()
|
||||||
RET=0
|
FINAL_RET=0
|
||||||
|
RUNS="${RUNS:-1}"
|
||||||
for t; do
|
for t; do
|
||||||
clean_root
|
TEST_RET=0
|
||||||
clean_work
|
RUN=0
|
||||||
init_repo
|
while [[ "${RUN}" < "${RUNS}" ]]; do
|
||||||
|
clean_root
|
||||||
|
clean_work
|
||||||
|
init_repo
|
||||||
|
|
||||||
echo -n "testcase $t: "
|
sfx=""
|
||||||
|
if [[ "${RUNS}" > 1 ]]; then
|
||||||
# See comments on run_test for details.
|
sfx=" ($((RUN+1))/${RUNS})"
|
||||||
TESTRET=0
|
|
||||||
run_test TESTRET "e2e::${t}" "${DIR}/log.$t"
|
|
||||||
if [[ "$TESTRET" == 0 ]]; then
|
|
||||||
pass
|
|
||||||
else
|
|
||||||
RET=1
|
|
||||||
if [[ "$TESTRET" != 42 ]]; then
|
|
||||||
echo "FAIL: unknown error"
|
|
||||||
fi
|
fi
|
||||||
|
echo -n "testcase ${t}${sfx}: "
|
||||||
|
|
||||||
|
# See comments on run_test for details.
|
||||||
|
RUN_RET=0
|
||||||
|
run_test RUN_RET "e2e::${t}" "${DIR}/log.$t"
|
||||||
|
if [[ "$RUN_RET" == 0 ]]; then
|
||||||
|
pass
|
||||||
|
else
|
||||||
|
TEST_RET=1
|
||||||
|
if [[ "$RUN_RET" != 42 ]]; then
|
||||||
|
echo "FAIL: unknown error"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
remove_containers || true
|
||||||
|
RUN=$((RUN+1))
|
||||||
|
done
|
||||||
|
if [[ "$TEST_RET" != 0 ]]; then
|
||||||
|
FINAL_RET=1
|
||||||
FAILS+=("$t")
|
FAILS+=("$t")
|
||||||
fi
|
fi
|
||||||
remove_containers || true
|
|
||||||
done
|
done
|
||||||
if [[ "$RET" != 0 ]]; then
|
if [[ "$FINAL_RET" != 0 ]]; then
|
||||||
echo
|
echo
|
||||||
echo "the following tests failed:"
|
echo "the following tests failed:"
|
||||||
for f in "${FAILS[@]}"; do
|
for f in "${FAILS[@]}"; do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue