Files
mongo/buildscripts/resmokelib/testing/testcases/query_tester_self_test.py
Trevor Guidry 2c6a074835 SERVER-120178 add unixDomainSocket support to resmoke (#49009)
GitOrigin-RevId: 8fd583254ad9b50caada6a025661200141608b8e
2026-03-06 16:21:18 +00:00

42 lines
1.5 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):
program_options = {}
interface.append_process_tracking_options(program_options, self._id)
# Merge fixture environment variables into program_options
self._merge_fixture_environment_variables(program_options)
return core.programs.generic_program(
self.logger,
[
sys.executable,
self.test_file,
"-u",
self.fixture.get_internal_connection_string(),
"-b",
_config.DEFAULT_MONGOTEST_EXECUTABLE,
],
program_options,
)