diff --git a/buildscripts/resmokelib/suitesconfig.py b/buildscripts/resmokelib/suitesconfig.py index baf6d16f658..0d2f9ed0a6b 100644 --- a/buildscripts/resmokelib/suitesconfig.py +++ b/buildscripts/resmokelib/suitesconfig.py @@ -93,6 +93,12 @@ def create_test_membership_map(fail_on_missing_selector=False, test_kind=None): if not fail_on_missing_selector: continue raise + except KeyError as e: + # For example, `test_kind` might be missing from their yaml config + loggers.ROOT_EXECUTOR_LOGGER.error( + "Error occurred while processing suite '%s': Field %s not found.", suite_name, e + ) + raise return test_membership diff --git a/buildscripts/tests/resmoke_validation/test_find_suites.py b/buildscripts/tests/resmoke_validation/test_find_suites.py index f4b278a788e..ef1c2f7e8f9 100644 --- a/buildscripts/tests/resmoke_validation/test_find_suites.py +++ b/buildscripts/tests/resmoke_validation/test_find_suites.py @@ -19,7 +19,9 @@ class TestFindSuites(unittest.TestCase): self.assertEqual( 0, resmoke_process.returncode, - msg="find-suites subcommand did not execute successfully.", + # Give a very verbose failure message - this can be read by users well + # outside of resmoke-areas in case of failures on malformatted yaml configs + msg=f"find-suites subcommand did not execute successfully:\n\n{resmoke_process.stdout}", ) self.assertTrue(resmoke_process.stdout, msg="find-suites output must not be empty") diff --git a/buildscripts/tests/resmoke_validation/test_suites_configurations.py b/buildscripts/tests/resmoke_validation/test_suites_configurations.py index 356bdf8cecd..4fcc0caa407 100644 --- a/buildscripts/tests/resmoke_validation/test_suites_configurations.py +++ b/buildscripts/tests/resmoke_validation/test_suites_configurations.py @@ -9,8 +9,8 @@ class TestSuitesConfigurations(unittest.TestCase): def test_validity_of_resmoke_suites_configurations(self): set_run_options("--runAllFeatureFlagTests") for suite_name in get_named_suites(): - suite = get_suite(suite_name) try: + suite = get_suite(suite_name) suite.tests except IOError as err: # We ignore errors from missing files referenced in the test suite's "selector" @@ -19,5 +19,8 @@ class TestSuitesConfigurations(unittest.TestCase): # associated bazel target hasn't been built yet. if err.filename in config.EXTERNAL_SUITE_SELECTORS: continue + except KeyError as e: + # For example, `test_kind` might be missing from their yaml config + self.fail(f"Error validating `{suite_name}` suite: Field {str(e)} not found.") except Exception as ex: - self.fail(f"While validating `{suite.get_name()}` suite got an error: {str(ex)}") + self.fail(f"Error validating `{suite_name}` suite: {str(ex)}")