diff options
author | 2025-02-10 10:13:38 +0100 | |
---|---|---|
committer | 2025-02-10 10:13:38 +0100 | |
commit | 8331947d70de6064d28b9e295c46082bb709890b (patch) | |
tree | 60c0203522a2bd62152a3b9acfa0d1165e4533af /extras/hs-test | |
parent | 09341c6bbef28c03c1b026ff78808b000bf7d79d (diff) |
hs-test: option to skip tests using cli args
Type: test
Change-Id: Ic0fd117c53a3547cebfca38d089b5ba3f79cca28
Signed-off-by: Adrian Villin <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test')
-rw-r--r-- | extras/hs-test/Makefile | 7 | ||||
-rw-r--r-- | extras/hs-test/hs_test.sh | 9 |
2 files changed, 13 insertions, 3 deletions
diff --git a/extras/hs-test/Makefile b/extras/hs-test/Makefile index 9fbb21c9ccb..6b2a0477813 100644 --- a/extras/hs-test/Makefile +++ b/extras/hs-test/Makefile @@ -84,6 +84,7 @@ help: @echo " UNCONFIGURE=[true|false] - unconfigure selected test" @echo " DEBUG=[true|false] - attach VPP to GDB" @echo " TEST=[name1,name2...] - specific test(s) to run" + @echo " SKIP=[name1,name2...] - specific test(s) to skip" @echo " CPUS=[n-cpus] - number of cpus to allocate to VPP and containers" @echo " VPPSRC=[path-to-vpp-src] - path to vpp source files (for gdb)" @echo " PARALLEL=[n-cpus] - number of test processes to spawn to run in parallel" @@ -123,7 +124,7 @@ test: .deps.ok .build.ok @bash ./hs_test.sh --persist=$(PERSIST) --verbose=$(VERBOSE) \ --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \ --vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT) --cpu0=$(CPU0) \ - --dryrun=$(DRYRUN); \ + --dryrun=$(DRYRUN) --skip=$(SKIP); \ ./script/compress.sh $$? .PHONY: test-debug @@ -132,7 +133,7 @@ test-debug: .deps.ok .build_debug.ok @bash ./hs_test.sh --persist=$(PERSIST) --verbose=$(VERBOSE) \ --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \ --vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT) --debug_build=true \ - --cpu0=$(CPU0) --dryrun=$(DRYRUN); \ + --cpu0=$(CPU0) --dryrun=$(DRYRUN) --skip=$(SKIP); \ ./script/compress.sh $$? .PHONY: test-cov @@ -140,7 +141,7 @@ test-leak: FORCE_BUILD=false test-cov: .deps.ok .build.cov.ok @bash ./hs_test.sh --persist=$(PERSIST) --verbose=$(VERBOSE) \ --unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST-HS) --cpus=$(CPUS) \ - --vppsrc=$(VPPSRC) --cpu0=$(CPU0) --dryrun=$(DRYRUN); \ + --vppsrc=$(VPPSRC) --cpu0=$(CPU0) --dryrun=$(DRYRUN) --skip=$(SKIP); \ ./script/compress.sh $$? .PHONY: test-leak diff --git a/extras/hs-test/hs_test.sh b/extras/hs-test/hs_test.sh index 4a9378c60b4..bcada2c73d6 100644 --- a/extras/hs-test/hs_test.sh +++ b/extras/hs-test/hs_test.sh @@ -12,6 +12,7 @@ leak_check_set=0 debug_build= ginkgo_args= tc_names=() +skip_names=() dryrun= for i in "$@" @@ -65,6 +66,10 @@ case "${i}" in args="$args -verbose" fi ;; + --skip=*) + skip_list="${i#*=}" + IFS=',' read -r -a skip_names <<< "$skip_list" + ;; --parallel=*) ginkgo_args="$ginkgo_args -procs=${i#*=}" ;; @@ -103,6 +108,10 @@ for name in "${tc_names[@]}"; do ginkgo_args="$ginkgo_args --focus $name" done +for skip in "${skip_names[@]}"; do + ginkgo_args="$ginkgo_args --skip $skip" +done + if [ $focused_test -eq 0 ] && { [ $persist_set -eq 1 ] || [ $dryrun_set -eq 1 ]; }; then echo -e "\e[1;31mpersist/dryrun flag is not supported while running all tests!\e[1;0m" exit 2 |