All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: fstests@vger.kernel.org, anand.jain@oracle.com,
	aalbersh@redhat.com, djwong@kernel.org
Cc: linux-fsdevel@vger.kernel.org, kdevops@lists.linux.dev,
	patches@lists.linux.dev, Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 2/3] check: add support for --list-group-tests
Date: Fri, 16 Feb 2024 10:18:58 -0800	[thread overview]
Message-ID: <20240216181859.788521-3-mcgrof@kernel.org> (raw)
In-Reply-To: <20240216181859.788521-1-mcgrof@kernel.org>

Since the prior commit adds the ability to list groups but is used
only when we use --start-after, let's add an option which leverages this
to also allow us to easily query which tests are part of the groups
specified.

This can be used for dynamic test configuration suites such as kdevops
which may want to take advantage of this information to deterministically
determine if a test falls part of a specific group.

Demo:

root@demo-xfs-reflink /var/lib/xfstests # ./check --list-group-tests -g soak

generic/019 generic/388 generic/475 generic/476 generic/521 generic/522 generic/616 generic/617 generic/642 generic/648 generic/650 xfs/285 xfs/517 xfs/560 xfs/561 xfs/562 xfs/565 xfs/570 xfs/571 xfs/572 xfs/573 xfs/574 xfs/575 xfs/576 xfs/577 xfs/578 xfs/579 xfs/580 xfs/581 xfs/582 xfs/583 xfs/584 xfs/585 xfs/586 xfs/587 xfs/588 xfs/589 xfs/590 xfs/591 xfs/592 xfs/593 xfs/594 xfs/595 xfs/727 xfs/729 xfs/800

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 check | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/check b/check
index f081bf8ce685..523cf024c139 100755
--- a/check
+++ b/check
@@ -19,6 +19,7 @@ have_test_arg=false
 randomize=false
 exact_order=false
 start_after_test=""
+list_group_tests=false
 export here=`pwd`
 xfile=""
 subdir_xfile=""
@@ -81,6 +82,7 @@ check options
     -b			brief test summary
     -R fmt[,fmt]	generate report in formats specified. Supported formats: xunit, xunit-quiet
     --large-fs		optimise scratch device for large filesystems
+    --list-group-tests	only list tests part of the groups you specified, do not run the tests
     --start-after	only start testing after the test specified
     -s section		run only specified section from config file
     -S section		exclude the specified section from the config file
@@ -276,8 +278,16 @@ _prepare_test_list()
 			done
 			group_all="$group_all $list"
 		done
+
+		group_all=$(echo $group_all | sed -e 's|tests/||g')
+
+		# Keep it simple, allow for easy machine scraping
+		if $list_group_tests ; then
+			echo $group_all
+			exit 0
+		fi
+
 		if [[ "$start_after_test" != "" && $start_after_found -ne 1 ]]; then
-			group_all=$(echo $group_all | sed -e 's|tests/||g')
 			echo "Start after test $start_after_test not found in any group specified."
 			echo "Be sure you specify a test present in one of your test run groups if using --start-after."
 			echo
@@ -366,6 +376,9 @@ while [ $# -gt 0 ]; do
 		start_after_test="$2"
 		shift
 		;;
+	--list-group-tests)
+		list_group_tests=true
+		;;
 	-s)	RUN_SECTION="$RUN_SECTION $2"; shift ;;
 	-S)	EXCLUDE_SECTION="$EXCLUDE_SECTION $2"; shift ;;
 	-l)	diff="diff" ;;
-- 
2.42.0


  parent reply	other threads:[~2024-02-16 18:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 18:18 [PATCH fstests 0/3] few enhancements Luis Chamberlain
2024-02-16 18:18 ` [PATCH 1/3] tests: augment soak test group Luis Chamberlain
2024-02-16 18:18 ` Luis Chamberlain [this message]
2024-02-19  3:38   ` [PATCH 2/3] check: add support for --list-group-tests Dave Chinner
2024-02-21 16:45     ` Luis Chamberlain
2024-02-25 16:08       ` Zorro Lang
2024-02-16 18:18 ` [PATCH 3/3] check: add --print-start-done to enhance watchdogs Luis Chamberlain
2024-02-19  3:42   ` Dave Chinner
2024-02-21 16:46     ` Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240216181859.788521-3-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=aalbersh@redhat.com \
    --cc=anand.jain@oracle.com \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=kdevops@lists.linux.dev \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.