git: e62aee66b0f9 - main - DTrace test: Add a new keyword SKIPCI to gentest.sh

From: Li-Wen Hsu <lwhsu_at_FreeBSD.org>
Date: Thu, 24 Mar 2022 03:38:01 UTC
The branch main has been updated by lwhsu:

URL: https://cgit.FreeBSD.org/src/commit/?id=e62aee66b0f9020d712d875a5908b34d07ea0118

commit e62aee66b0f9020d712d875a5908b34d07ea0118
Author:     Li-Wen Hsu <lwhsu@FreeBSD.org>
AuthorDate: 2022-03-24 03:30:27 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2022-03-24 03:30:27 +0000

    DTrace test: Add a new keyword SKIPCI to gentest.sh
    
    This is for marking a test case is flakey and should not be executed in
    the CI environment.
    
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D34635
---
 cddl/usr.sbin/dtrace/tests/tools/exclude.sh | 8 +++++---
 cddl/usr.sbin/dtrace/tests/tools/gentest.sh | 4 +++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/cddl/usr.sbin/dtrace/tests/tools/exclude.sh b/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
index 50f825769af1..b0b67a86b86e 100755
--- a/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
+++ b/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
@@ -17,9 +17,11 @@
 # 1) and 2).
 #
 # The SKIP variable contains tests that should not be executed at all. The
-# EXFAIL variable contains tests that are expected to fail when run. Please
-# avoid adding tests to SKIP unless it really is necessary; with EXFAIL, tests
-# that begin passing as the result of a change are visible in the test summary.
+# EXFAIL variable contains tests that are expected to fail when run. The
+# SKIPCI variable contains tests that are flakey and should not be executed in
+# the CI environment. Please avoid adding tests to SKIP unless it really is
+# necessary; with EXFAIL, tests that begin passing as the result of a change
+# are visible in the test summary.
 
 exclude()
 {
diff --git a/cddl/usr.sbin/dtrace/tests/tools/gentest.sh b/cddl/usr.sbin/dtrace/tests/tools/gentest.sh
index 9c34b79f547d..6bad066e5419 100755
--- a/cddl/usr.sbin/dtrace/tests/tools/gentest.sh
+++ b/cddl/usr.sbin/dtrace/tests/tools/gentest.sh
@@ -83,18 +83,20 @@ ARCH=$(dirname ${CATEGORY})
 . $EXCLUDES
 EXFAILS=$(echo -e "$EXFAIL" | grep "^${CATEGORY}/" | xargs basename -a)
 SKIPS=$(echo -e "$SKIP" | grep "^${CATEGORY}/" | xargs basename -a)
+SKIPCIS=$(echo -e "$SKIPCI" | grep "^${CATEGORY}/" | xargs basename -a)
 
 FILELIST=$(mktemp)
 trap 'rm -f $FILELIST' EXIT
 
 echo "$@" | tr ' ' '\n' | xargs basename -a | sort > ${FILELIST}
-TFILES=$(printf '%s\n%s' "$EXFAILS" "$SKIPS" | sort | comm -13 /dev/stdin $FILELIST)
+TFILES=$(printf '%s\n%s' "$EXFAILS" "$SKIPS" "$SKIPCIS" | sort | comm -13 /dev/stdin $FILELIST)
 
 #
 # Generate test cases.
 #
 gentestcases SKIPS "atf_skip \"test may hang or cause system instability\""
 gentestcases EXFAILS "atf_expect_fail \"test is known to fail\""
+gentestcases SKIPCIS "if [ \"\$(atf_config_get ci false)\" = \"true\" ]; then atf_skip \"see cddl/usr.sbin/dtrace/tests/tools/exclude.sh\"; fi"
 gentestcases TFILES
 
 #