feat: pending_pr marker, so tests skip until their source PR merges - #13
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 opendevPRs 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-markerssafe).conftest.py:pytest_collection_modifyitemslooks upGET /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.GH_PR_TOKEN(the job token) so the lookups are authenticated. A test with nopending_prmarker makes no API calls.Local check. The ungated test ran, and the gated one skipped:
(
DataSpaceFrontend#476is merged, so its test ran.#470is 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.ymlcalled from ParakhAI-frontend CD will not get this secret either.