Files
mongo/buildscripts/resmokelib/testing/testcases/query_tester_self_test.py
Naafiyan Ahmed eeb14cc1bd SERVER-96676 Added QueryTester self tests to resmoke (#28419)
GitOrigin-RevId: f6fd7eee10d63d3cdf6d320d8b9a2530c1940d7d
2024-11-04 21:59:38 +00:00

37 lines
1.3 KiB
Python

"""The unittest.TestCase for QueryTester self-tests."""
import sys
from buildscripts.resmokelib import config as _config
from buildscripts.resmokelib import core, logging
from buildscripts.resmokelib.testing.testcases import interface
class QueryTesterSelfTestCase(interface.ProcessTestCase):
"""A QueryTester self-test to execute."""
REGISTERED_NAME = "query_tester_self_test"
def __init__(self, logger: logging.Logger, test_filenames: list[str]):
"""Initialize QueryTesterSelfTestCase.
test_filenames must contain one test_file - a python file that takes one argument: the uri of the mongod.
To run multiple test files, you would create an instance of QueryTesterSelfTestCase for each one.
"""
assert len(test_filenames) == 1
interface.ProcessTestCase.__init__(self, logger, "QueryTesterSelfTest", test_filenames[0])
self.test_file = test_filenames[0]
def _make_process(self):
return core.programs.generic_program(
self.logger,
[
sys.executable,
self.test_file,
"-u",
self.fixture.get_internal_connection_string(),
"-b",
_config.DEFAULT_MONGOTEST_EXECUTABLE,
],
)