mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 00:26:26 +00:00
fix(ci): skip placeholder-integrity tests on forks in python-tests (#407)
Add @unittest.skipIf on GITHUB_REPOSITORY to TestCvSentinelsAreDataLocated and TestProfileSentinelIsDataLocated so python-tests matches the upstream-only placeholder-integrity job. Default unset GITHUB_REPOSITORY to upstream so local pristine-template runs still execute the guards. Fixes MadsLorentzen/ai-job-search#405 Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: shahidbeig-a11y <shahidbeig-a11y@users.noreply.github.com>
This commit is contained in:
co-authored by
Cursor Agent
shahidbeig-a11y
parent
7f709eda57
commit
6f0178a8a1
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user