mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
test.py: add bypassing random seed to boost tests
Bypassing argument to pytest->boost that was missing. Fixes: https://github.com/scylladb/scylladb/issues/24927
This commit is contained in:
2
test.py
2
test.py
@@ -327,6 +327,8 @@ def run_pytest(options: argparse.Namespace, run_id: int) -> tuple[int, list[Simp
|
||||
if options.pytest_arg:
|
||||
# If pytest_arg is provided, it should be a string with arguments to pass to pytest
|
||||
args.extend(shlex.split(options.pytest_arg))
|
||||
if options.random_seed:
|
||||
args.append(f'--random-seed={options.random_seed}')
|
||||
if options.gather_metrics:
|
||||
args.append('--gather-metrics')
|
||||
if len(expression) > 1:
|
||||
|
||||
@@ -47,6 +47,8 @@ def pytest_addoption(parser: pytest.Parser) -> None:
|
||||
help="Specific byte limit for failure injection (random by default)")
|
||||
parser.addoption("--gather-metrics", action=BooleanOptionalAction, default=False,
|
||||
help='Switch on gathering cgroup metrics')
|
||||
parser.addoption('--random-seed', action="store",
|
||||
help="Random number generator seed to be used by boost tests")
|
||||
|
||||
# Following option is to use with bare pytest command.
|
||||
#
|
||||
|
||||
@@ -117,6 +117,8 @@ class BoostTestFacade(CppTestFacade):
|
||||
args.append(f"--run_test={original_name}")
|
||||
# Tests are written in the way that everything after '--' passes to the test itself rather than to the test framework
|
||||
args.append('--')
|
||||
if self.random_seed:
|
||||
args.append(f'--random-seed={self.random_seed}')
|
||||
args.extend(test_args)
|
||||
test_passed, stdout_file_path, return_code = self.run_process(test_name, mode, file_name, args, env)
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ class CppTestFacade(ABC):
|
||||
self.run_id: int = config.getoption('run_id') or 1
|
||||
self.gather_metrics: bool = config.getoption('gather_metrics')
|
||||
self.save_log_on_success: bool = config.getoption('save_log_on_success')
|
||||
self.random_seed: int = config.getoption('random_seed')
|
||||
self.combined_suites: dict[str, list[str]] = combined_tests
|
||||
|
||||
def list_tests(self, executable: Path , no_parallel: bool, mode: str) -> tuple[bool,list[str]]:
|
||||
|
||||
Reference in New Issue
Block a user