Skip to content

Commit

Permalink
Increase the possible pullid range
Browse files Browse the repository at this point in the history
This is because some tests depends on the pull id being 2 digits.
Changed the tests and the factory to emit 3 digit pull ids.
  • Loading branch information
michelletran-codecov committed Oct 31, 2024
1 parent 6aeac1e commit a7c0ba5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion database/tests/factories/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class PullFactory(Factory):
class Meta:
model = models.Pull

pullid = factory.Sequence(lambda n: 10 + (7 * n) % 90)
pullid = factory.Sequence(lambda n: 100 + (7 * n) % 900)
state = "open"

repository = factory.SubFactory(RepositoryFactory)
Expand Down
38 changes: 19 additions & 19 deletions services/notification/notifiers/tests/unit/test_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ def test_build_message(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=============================================",
"+ Coverage 50.00% 60.00% +10.00% ",
"+ Complexity 11 10 -1 ",
Expand Down Expand Up @@ -987,7 +987,7 @@ def test_build_message_more_sections(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=============================================",
"+ Coverage 50.00% 60.00% +10.00% ",
"+ Complexity 11 10 -1 ",
Expand Down Expand Up @@ -1280,7 +1280,7 @@ def test_build_message_hide_complexity(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=============================================",
"+ Coverage 50.00% 60.00% +10.00% ",
"+ Complexity 11 10 -1 ",
Expand Down Expand Up @@ -1358,7 +1358,7 @@ def test_build_message_no_base_report(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=========================================",
" Coverage ? 60.00% ",
" Complexity ? 10 ",
Expand Down Expand Up @@ -1433,7 +1433,7 @@ def test_build_message_no_base_commit(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=========================================",
" Coverage ? 60.00% ",
" Complexity ? 10 ",
Expand Down Expand Up @@ -1510,7 +1510,7 @@ def test_build_message_no_change(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=========================================",
" Coverage 60.00% 60.00% ",
" Complexity 10 10 ",
Expand Down Expand Up @@ -1583,7 +1583,7 @@ def test_build_message_negative_change(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=============================================",
"- Coverage 60.00% 50.00% -10.00% ",
"- Complexity 10 11 +1 ",
Expand Down Expand Up @@ -1677,7 +1677,7 @@ def test_build_message_negative_change_tricky_rounding(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"==========================================",
"- Coverage 88.58% 88.54% -0.04% ",
"==========================================",
Expand Down Expand Up @@ -1781,7 +1781,7 @@ def test_build_message_show_carriedforward_flags_no_cf_coverage(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=============================================",
"+ Coverage 50.00% 60.00% +10.00% ",
"+ Complexity 11 10 -1 ",
Expand Down Expand Up @@ -1857,7 +1857,7 @@ def test_build_message_with_without_flags(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=======================================",
" Coverage 65.38% 65.38% ",
"=======================================",
Expand Down Expand Up @@ -1913,7 +1913,7 @@ def test_build_message_with_without_flags(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=======================================",
" Coverage 65.38% 65.38% ",
"=======================================",
Expand Down Expand Up @@ -1986,7 +1986,7 @@ def test_build_message_show_carriedforward_flags_has_cf_coverage(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=======================================",
" Coverage 65.38% 65.38% ",
"=======================================",
Expand Down Expand Up @@ -2059,7 +2059,7 @@ def test_build_message_hide_carriedforward_flags_has_cf_coverage(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=======================================",
" Coverage 65.38% 65.38% ",
"=======================================",
Expand Down Expand Up @@ -2161,7 +2161,7 @@ def test_build_message_no_flags(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=============================================",
"+ Coverage 50.00% 60.00% +10.00% ",
"+ Complexity 11 10 -1 ",
Expand Down Expand Up @@ -4152,7 +4152,7 @@ def test_build_message_no_base_commit_new_layout(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=========================================",
" Coverage ? 60.00% ",
" Complexity ? 10 ",
Expand Down Expand Up @@ -4224,7 +4224,7 @@ def test_build_message_no_base_report_new_layout(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=========================================",
" Coverage ? 60.00% ",
" Complexity ? 10 ",
Expand Down Expand Up @@ -4426,7 +4426,7 @@ def test_build_message_head_and_pull_head_differ_new_layout(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=============================================",
"+ Coverage 50.00% 60.00% +10.00% ",
"+ Complexity 11 10 -1 ",
Expand Down Expand Up @@ -4503,7 +4503,7 @@ def test_build_message_head_and_pull_head_differ_with_components(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=============================================",
"+ Coverage 50.00% 60.00% +10.00% ",
"+ Complexity 11 10 -1 ",
Expand Down Expand Up @@ -4740,7 +4740,7 @@ def test_build_message_no_patch_or_proj_change(
"",
"```diff",
"@@ Coverage Diff @@",
f"## master #{pull.pullid} +/- ##",
f"## master #{pull.pullid} +/- ##",
"=======================================",
" Coverage 65.38% 65.38% ",
"=======================================",
Expand Down

0 comments on commit a7c0ba5

Please sign in to comment.