Skip to content

feat: pending_pr marker, so tests skip until their source PR merges - #13

Merged
saqibmanan merged 3 commits into
mainfrom
feat/pending-pr-marker
Sep 28, 2026
Merged

saqibmanan merged 3 commits into
mainfrom
feat/pending-pr-marker

Conversation

@saqibmanan

Copy link
Copy Markdown
Contributor

Adds a pending_pr("Repo#N") marker. A test that carries it is skipped until GitHub reports that source PR merged, and after that it runs normally. This lets pr-test-sync write coverage for open dev PRs older than 72h now, so the tests are reviewed and ready when the PR lands, with no CI noise before then.

  • pytest.ini: registers the marker (--strict-markers safe).
  • conftest.py: pytest_collection_modifyitems looks up GET /repos/<owner>/<repo>/pulls/<N>, once per ref per session (stdlib only, no new dependency). If the PR isn't merged, or its state can't be read, the test skips with the reason shown.
  • Workflows: pass GH_PR_TOKEN (the job token) so the lookups are authenticated. A test with no pending_pr marker makes no API calls.

Local check. The ungated test ran, and the gated one skipped:

SKIPPED [1] pending_pr DataSpaceFrontend#470: not merged yet
SKIPPED [1] pending_pr CivicDataLab/ParakhAI-Backend#106: could not read PR state (HTTP Error 404: Not Found)
1 passed, 2 skipped

(DataSpaceFrontend#476 is merged, so its test ran. #470 is open. The 404 is a private repo read without a token.)

Needs a secret: ParakhAI-Backend is private, so add GH_PR_TOKEN: a fine-grained PAT with Pull requests: read on that repo. Without it, tests pending on a backend PR skip with the 404 reason even after the merge. run-smoke.yml called from ParakhAI-frontend CD will not get this secret either.

@saqibmanan
saqibmanan marked this pull request as ready for review September 28, 2026 08:51
@saqibmanan
saqibmanan merged commit 6fe649e into main Sep 28, 2026
14 checks passed
@saqibmanan
saqibmanan deleted the feat/pending-pr-marker branch September 28, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant