hs-test: option to skip tests using cli args 90/42190/1
authorAdrian Villin <[email protected]>
Mon, 10 Feb 2025 09:13:38 +0000 (10:13 +0100)
committerAdrian Villin <[email protected]>
Mon, 10 Feb 2025 09:13:38 +0000 (10:13 +0100)
Type: test

Change-Id: Ic0fd117c53a3547cebfca38d089b5ba3f79cca28
Signed-off-by: Adrian Villin <[email protected]>
extras/hs-test/Makefile
extras/hs-test/hs_test.sh

index 9fbb21c..6b2a047 100644 (file)
@@ -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
index 4a9378c..bcada2c 100644 (file)
@@ -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