From f86c6b19c38009b261e8206c398b59141166518d Mon Sep 17 00:00:00 2001 From: Ashwin Sekhar T K Date: Thu, 28 Nov 2024 14:35:21 +0530 Subject: [PATCH] ci: write status to output file * Write status to output file. * Also add the option to continue on failure. Signed-off-by: Ashwin Sekhar T K Change-Id: I5515cfa288dd36a487591de306875faab7aa6db0 Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpu-offload/+/140299 Tested-by: Harman Kalra --- ci/test/env/cn10k-virtio-perf.env | 3 +++ ci/test/env/cn10k.env | 6 ++++++ ci/test/ep/ep_test_run.sh | 25 ++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ci/test/env/cn10k-virtio-perf.env b/ci/test/env/cn10k-virtio-perf.env index 40065b6..1ef6946 100644 --- a/ci/test/env/cn10k-virtio-perf.env +++ b/ci/test/env/cn10k-virtio-perf.env @@ -6,6 +6,9 @@ source $PROJECT_ROOT/ci/test/env/cn10k.env DAO_SUITE=dao-virtio +# Continue testing regardless of failure +CONTINUE_ON_FAILURE=1 + # List of perf tests to be run. RUN_TESTS=" virtio_l2fwd_perf diff --git a/ci/test/env/cn10k.env b/ci/test/env/cn10k.env index a3ecd0f..de3e15d 100644 --- a/ci/test/env/cn10k.env +++ b/ci/test/env/cn10k.env @@ -55,6 +55,12 @@ CMD_EXTRA_ARGS="" # List of tests to be run. If list is empty all tests are run except those in SKIP_TESTS. RUN_TESTS=${RUN_TESTS:-} +# Continue testing regardless of failure +CONTINUE_ON_FAILURE=${CONTINUE_ON_FAILURE:-} + +# File to save status into +STATUS_OUTFILE=${STATUS_OUTFILE:-} + FIXME_SKIP_TESTS="" DEFAULT_SKIP_TESTS=" diff --git a/ci/test/ep/ep_test_run.sh b/ci/test/ep/ep_test_run.sh index 935200c..6f982d1 100755 --- a/ci/test/ep/ep_test_run.sh +++ b/ci/test/ep/ep_test_run.sh @@ -89,6 +89,9 @@ function run_all_tests() { local tst local res + local failed_tests="" + local passed_tests="" + local skipped_tests="" local test_num=0 # Errors will be handled inline. No need for sig handler @@ -100,22 +103,38 @@ function run_all_tests() test_num=$((test_num + 1)) test_enabled $test_num res=$? + tst=$(get_test_name $test_num) if [[ $res == 77 ]]; then + skipped_tests="${skipped_tests}${tst}#" continue fi if [[ $res -ne 0 ]]; then break fi - tst=$(get_test_name $test_num) - # Run the tests run_test $tst res=$? if [[ $res -ne 0 ]] && [[ $res -ne 77 ]] ; then - test_exit -1 "FAILURE: Test $tst failed" + failed_tests="${failed_tests}${tst}#" + if [[ -n $CONTINUE_ON_FAILURE ]]; then + echo "FAILURE: Test $tst failed" + else + test_exit -1 "FAILURE: Test $tst failed" + fi + else + passed_tests="${passed_tests}${tst}#" fi done + + if [[ -n $STATUS_OUTFILE ]] ; then + echo "FAILED: $failed_tests" > $STATUS_OUTFILE + echo "PASSED: $passed_tests" >> $STATUS_OUTFILE + echo "SKIPPED: $skipped_tests" >> $STATUS_OUTFILE + fi + if [[ -n $failed_tests ]]; then + test_exit -1 "FAILURE: Test(s) [$failed_tests] failed" + fi } function test_exit()