Files
mongo/buildscripts/tests/resmoke_validation/test_find_suites.py
Steve McClure 0274d2486d SERVER-109266: Improve logs from test_find_suites.py and test_suites_configurations.py (#40057)
GitOrigin-RevId: 8de14b36a2f8225b5a11a696b8a073e1836daafe
2025-08-14 14:07:22 +00:00

38 lines
1.3 KiB
Python

import glob
import subprocess
import unittest
from buildscripts.resmokelib.parser import set_run_options
from buildscripts.resmokelib.suitesconfig import get_suite
class TestFindSuites(unittest.TestCase):
def test_find_suites(self):
jstests = glob.glob("jstests/core/testing/*.js")
resmoke_process = subprocess.run(
["python3", "buildscripts/resmoke.py", "find-suites", jstests[0]],
stdout=subprocess.PIPE,
text=True,
check=False,
)
self.assertEqual(
0,
resmoke_process.returncode,
# 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")
set_run_options()
# check that find-suites output is a list of suites, one per line.
for line in resmoke_process.stdout.splitlines():
suite = get_suite(line)
self.assertTrue(
suite,
msg=f"find-suites output line does not match suite name format: '{line}'",
)