Skip to content

Commit d7ff0e2

Browse files
committed
test(authority): freeze the Python discovery helper with mutation oracles
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
1 parent 7ae38a0 commit d7ff0e2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎examples/shared-goal-authority-e2e/mutants.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,18 @@ def main() -> int:
387387
for folder in ("loopx", "tests"):
388388
shutil.copytree(source / folder, frozen / folder,
389389
ignore=shutil.ignore_patterns("__pycache__", "*.pyc", ".pytest_cache"))
390-
for name in ("package.json", "pyproject.toml"):
390+
# TS oracles import the repository's supported-Python discovery helper.
391+
# Freeze that dependency too; a missing import is not a killed mutant.
392+
support_files = ("package.json", "pyproject.toml", "scripts/test-python.mjs")
393+
for name in support_files:
394+
(frozen / name).parent.mkdir(parents=True, exist_ok=True)
391395
shutil.copy2(source / name, frozen / name)
392396
if (source / "node_modules").is_dir():
393397
(frozen / "node_modules").symlink_to(source / "node_modules", target_is_directory=True)
394398
manifest = {str(path.relative_to(frozen)): hashlib.sha256(path.read_bytes()).hexdigest()
395399
for folder in ("loopx", "tests") for path in (frozen / folder).rglob("*") if path.is_file()}
400+
manifest.update({name: hashlib.sha256((frozen / name).read_bytes()).hexdigest()
401+
for name in support_files})
396402
(output / "source-manifest.json").write_text(json.dumps(manifest, indent=2) + "\n")
397403
for case in cases:
398404
originals = {path: (frozen / path).read_text() for path, _ in case.edits}

0 commit comments

Comments
 (0)