Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmcheck: Honor TESTS= #692

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion tests/vmcheck/multitest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,32 @@ def main():
for host in sys.argv[1:]:
hosts.append(Host(host))

for test in glob.iglob(os.path.join(sys.path[0], "test-*.sh")):
requested_tests_spec = os.environ.get('TESTS')
if requested_tests_spec is not None:
requested_tests = requested_tests_spec.split()
else:
requested_tests = None

tests = glob.iglob(os.path.join(sys.path[0], "test-*.sh"))
matched_tests = []
unmatched_tests = []
for test in tests:
testname = Host._strip_test(test)
if requested_tests is None or testname in requested_tests:
matched_tests.append(test)
else:
unmatched_tests.append(testname)
if len(matched_tests) == 0:
print("error: no tests match '{}': {}".format(requested_tests_spec, unmatched_tests))
sys.exit(1)

for test in matched_tests:
host = wait_for_next_available_host(hosts)
rc = host.flush()
failed = failed or rc != 0
host.dispatch(test)
if len(unmatched_tests) > 0:
print("NOTE: Skipping tests not matching {}: {}".format(requested_tests_spec, unmatched_tests))

for host in hosts:
rc = host.flush()
Expand Down