diff --git a/bin/task_bench/tasks.py b/bin/task_bench/tasks.py index fa7775ee..a54cc5a7 100644 --- a/bin/task_bench/tasks.py +++ b/bin/task_bench/tasks.py @@ -104,8 +104,8 @@ def committed(git: Git, tree: str) -> Failure | None: def tests_in_copy(containers: Containers, tree: str, folder: pathlib.Path, git: Git) -> Ran | Failure: - """The test command's run in a copy of tree, removed afterwards, so what the tests write stays out of tree. The copy is - committed first, since a project's tests may call git and a tree from `git archive` holds no repository.""" + """The test command's run in a copy of tree, removed afterwards, so what the tests write stays out of tree. The copy gets a repository + of its own with one commit first, since a project's tests may call git and a tree from `git archive` holds none.""" copy = folder / "tested" copied = on_disk(f"copy {tree} to test it", lambda: shutil.copytree(tree, copy, symlinks=True)) if isinstance(copied, Failure): diff --git a/bin/task_bench/test_task_bench.py b/bin/task_bench/test_task_bench.py index 5c0f4d2a..7ac67aed 100644 --- a/bin/task_bench/test_task_bench.py +++ b/bin/task_bench/test_task_bench.py @@ -299,7 +299,7 @@ class BenchTest(unittest.TestCase): self.assertEqual(subprocess.run(["git", "status", "--porcelain"], cwd=tree, env=self.env, check=True, capture_output=True, text=True).stdout, "") def test_tests_that_call_git_run_in_a_repository_at_each_side(self): - # The sides' trees come from `git archive`, which leaves out `.git`; `git ls-files` exits 128 in a tree that isn't a repository. + # `git ls-files` fails in a tree that isn't a repository. found = self.bench(**{"--test": "git ls-files --error-unmatch calc.go >/dev/null && sh calc_test.go"}) self.assertNotIsInstance(found, Failure, found)