Answer prose round 1: 0 🔴, 0 🟡 (0 misread); say the copy gets its own repository, shorten the test comment
CI / tests (pull_request) Has been cancelled
CI / tests (pull_request) Has been cancelled
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user