hs-test: output docker build command for ci console log
- clean up shellcheck warnings - rename extras/hs-test/test script - add -x attribute to compress script for consistancy Type: test Change-Id: I5d1a9d16eeaff18562461b1e445e32ac696266d3 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
This commit is contained in:

committed by
Florin Coras

parent
10dbb372cc
commit
bee28afbb2
92
extras/hs-test/hs_test.sh
Normal file
92
extras/hs-test/hs_test.sh
Normal file
@ -0,0 +1,92 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source vars
|
||||
|
||||
args=
|
||||
single_test=0
|
||||
persist_set=0
|
||||
unconfigure_set=0
|
||||
debug_set=0
|
||||
ginkgo_args=
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
case "${i}" in
|
||||
--persist=*)
|
||||
persist="${i#*=}"
|
||||
if [ "$persist" = "true" ]; then
|
||||
args="$args -persist"
|
||||
persist_set=1
|
||||
fi
|
||||
;;
|
||||
--debug=*)
|
||||
debug="${i#*=}"
|
||||
if [ "$debug" = "true" ]; then
|
||||
args="$args -debug"
|
||||
debug_set=1
|
||||
fi
|
||||
;;
|
||||
--verbose=*)
|
||||
verbose="${i#*=}"
|
||||
if [ "$verbose" = "true" ]; then
|
||||
args="$args -verbose"
|
||||
fi
|
||||
;;
|
||||
--unconfigure=*)
|
||||
unconfigure="${i#*=}"
|
||||
if [ "$unconfigure" = "true" ]; then
|
||||
args="$args -unconfigure"
|
||||
unconfigure_set=1
|
||||
fi
|
||||
;;
|
||||
--cpus=*)
|
||||
args="$args -cpus ${i#*=}"
|
||||
;;
|
||||
--vppsrc=*)
|
||||
args="$args -vppsrc ${i#*=}"
|
||||
;;
|
||||
--test=*)
|
||||
tc_name="${i#*=}"
|
||||
if [ "$tc_name" != "all" ]; then
|
||||
single_test=1
|
||||
ginkgo_args="$ginkgo_args --focus $tc_name -vv"
|
||||
args="$args -verbose"
|
||||
else
|
||||
ginkgo_args="$ginkgo_args -v"
|
||||
fi
|
||||
;;
|
||||
--parallel=*)
|
||||
ginkgo_args="$ginkgo_args -procs=${i#*=}"
|
||||
;;
|
||||
--repeat=*)
|
||||
ginkgo_args="$ginkgo_args --repeat=${i#*=}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $single_test -eq 0 ] && [ $persist_set -eq 1 ]; then
|
||||
echo "persist flag is not supported while running all tests!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $unconfigure_set -eq 1 ] && [ $single_test -eq 0 ]; then
|
||||
echo "a single test has to be specified when unconfigure is set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $persist_set -eq 1 ] && [ $unconfigure_set -eq 1 ]; then
|
||||
echo "setting persist flag and unconfigure flag is not allowed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $single_test -eq 0 ] && [ $debug_set -eq 1 ]; then
|
||||
echo "VPP debug flag is not supperted while running all tests!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p summary
|
||||
# shellcheck disable=SC2086
|
||||
sudo -E go run github.com/onsi/ginkgo/v2/ginkgo --no-color --trace --json-report=summary/report.json $ginkgo_args -- $args
|
||||
|
||||
jq -r '.[0] | .SpecReports[] | select((.State == "failed") or (.State == "timedout") or (.State == "panicked")) | select(.Failure != null) | "TestName: \(.LeafNodeText)\nSuite:\n\(.Failure.Location.FileName)\nMessage:\n\(.Failure.Message)\n Full Stack Trace:\n\(.Failure.Location.FullStackTrace)\n"' summary/report.json > summary/failed-summary.log \
|
||||
&& echo "Summary generated -> summary/failed-summary.log"
|
Reference in New Issue
Block a user