Answer stability round 1: 0 🔴, 4 🟡 (0 misread); a cycle's close takes the task from the cycle, a resolved thread is skipped unread, and tests run git in their own environment
CI / tests (pull_request) Successful in 3m56s
CI / tests (pull_request) Successful in 3m56s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import collections
|
||||
import contextlib
|
||||
import dataclasses
|
||||
import functools
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
@@ -319,7 +320,7 @@ class BranchHistory(unittest.TestCase):
|
||||
folder = configured(self, checkout)
|
||||
config = folder / "config.toml"
|
||||
config.write_text(config.read_text().replace('"checkout:todo.md"', '"folder:todo.md"'))
|
||||
found = archive.branch_history(str(checkout), folder.parents[1], BARE, git_repo.git)
|
||||
found = archive.branch_history(str(checkout), folder.parents[1], BARE, functools.partial(git_repo.git, env=isolated_env()))
|
||||
assert isinstance(found, Failure), found
|
||||
self.assertEqual(found.reason, f"its chunks' items and later fixes are not counted: the project's config puts {folder}/todo.md elsewhere than todo.md, docs/comprehension-history.md, docs/reading-cost.md in the checkout, the only paths whose commits are read so far")
|
||||
|
||||
@@ -365,7 +366,7 @@ class Archive(unittest.TestCase):
|
||||
env = {**isolated_env(), "GIT_CONFIG_GLOBAL": os.devnull, "HOME": str(home)}
|
||||
self.ship_then_fix(home / "code" / "log", env)
|
||||
self.chunk("log", "c1", stamped("2026-10-14T10:00:00Z", outcomes.finished(LOW_ROUTE, "m", "j")), [message("m1", "2026-10-14T09:00:00Z")])
|
||||
found = archive.measure_archive(self.root, str(home), "", git_repo.git)
|
||||
found = archive.measure_archive(self.root, str(home), "", functools.partial(git_repo.git, env=env))
|
||||
self.assertEqual([(chunk.dollars["project"].keys(), chunk.fixed_later) for chunk in found.chunks], [({"log": 0}.keys(), 1)])
|
||||
|
||||
def test_reads_a_projects_round_titles_and_its_branchs_history_through_its_configs_templates(self):
|
||||
@@ -376,9 +377,9 @@ class Archive(unittest.TestCase):
|
||||
config = write_config(home, home / "code" / "log") / "config.toml"
|
||||
worker = [message(f"m{n}", "2026-10-14T09:00:00Z", call("Bash", command=f"git commit -m '{round_title.format(n)}'")) for n in (1, 2)]
|
||||
self.chunk("log", "c1", stamped("2026-10-14T10:00:00Z", outcomes.finished(LOW_ROUTE, "m", "j")), worker)
|
||||
bare = archive.measure_archive(self.root, str(home), "", git_repo.git)
|
||||
bare = archive.measure_archive(self.root, str(home), "", functools.partial(git_repo.git, env=env))
|
||||
config.write_text(config.read_text() + 'commit-title = "PAY-{id} - {summary}"\n')
|
||||
templated = archive.measure_archive(self.root, str(home), "", git_repo.git)
|
||||
templated = archive.measure_archive(self.root, str(home), "", functools.partial(git_repo.git, env=env))
|
||||
self.assertEqual([(chunk.rounds_past_first, chunk.fixed_later) for chunk in bare.chunks], [(0, 0)])
|
||||
self.assertEqual([(chunk.rounds_past_first, chunk.fixed_later) for chunk in templated.chunks], [(1, 1)])
|
||||
|
||||
@@ -389,7 +390,7 @@ class Archive(unittest.TestCase):
|
||||
config = write_config(home, home / "code" / "log") / "config.toml"
|
||||
config.write_text(config.read_text() + 'commit-title = "PAY-{id}"\n')
|
||||
self.chunk("log", "c1", stamped("2026-10-14T10:00:00Z", outcomes.finished(LOW_ROUTE, "m", "j")), [message("m1", "2026-10-14T09:00:00Z")])
|
||||
found = archive.measure_archive(self.root, str(home), "", git_repo.git)
|
||||
found = archive.measure_archive(self.root, str(home), "", functools.partial(git_repo.git, env=env))
|
||||
self.assertEqual(found.chunks, [])
|
||||
self.assertEqual(len(found.unread), 1)
|
||||
self.assertRegex(found.unread[0], r"^log: none of its chunks is measured: .*`commit-title` is 'PAY-\{id\}'")
|
||||
@@ -403,7 +404,7 @@ class Archive(unittest.TestCase):
|
||||
|
||||
def recording(*args, **options):
|
||||
made.append((args[0], options))
|
||||
return git_repo.git(*args, **options)
|
||||
return git_repo.git(*args, **options, env=env)
|
||||
archive.measure_archive(self.root, str(home), "", recording)
|
||||
self.assertTrue(all(options.get("guarded") is True for _, options in made))
|
||||
read = [options.get("timeout") for command, options in made if command in ("log", "ls-tree", "show", "diff", "blame")]
|
||||
@@ -416,7 +417,7 @@ class Archive(unittest.TestCase):
|
||||
(home / "code" / "log").mkdir(parents=True)
|
||||
subprocess.run(["git", "init", "-q"], cwd=home / "code" / "log", check=True, env=env, capture_output=True)
|
||||
self.chunk("log", "c1", stamped("2026-10-14T10:00:00Z", outcomes.finished(LOW_ROUTE, "m", "j")), [message("m1", "2026-10-14T09:00:00Z")])
|
||||
found = archive.measure_archive(self.root, str(home), "", git_repo.git)
|
||||
found = archive.measure_archive(self.root, str(home), "", functools.partial(git_repo.git, env=env))
|
||||
self.assertEqual(found.unread, ("log: no origin remote, and no main or master branch to take as the default branch",))
|
||||
|
||||
def test_names_each_project_whose_history_it_cannot_read(self):
|
||||
|
||||
Reference in New Issue
Block a user