Skip to content

Commit 96535e2

Browse files
committed
test: build the shorter report under the same environment as the comment
On a runner GITHUB_REPOSITORY and GITHUB_RUN_ID are set, so the report measured outside the patched environment linked a longer run URL than the comment did, and the limit taken from it let the comment keep its diff.
1 parent d07885b commit 96535e2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎main_test.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,13 +2765,13 @@ def test_dozens_of_failing_commits_still_fit(self):
27652765

27662766
def test_the_diff_goes_too_when_the_listing_was_not_enough(self):
27672767
results = self._failing_commits(2)
2768-
short = main.render_report(results, "short")
27692768
with (
2770-
patch("main.COMMENT_LIMIT", len(short) - 1),
27712769
patch.dict(os.environ, self.RUN),
27722770
patch("main.JOB_SUMMARY_ENABLED", False),
27732771
):
2774-
comment = main.render_pr_comment(results)
2772+
short = main.render_report(results, "short")
2773+
with patch("main.COMMENT_LIMIT", len(short) - 1):
2774+
comment = main.render_pr_comment(results)
27752775
self.assertNotIn("```diff", comment)
27762776
self.assertNotIn("How to fix</b>", comment)
27772777
self.assertIn(

0 commit comments

Comments
 (0)