Repository navigation
Replay GitHub in-process in readiness and recovery tests #1521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| ) | ||
|
|
||
| gh, git_seed, repo, wt = support.gh, support.git_seed, support.repo, support.wt | ||
| replay_gh = support.replay_gh | ||
| REVIEW_COMMENTS = f"api repos/{REPO}/pulls/7/reviews/17/comments?per_page=100&page=1" | ||
|
|
||
|
|
||
|
|
@@ -88,7 +89,7 @@ def assert_single_publication(gh, fake_bin): | |
| @pytest.mark.parametrize("verdict", [0, 5]) | ||
| @pytest.mark.parametrize("interrupted", [False, True, "timeout"]) | ||
| def test_accepted_publication_recovers_saved_verdict( | ||
| wt, gh, fake_bin, monkeypatch, capsys, kind, verdict, interrupted, | ||
| wt, gh, fake_bin, monkeypatch, capsys, kind, verdict, interrupted, replay_gh, | ||
| ): | ||
| lost_reply(wt, gh, fake_bin, monkeypatch, kind=kind, verdict=verdict, | ||
| interrupted=interrupted is True, timeout=interrupted == "timeout") | ||
|
|
@@ -113,7 +114,7 @@ def test_accepted_publication_recovers_saved_verdict( | |
| "head", "comment_page", "kind", "wrong_head"]) | ||
| @pytest.mark.parametrize("interrupted", [False, True]) | ||
| def test_recovery_requires_exact_live_publication( | ||
| wt, gh, fake_bin, monkeypatch, capsys, change, interrupted, | ||
| wt, gh, fake_bin, monkeypatch, capsys, change, interrupted, replay_gh, | ||
| ): | ||
| def mutate(rows, comments): | ||
| if change == "body": | ||
|
|
@@ -247,7 +248,7 @@ def request(argv, **kwargs): | |
| ("null", "single"), ("empty", "single"), ("malformed", "single"), | ||
| ]) | ||
| def test_historical_publication_recovery_is_exact_and_legacy_only( | ||
| interrupted_receipt, gh, fake_bin, capsys, metadata, source, shape, | ||
| replay_gh, interrupted_receipt, gh, fake_bin, capsys, metadata, source, shape, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Replay coverage of the interrupted_receipt setup depends on parameter order In this test |
||
| ): | ||
| head, path, saved, _ = interrupted_receipt | ||
| envelope = json.loads(saved["raw"]) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Opt-in style is inconsistent with neighbouring replay tests
Neighbouring tests at test_cli.py:2688 and :2784 opt in with
@pytest.mark.usefixtures("replay_gh"). This diff instead addsreplay_ghas an unused parameter in three test_cli tests (2739, 2820, 2867). That pushes lines 2739 and 2820 past the 100-character line-length, and at 2867 it putshead, replay_gh,on one line, breaking the one-parameter-per-line layout. Nothing fails because ruff does not select E501 and tests ignore ARG, but the file now has two ways to do the same thing. Smallest fix: use@pytest.mark.usefixtures("replay_gh")on these three tests to match the existing ones. In test_review_recovery.py, the two tests wherereplay_ghis the last parameter can switch the same way. Keeptest_historical_publication_recovery_is_exact_and_legacy_onlyas it is (see the next finding).