From 50dee4e933faf084d6440b6864f3d85d2c73129c Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 3 Dec 2026 13:25:50 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20prose=20round=201:=200=20=F0=9F=94=B4,?= =?UTF-8?q?=200=20=F0=9F=9F=A1=20(0=20misread);=20say=20the=20copy=20gets?= =?UTF-8?q?=20its=20own=20repository,=20shorten=20the=20test=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/task_bench/tasks.py | 4 ++-- bin/task_bench/test_task_bench.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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)