Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj at gmail.com>
To: iwd at lists.01.org
Subject: [PATCH 2/3] test-runner: only include comitted tests for full test runs
Date: Tue, 04 Jan 2022 09:37:35 -0800	[thread overview]
Message-ID: <20220104173736.93682-2-prestwoj@gmail.com> (raw)
In-Reply-To: 20220104173736.93682-1-prestwoj@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]

If specific tests are not specified with -A, only run tests tracked by
git for full test runs.
---
 tools/test-runner | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/test-runner b/tools/test-runner
index b5c4f777..4f16bd65 100755
--- a/tools/test-runner
+++ b/tools/test-runner
@@ -1100,7 +1100,6 @@ def build_test_list(args):
 	'''
 	tests = []
 	test_root = args.testhome + '/autotests'
-	full_list = sorted(os.listdir(test_root))
 
 	# Run all tests
 	if not args.auto_tests:
@@ -1108,10 +1107,16 @@ def build_test_list(args):
 		if args.shell:
 			return [test_root + '/shell']
 
-		# Pair down any non-tests and append full path
-		tests = [test_root + '/' + t for t in full_list if t.startswith('test')]
+		# Get list of all autotests (committed in git)
+		tests = os.popen('git -C %s ls-files autotests/ | cut -f2 -d"/" \
+					| grep "test*" | uniq' % args.testhome).read() \
+					.strip().split('\n')
+		tests = [test_root + '/' + t for t in tests]
 	else:
 		print("Generating partial test list")
+
+		full_list = sorted(os.listdir(test_root))
+
 		for t in args.auto_tests.split(','):
 			path = '%s/%s' % (test_root, t)
 			if t.endswith('+'):
-- 
2.31.1

                 reply	other threads:[~2022-01-04 17:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220104173736.93682-2-prestwoj@gmail.com \
    --to=iwd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox