diff --git a/CHANGELOG.md b/CHANGELOG.md index f291de8..9a0296b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,13 @@ per-file diff commands. ### Fixed +- **Placeholder-integrity tests in `python-tests` now skip on forks** (#405) - the dedicated + `placeholder-integrity` job already gates on the upstream repo name, but `python-tests` ran + `unittest discover` with no such guard, so forks that personalized files via `/setup` failed + three sentinel checks permanently. Both test classes now use `@unittest.skipIf` on + `GITHUB_REPOSITORY` (defaulting to upstream when unset so local pristine-template runs still + execute). + - **`convert_salary_excel.py` no longer mistakes a title/citation row for the header row** (#414) - header-row detection accepted the first row in the first 10 where *any* cell merely contained a company-pattern word, with no check that the row actually looked like a header. A diff --git a/tests/test_placeholder_integrity.py b/tests/test_placeholder_integrity.py index 2e04d1c..367002e 100644 --- a/tests/test_placeholder_integrity.py +++ b/tests/test_placeholder_integrity.py @@ -15,9 +15,12 @@ the sentinels exist in the pristine files, and (c) that simulating the /setup edit destroys at least one checked sentinel per file - i.e. the guard actually fires on the failure it exists to catch. """ +import os import unittest from pathlib import Path +UPSTREAM = "MadsLorentzen/ai-job-search" + REPO = Path(__file__).resolve().parent.parent CI = REPO / ".github" / "workflows" / "ci.yml" EXAMPLE_CV = REPO / "cv" / "main_example.tex" @@ -41,6 +44,10 @@ def personalize_cv(text: str) -> str: ) +@unittest.skipIf( + os.environ.get("GITHUB_REPOSITORY", UPSTREAM) != UPSTREAM, + "placeholder-integrity guards the pristine upstream template; forks personalize these files via /setup", +) class TestCvSentinelsAreDataLocated(unittest.TestCase): def setUp(self): self.ci = CI.read_text(encoding="utf-8") @@ -74,6 +81,10 @@ class TestCvSentinelsAreDataLocated(unittest.TestCase): ) +@unittest.skipIf( + os.environ.get("GITHUB_REPOSITORY", UPSTREAM) != UPSTREAM, + "placeholder-integrity guards the pristine upstream template; forks personalize these files via /setup", +) class TestProfileSentinelIsDataLocated(unittest.TestCase): def test_ci_checks_a_data_placeholder_not_the_header_comment(self): ci = CI.read_text(encoding="utf-8")