Skip to content

Commit

Permalink
fix: grizzly no longer supports test_info.json as a testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
pyoor committed Jan 21, 2025
1 parent 55e2ecd commit 4093584
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bugmon/evaluator_configs/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions tests/test_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4093584

Please sign in to comment.