mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-10 12:47:04 +00:00
Merge fix/tests/dockerignore-lint-conformance into feature/store-i18n
Maintainer's main hotfix8860074807: test_dockerignore.py from #1384 imports PROJECT_ROOT from the package and reads through utils.cache.files, so test_project_root_import and test_no_uncached_file_reads pass (gate pass 1 ond9c278ce46red on both). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
9154a03fed
1 file changed
+8
-6
@@ -1,27 +1,29 @@
|
||||
import re
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
PROJECT_ROOT = Path(__file__).resolve().parents[3]
|
||||
from utils.cache.files import read_text
|
||||
|
||||
from . import PROJECT_ROOT
|
||||
|
||||
NESTED_CHECKOUTS = (".claude/worktrees/", ".worktrees/")
|
||||
|
||||
|
||||
class TestDockerignore(unittest.TestCase):
|
||||
def test_dockerignore_is_the_gitignore(self) -> None:
|
||||
self.assertEqual(
|
||||
(PROJECT_ROOT / ".gitignore").read_text(),
|
||||
(PROJECT_ROOT / ".dockerignore").read_text(),
|
||||
read_text(str(PROJECT_ROOT / ".gitignore")),
|
||||
read_text(str(PROJECT_ROOT / ".dockerignore")),
|
||||
"Run 'make fix-dockerignore': .dockerignore must be a copy of .gitignore.",
|
||||
)
|
||||
|
||||
def test_nested_checkouts_stay_out_of_the_build_context(self) -> None:
|
||||
lines = (PROJECT_ROOT / ".dockerignore").read_text().splitlines()
|
||||
lines = read_text(str(PROJECT_ROOT / ".dockerignore")).splitlines()
|
||||
for entry in NESTED_CHECKOUTS:
|
||||
with self.subTest(entry=entry):
|
||||
self.assertIn(entry, lines)
|
||||
|
||||
def test_compose_up_regenerates_the_dockerignore(self) -> None:
|
||||
makefile = (PROJECT_ROOT / "Makefile").read_text()
|
||||
makefile = read_text(str(PROJECT_ROOT / "Makefile"))
|
||||
match = re.search(r"^compose-up:(.*)$", makefile, re.MULTILINE)
|
||||
self.assertIsNotNone(match, "Makefile has no compose-up target")
|
||||
self.assertIn("fix-dockerignore", match.group(1).split())
|
||||
|
||||
Reference in new issue
Block a user