diff options
author | Mike Grundy <michael.grundy@10gen.com> | 2016-04-28 14:11:49 -0400 |
---|---|---|
committer | Mike Grundy <michael.grundy@10gen.com> | 2016-05-10 09:51:17 -0400 |
commit | 686bd5e0aba3716f093ee9b6f9d8c67f2faef3d9 (patch) | |
tree | 92434d0615dec7bebbb264cb56221aa4b416d72a /buildscripts/resmoke.py | |
parent | 6218a59683bf97c6cb7f198f9d9eccc0371f8bb7 (diff) | |
download | mongo-686bd5e0aba3716f093ee9b6f9d8c67f2faef3d9.tar.gz |
SERVER-21841 Add mode to resmoke.py to list under what suites a test runs
Diffstat (limited to 'buildscripts/resmoke.py')
-rwxr-xr-x | buildscripts/resmoke.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/buildscripts/resmoke.py b/buildscripts/resmoke.py index a6cb03cb620..8afa1d5e77c 100755 --- a/buildscripts/resmoke.py +++ b/buildscripts/resmoke.py @@ -115,6 +115,20 @@ def _dump_suite_config(suite, logging_config): return "\n".join(sb) +def find_suites_by_test(suites): + """ + Looks up what other resmoke suites run the tests specified in the suites + parameter. Returns a dict keyed by test name, value is array of suite names. + """ + + memberships = {} + test_membership = resmokelib.parser.create_test_membership_map() + for suite in suites: + for group in suite.test_groups: + for test in group.tests: + memberships[test] = test_membership[test] + return memberships + def _write_report_file(suites, pathname): """ Writes the report.json file if requested. @@ -151,6 +165,15 @@ def main(): interrupted = False suites = resmokelib.parser.get_suites(values, args) + + # Run the suite finder after the test suite parsing is complete. + if values.find_suites: + suites_by_test = find_suites_by_test(suites) + for test in sorted(suites_by_test): + suite_names = suites_by_test[test] + resmoke_logger.info("%s will be run by the following suite(s): %s", test, suite_names) + sys.exit(0) + try: for suite in suites: resmoke_logger.info(_dump_suite_config(suite, logging_config)) |