mirror of https://github.com/mongodb/mongo
SERVER-109266: Improve logs from test_find_suites.py and test_suites_configurations.py (#40057)
GitOrigin-RevId: 8de14b36a2f8225b5a11a696b8a073e1836daafe
This commit is contained in:
parent
a9a9338beb
commit
0274d2486d
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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)}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue