From 40935841cea9707304227cdb3c124dfd9b6862ef Mon Sep 17 00:00:00 2001 From: pyoor Date: Tue, 21 Jan 2025 13:22:59 -0500 Subject: [PATCH] fix: grizzly no longer supports test_info.json as a testcase --- src/bugmon/evaluator_configs/browser.py | 7 +++++++ tests/test_configs.py | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/bugmon/evaluator_configs/browser.py b/src/bugmon/evaluator_configs/browser.py index eb74276..891494f 100644 --- a/src/bugmon/evaluator_configs/browser.py +++ b/src/bugmon/evaluator_configs/browser.py @@ -41,6 +41,13 @@ def __init__(self, build_flags: BuildFlags, evaluator: BrowserEvaluator): self.params["use_harness"] = evaluator.use_harness self.params["env_variables"] = evaluator.env_vars + @classmethod + def iter_tests(cls, working_dir: Path) -> Iterator[Path]: + for testcase in super().iter_tests(working_dir): + if testcase.name == "test_info.json": + testcase = testcase.parent + yield testcase + @staticmethod def iter_env(bug: EnhancedBug) -> Iterator[Dict[str, str]]: """Iterate over possible env variable settings diff --git a/tests/test_configs.py b/tests/test_configs.py index bd36602..03b02e7 100644 --- a/tests/test_configs.py +++ b/tests/test_configs.py @@ -76,6 +76,19 @@ def test_browser_configuration_iter_tests_001(): assert Path(tmp_path / "2.xml") in tests +def test_browser_configuration_iter_tests_002(): + """Test BrowserConfiguration.iter_tests() with test_info.json""" + with tempfile.TemporaryDirectory() as tmp_dir: + tmp_path = Path(tmp_dir) + Path(tmp_path / "test_info.json").touch() + Path(tmp_path / "testcase.html").touch() + Path(tmp_path / "frame.html").touch() + + tests = list(BrowserConfiguration.iter_tests(tmp_path)) + assert len(tests) == 3 + assert Path(tmp_path) in tests + + def test_browser_configuration_env_iter_001(bug_data): """Test BugConfiguration.env_iter() with Accessibility component""" bug = copy.deepcopy(bug_data)