Skip to content

Commit

Permalink
ci: write status to output file
Browse files Browse the repository at this point in the history
* Write status to output file.
* Also add the option to continue on failure.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Change-Id: I5515cfa288dd36a487591de306875faab7aa6db0
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/dataplane/dpu-offload/+/140299
Tested-by: Harman Kalra <hkalra@marvell.com>
  • Loading branch information
ashwinyes authored and harman-kalra committed Dec 5, 2024
1 parent 97f823a commit f86c6b1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ci/test/env/cn10k-virtio-perf.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions ci/test/env/cn10k.env
Original file line number Diff line number Diff line change
Expand Up @@ -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="
Expand Down
25 changes: 22 additions & 3 deletions ci/test/ep/ep_test_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit f86c6b1

Please sign in to comment.