From 9b6a27d92bec94366be2733c43b81e598ac55ce0 Mon Sep 17 00:00:00 2001 From: Ajay Singh Date: Fri, 7 Jun 2024 16:16:52 -0700 Subject: [PATCH] fix most f rules on worker --- Makefile | 9 +- ruff.toml | 63 + .../notification/notifiers/checks/base.py | 4 +- .../notifiers/comment/__init__.py | 12 +- .../notifiers/mixins/message/helpers.py | 5 +- .../notification/notifiers/mixins/status.py | 2 +- .../tests/integration/test_comment.py | 8 +- .../notifiers/tests/unit/test_checks.py | 68 +- .../notifiers/tests/unit/test_comment.py | 1154 ++++++++--------- .../notifiers/tests/unit/test_status.py | 6 +- .../tests/unit/test_notification_service.py | 2 +- services/report/__init__.py | 5 +- services/tests/test_bots.py | 4 +- services/tests/test_flake_detector.py | 26 - services/tests/test_urls.py | 4 +- services/timeseries.py | 1 - tasks/send_email.py | 6 +- tasks/tests/integration/test_notify_task.py | 4 +- ...st_backfill_commit_data_to_storage_task.py | 2 +- ..._backfill_existing_gh_app_installations.py | 4 +- .../test_bundle_analysis_processor_task.py | 10 +- tasks/tests/unit/test_clean_labels_index.py | 2 +- tasks/tests/unit/test_new_user_activated.py | 12 - tasks/tests/unit/test_notify_task.py | 2 +- tasks/tests/unit/test_sync_repo_languages.py | 2 +- .../tests/unit/test_test_results_finisher.py | 2 +- tasks/upload.py | 3 +- tasks/upload_finisher.py | 2 +- 28 files changed, 726 insertions(+), 698 deletions(-) create mode 100644 ruff.toml diff --git a/Makefile b/Makefile index de709d455..cc3d1491e 100644 --- a/Makefile +++ b/Makefile @@ -66,15 +66,18 @@ lint.install: echo "Installing..." pip install -Iv ruff +# The preferred method (for now) w.r.t. fixable rules is to manually update the makefile +# with --fix and re-run 'make lint.' Since ruff is constantly adding rules this is a slight +# amount of "needed" friction imo. lint.run: - ruff check --select F401 --select I . --fix + ruff check ruff format lint.check: echo "Linting..." + ruff check + echo "Formatting..." ruff format --check - echo "Sorting..." - ruff check --select F401 --select I . build.requirements: # if docker pull succeeds, we have already build this version of diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 000000000..52ad2f14b --- /dev/null +++ b/ruff.toml @@ -0,0 +1,63 @@ +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 88 +indent-width = 4 + +# Assume Python 3.12 +target-version = "py312" + +[lint] +# Currently only enabled for most F (Pyflakes) and I (isort) rules: https://docs.astral.sh/ruff/rules/ +select = ["F", "I"] +ignore = ["F841", "F405", "F403"] + +# Allow fix for all enabled rules (when `--fix`) is provided. +# The preferred method (for now) w.r.t. fixable rules is to manually update the makefile +# with --fix and re-run 'make lint' +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" \ No newline at end of file diff --git a/services/notification/notifiers/checks/base.py b/services/notification/notifiers/checks/base.py index 1a1f1e2fe..c575bf234 100644 --- a/services/notification/notifiers/checks/base.py +++ b/services/notification/notifiers/checks/base.py @@ -55,8 +55,8 @@ def get_upgrade_message(self, comparison: Comparison) -> str: [ f"The author of this PR, {author_username}, is not an activated member of this organization on Codecov.", f"Please [activate this user on Codecov]({links['members_url']}) to display a detailed status check.", - f"Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.", - f"Please don't hesitate to email us at support@codecov.io with any questions.", + "Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.", + "Please don't hesitate to email us at support@codecov.io with any questions.", ] ) diff --git a/services/notification/notifiers/comment/__init__.py b/services/notification/notifiers/comment/__init__.py index 5f9c157ff..6a2083d17 100644 --- a/services/notification/notifiers/comment/__init__.py +++ b/services/notification/notifiers/comment/__init__.py @@ -413,8 +413,8 @@ def _create_reached_upload_limit_message(self, comparison): f"This org is currently on the free Basic Plan; which includes 250 free private repo uploads each rolling month.\ This limit has been reached and additional reports cannot be generated. For unlimited uploads,\ upgrade to our [pro plan]({links['plan_url']}).", - f"", - f"**Do you have questions or need help?** Connect with our sales team today at ` sales@codecov.io `", + "", + "**Do you have questions or need help?** Connect with our sales team today at ` sales@codecov.io `", ] def _create_upgrade_message(self, comparison): @@ -430,15 +430,15 @@ def _create_upgrade_message(self, comparison): return [ f"The author of this PR, {author_username}, is not an activated member of this organization on Codecov.", f"Please [activate this user on Codecov]({links['members_url_cloud']}) to display this PR comment.", - f"Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.", - f"Please don't hesitate to email us at support@codecov.io with any questions.", + "Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.", + "Please don't hesitate to email us at support@codecov.io with any questions.", ] else: return [ f"The author of this PR, {author_username}, is not activated in your Codecov Self-Hosted installation.", f"Please [activate this user]({links['members_url_self_hosted']}) to display this PR comment.", - f"Coverage data is still being uploaded to Codecov Self-Hosted for the purposes of overall coverage calculations.", - f"Please contact your Codecov On-Premises installation administrator with any questions.", + "Coverage data is still being uploaded to Codecov Self-Hosted for the purposes of overall coverage calculations.", + "Please contact your Codecov On-Premises installation administrator with any questions.", ] def _create_processing_upload_message(self): diff --git a/services/notification/notifiers/mixins/message/helpers.py b/services/notification/notifiers/mixins/message/helpers.py index 06044e5cc..61408b00e 100644 --- a/services/notification/notifiers/mixins/message/helpers.py +++ b/services/notification/notifiers/mixins/message/helpers.py @@ -293,7 +293,10 @@ def _row(title, c1, c2, plus="+", minus="-", neutral=" "): spacer = ["=" * row_w] title = "@@%s@@" % "{text:{fill}{align}{width}}".format( - text="Coverage Diff", fill=" ", align="^", width=row_w - 4, strip=True + text="Coverage Diff", + fill=" ", + align="^", + width=row_w - 4, ) table = ( diff --git a/services/notification/notifiers/mixins/status.py b/services/notification/notifiers/mixins/status.py index de80f2268..61cddc0d2 100644 --- a/services/notification/notifiers/mixins/status.py +++ b/services/notification/notifiers/mixins/status.py @@ -142,7 +142,7 @@ async def _apply_removals_only_behavior( ) ) if no_added_no_unexpected_change and some_removed: - return ("success", f", passed because this change only removed code") + return ("success", ", passed because this change only removed code") return None async def _apply_adjust_base_behavior( diff --git a/services/notification/notifiers/tests/integration/test_comment.py b/services/notification/notifiers/tests/integration/test_comment.py index b913d459c..2d630d566 100644 --- a/services/notification/notifiers/tests/integration/test_comment.py +++ b/services/notification/notifiers/tests/integration/test_comment.py @@ -543,12 +543,12 @@ async def test_notify_upload_limited( assert result.notification_successful assert result.explanation is None expected_message = [ - f"## [Codecov](https://app.codecov.io/plan/gh/test-acc9) upload limit reached :warning:", - f"This org is currently on the free Basic Plan; which includes 250 free private repo uploads each rolling month.\ + "## [Codecov](https://app.codecov.io/plan/gh/test-acc9) upload limit reached :warning:", + "This org is currently on the free Basic Plan; which includes 250 free private repo uploads each rolling month.\ This limit has been reached and additional reports cannot be generated. For unlimited uploads,\ upgrade to our [pro plan](https://app.codecov.io/plan/gh/test-acc9).", - f"", - f"**Do you have questions or need help?** Connect with our sales team today at ` sales@codecov.io `", + "", + "**Do you have questions or need help?** Connect with our sales team today at ` sales@codecov.io `", ] for exp, res in zip(result.data_sent["message"], expected_message): assert exp == res diff --git a/services/notification/notifiers/tests/unit/test_checks.py b/services/notification/notifiers/tests/unit/test_checks.py index f81e26b96..dbdcc4b32 100644 --- a/services/notification/notifiers/tests/unit/test_checks.py +++ b/services/notification/notifiers/tests/unit/test_checks.py @@ -964,7 +964,7 @@ async def test_send_notification( comparison = sample_comparison payload = { "state": "success", - "output": {"title": "Codecov Report", "summary": f"Summary"}, + "output": {"title": "Codecov Report", "summary": "Summary"}, "url": "https://app.codecov.io/gh/codecov/worker/compare/100?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term=codecov", } mock_repo_provider.create_check_run.return_value = 2234563 @@ -994,7 +994,7 @@ async def test_send_notification_annotations_paginations( "state": "success", "output": { "title": "Codecov Report", - "summary": f"Summary", + "summary": "Summary", "annotations": list(range(1, 61, 1)), }, } @@ -1035,7 +1035,7 @@ async def test_send_notification_annotations_paginations( "state": "success", "output": { "title": "Codecov Report", - "summary": f"Summary", + "summary": "Summary", "annotations": list(range(1, 61, 1)), }, } @@ -1048,7 +1048,7 @@ async def test_notify( comparison = sample_comparison payload = { "state": "success", - "output": {"title": "Codecov Report", "summary": f"Summary"}, + "output": {"title": "Codecov Report", "summary": "Summary"}, } mock_repo_provider.create_check_run.return_value = 2234563 mock_repo_provider.update_check_run.return_value = "success" @@ -1161,7 +1161,7 @@ async def test_notification_exception( assert result.data_sent is None @pytest.mark.asyncio - async def test_notification_exception(self, sample_comparison, mocker): + async def test_notification_exception_not_fit(self, sample_comparison, mocker): notifier = ChecksNotifier( repository=sample_comparison.head.commit.repository, title="title", @@ -1364,13 +1364,13 @@ async def test_analytics_url( [ f"## [Codecov](codecov.io/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", f"> Merging [#{sample_comparison.pull.pullid}](codecov.io/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=desc) ({head_commit.commitid[:7]}) into [master](codecov.io/gh/test_build_default_payload/{repo.name}/commit/{sample_comparison.project_coverage_base.commit.commitid}?el=desc) ({base_commit.commitid[:7]}) will **increase** coverage by `10.00%`.", - f"> The diff coverage is `66.67%`.", - f"", + "> The diff coverage is `66.67%`.", + "", f"| [Files](codecov.io/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](codecov.io/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", f"| [file\\_2.py](codecov.io/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=tree&filepath=file_2.py#diff-ZmlsZV8yLnB5) | `50.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |", - f"", + "", ] ), }, @@ -1392,13 +1392,13 @@ async def test_analytics_url( [ f"## [Codecov](codecov.io/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term={quote_plus(repo.owner.name)}) Report", f"> Merging [#{sample_comparison.pull.pullid}](codecov.io/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term={quote_plus(repo.owner.name)}) ({head_commit.commitid[:7]}) into [master](codecov.io/gh/test_build_default_payload/{repo.name}/commit/{sample_comparison.project_coverage_base.commit.commitid}?el=desc&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term={quote_plus(repo.owner.name)}) ({base_commit.commitid[:7]}) will **increase** coverage by `10.00%`.", - f"> The diff coverage is `66.67%`.", - f"", + "> The diff coverage is `66.67%`.", + "", f"| [Files](codecov.io/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term={quote_plus(repo.owner.name)}) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](codecov.io/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=tree&filepath=file_1.go&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term={quote_plus(repo.owner.name)}#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", f"| [file\\_2.py](codecov.io/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=tree&filepath=file_2.py&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term={quote_plus(repo.owner.name)}#diff-ZmlsZV8yLnB5) | `50.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |", - f"", + "", ] ), }, @@ -1511,13 +1511,13 @@ async def test_build_default_payload( "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{base_commit.commitid[:7]}`)](test.example.br/gh/test_build_default_payload/{repo.name}/commit/{base_commit.commitid}?dropdown=coverage&el=desc) to head [(`{head_commit.commitid[:7]}`)](test.example.br/gh/test_build_default_payload/{repo.name}/commit/{head_commit.commitid}?dropdown=coverage&el=desc)." f"", - f"", + "", f"| [Files](test.example.br/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](test.example.br/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", - f"", + "", f"... and [1 file with indirect coverage changes](test.example.br/gh/test_build_default_payload/{repo.name}/pull/{sample_comparison.pull.pullid}/indirect-changes?src=pr&el=tree-more)", - f"", + "", ] ), }, @@ -1554,13 +1554,13 @@ async def test_build_default_payload_with_flags( "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{base_commit.commitid[:7]}`)](test.example.br/gh/test_build_default_payload_with_flags/{repo.name}/commit/{base_commit.commitid}?dropdown=coverage&el=desc) to head [(`{head_commit.commitid[:7]}`)](test.example.br/gh/test_build_default_payload_with_flags/{repo.name}/commit/{head_commit.commitid}?dropdown=coverage&el=desc)." f"", - f"", + "", f"| [Files](test.example.br/gh/test_build_default_payload_with_flags/{repo.name}/pull/{sample_comparison.pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](test.example.br/gh/test_build_default_payload_with_flags/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", - f"", + "", f"... and [1 file with indirect coverage changes](test.example.br/gh/test_build_default_payload_with_flags/{repo.name}/pull/{sample_comparison.pull.pullid}/indirect-changes?src=pr&el=tree-more)", - f"", + "", ] ), }, @@ -1597,20 +1597,20 @@ async def test_build_default_payload_with_flags_and_footer( f"## [Codecov](test.example.br/gh/{test_name}/{repo.name}/pull/{sample_comparison.pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{base_commit.commitid[:7]}`)](test.example.br/gh/test_build_default_payload_with_flags_and_footer/{repo.name}/commit/{base_commit.commitid}?dropdown=coverage&el=desc) to head [(`{head_commit.commitid[:7]}`)](test.example.br/gh/test_build_default_payload_with_flags_and_footer/{repo.name}/commit/{head_commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"| [Files](test.example.br/gh/{test_name}/{repo.name}/pull/{sample_comparison.pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](test.example.br/gh/{test_name}/{repo.name}/pull/{sample_comparison.pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", - f"", + "", f"... and [1 file with indirect coverage changes](test.example.br/gh/{test_name}/{repo.name}/pull/{sample_comparison.pull.pullid}/indirect-changes?src=pr&el=tree-more)", - f"", - f"------", - f"", + "", + "------", + "", f"[Continue to review full report in Codecov by Sentry](test.example.br/gh/{test_name}/{repo.name}/pull/{sample_comparison.pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by [Codecov](test.example.br/gh/{test_name}/{repo.name}/pull/{sample_comparison.pull.pullid}?dropdown=coverage&src=pr&el=footer). Last update [{base_commit.commitid[:7]}...{head_commit.commitid[:7]}](test.example.br/gh/{test_name}/{repo.name}/pull/{sample_comparison.pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] ), }, @@ -1726,7 +1726,7 @@ async def test_check_notify_no_path_match( comparison = sample_comparison payload = { "state": "success", - "output": {"title": "Codecov Report", "summary": f"Summary"}, + "output": {"title": "Codecov Report", "summary": "Summary"}, } mock_repo_provider.create_check_run.return_value = 2234563 mock_repo_provider.update_check_run.return_value = "success" @@ -1760,7 +1760,7 @@ async def test_check_notify_single_path_match( comparison = sample_comparison payload = { "state": "success", - "output": {"title": "Codecov Report", "summary": f"Summary"}, + "output": {"title": "Codecov Report", "summary": "Summary"}, } mock_repo_provider.create_check_run.return_value = 2234563 mock_repo_provider.update_check_run.return_value = "success" @@ -1801,7 +1801,7 @@ async def test_check_notify_multiple_path_match( comparison = sample_comparison payload = { "state": "success", - "output": {"title": "Codecov Report", "summary": f"Summary"}, + "output": {"title": "Codecov Report", "summary": "Summary"}, } mock_repo_provider.create_check_run.return_value = 2234563 mock_repo_provider.update_check_run.return_value = "success" @@ -1836,7 +1836,7 @@ async def test_check_notify_with_paths( comparison = sample_comparison payload = { "state": "success", - "output": {"title": "Codecov Report", "summary": f"Summary"}, + "output": {"title": "Codecov Report", "summary": "Summary"}, } mock_repo_provider.create_check_run.return_value = 2234563 mock_repo_provider.update_check_run.return_value = "success" diff --git a/services/notification/notifiers/tests/unit/test_comment.py b/services/notification/notifiers/tests/unit/test_comment.py index fd04e9770..cc1c729f5 100644 --- a/services/notification/notifiers/tests/unit/test_comment.py +++ b/services/notification/notifiers/tests/unit/test_comment.py @@ -748,12 +748,12 @@ async def test_create_message_files_section( f"## [Codecov](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 60.00%. Comparing base [(`{sample_comparison.project_coverage_base.commit.commitid[:7]}`)](https://app.codecov.io/gh/{repository.slug}/commit/{sample_comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{sample_comparison.head.commit.commitid[:7]}`)](https://app.codecov.io/gh/{repository.slug}/commit/{sample_comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"| [Files](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <ø> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", f"| [file\\_2.py](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_2.py#diff-ZmlsZV8yLnB5) | `50.00% <ø> (ø)` | `0.00 <0.00> (ø)` | |", - f"", + "", ] res = await notifier.create_message(comparison, pull_dict, {"layout": "files"}) for expected, res in zip(expected_result, res): @@ -909,10 +909,10 @@ async def test_create_message_files_section_with_critical_files( "Changes have been made to critical files, which contain lines commonly executed in production. [Learn more](https://docs.codecov.com/docs/impact-analysis)", "", f"| [Files](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <ø> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", f"| [file\\_2.py](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_2.py#diff-ZmlsZV8yLnB5) **Critical** | `50.00% <ø> (ø)` | `0.00 <0.00> (ø)` | |", - f"", + "", "", ] res = await notifier.build_message(comparison) @@ -942,51 +942,51 @@ async def test_build_message( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{sample_comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{sample_comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=============================================", - f"+ Coverage 50.00% 60.00% +10.00% ", - f"+ Complexity 11 10 -1 ", - f"=============================================", - f" Files 2 2 ", - f" Lines 6 10 +4 ", - f" Branches 0 1 +1 ", - f"=============================================", - f"+ Hits 3 6 +3 ", - f" Misses 3 3 ", - f"- Partials 0 1 +1 ", - f"```", - f"", + "=============================================", + "+ Coverage 50.00% 60.00% +10.00% ", + "+ Complexity 11 10 -1 ", + "=============================================", + " Files 2 2 ", + " Lines 6 10 +4 ", + " Branches 0 1 +1 ", + "=============================================", + "+ Hits 3 6 +3 ", + " Misses 3 3 ", + "- Partials 0 1 +1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [integration](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `?` | `?` | |", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (?)` | `0.00 <0.00> (?)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", - f"", + "", f"... and [1 file with indirect coverage changes](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/indirect-changes?src=pr&el=tree-more)", - f"", - f"------", - f"", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{sample_comparison.project_coverage_base.commit.commitid[:7]}...{sample_comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -1016,7 +1016,7 @@ async def test_build_message_flags_empty_coverage( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 100.00%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | |", "|---|---|---|", f"| [eighth](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `?` | |", @@ -1065,59 +1065,59 @@ async def test_build_message_more_sections( result = await notifier.build_message(comparison) expected_result = [ f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", - f"Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", + "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=============================================", - f"+ Coverage 50.00% 60.00% +10.00% ", - f"+ Complexity 11 10 -1 ", - f"=============================================", - f" Files 2 2 ", - f" Lines 6 10 +4 ", - f" Branches 0 1 +1 ", - f"=============================================", - f"+ Hits 3 6 +3 ", - f" Misses 3 3 ", - f"- Partials 0 1 +1 ", - f"```", - f"", + "=============================================", + "+ Coverage 50.00% 60.00% +10.00% ", + "+ Complexity 11 10 -1 ", + "=============================================", + " Files 2 2 ", + " Lines 6 10 +4 ", + " Branches 0 1 +1 ", + "=============================================", + "+ Hits 3 6 +3 ", + " Misses 3 3 ", + "- Partials 0 1 +1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [integration](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `?` | `?` | |", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (?)` | `0.00 <0.00> (?)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", - f"", + "", f"... and [1 file with indirect coverage changes](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/indirect-changes?src=pr&el=tree-more)", - f"", - f"------", - f"", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{sample_comparison.project_coverage_base.commit.commitid[:7]}...{sample_comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", - f"", - f"", - f"", - f"", - f"", - f"", + "", + "", + "", + "", + "", + "", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -1151,8 +1151,8 @@ async def test_build_upgrade_message( expected_result = [ f"The author of this PR, {provider_pull['author']['username']}, is not an activated member of this organization on Codecov.", f"Please [activate this user on Codecov](test.example.br/members/gh/{pull.repository.owner.username}) to display this PR comment.", - f"Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.", - f"Please don't hesitate to email us at support@codecov.io with any questions.", + "Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.", + "Please don't hesitate to email us at support@codecov.io with any questions.", ] li = 0 for exp, res in zip(expected_result, result): @@ -1191,8 +1191,8 @@ async def test_build_limited_upload_message( f"This org is currently on the free Basic Plan; which includes 250 free private repo uploads each rolling month.\ This limit has been reached and additional reports cannot be generated. For unlimited uploads,\ upgrade to our [pro plan](test.example.br/plan/gh/{pull.repository.owner.username}).", - f"", - f"**Do you have questions or need help?** Connect with our sales team today at ` sales@codecov.io `", + "", + "**Do you have questions or need help?** Connect with our sales team today at ` sales@codecov.io `", ] li = 0 for exp, res in zip(expected_result, result): @@ -1336,8 +1336,8 @@ async def test_build_upgrade_message_enterprise( expected_result = [ f"The author of this PR, {provider_pull['author']['username']}, is not activated in your Codecov Self-Hosted installation.", f"Please [activate this user](https://codecov.mysite.com/account/gh/{pull.author.username}) to display this PR comment.", - f"Coverage data is still being uploaded to Codecov Self-Hosted for the purposes of overall coverage calculations.", - f"Please contact your Codecov On-Premises installation administrator with any questions.", + "Coverage data is still being uploaded to Codecov Self-Hosted for the purposes of overall coverage calculations.", + "Please contact your Codecov On-Premises installation administrator with any questions.", ] li = 0 for exp, res in zip(expected_result, result): @@ -1365,51 +1365,51 @@ async def test_build_message_hide_complexity( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{sample_comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{sample_comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=============================================", - f"+ Coverage 50.00% 60.00% +10.00% ", - f"+ Complexity 11 10 -1 ", - f"=============================================", - f" Files 2 2 ", - f" Lines 6 10 +4 ", - f" Branches 0 1 +1 ", - f"=============================================", - f"+ Hits 3 6 +3 ", - f" Misses 3 3 ", - f"- Partials 0 1 +1 ", - f"```", - f"", + "=============================================", + "+ Coverage 50.00% 60.00% +10.00% ", + "+ Complexity 11 10 -1 ", + "=============================================", + " Files 2 2 ", + " Lines 6 10 +4 ", + " Branches 0 1 +1 ", + "=============================================", + "+ Hits 3 6 +3 ", + " Misses 3 3 ", + "- Partials 0 1 +1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | |", - f"|---|---|---|", + "|---|---|---|", f"| [integration](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `?` | |", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (?)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | |", - f"|---|---|---|", + "|---|---|---|", f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (+12.50%)` | :arrow_up: |", - f"", + "", f"... and [1 file with indirect coverage changes](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/indirect-changes?src=pr&el=tree-more)", - f"", - f"------", - f"", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{sample_comparison.project_coverage_base.commit.commitid[:7]}...{sample_comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -1439,48 +1439,48 @@ async def test_build_message_no_base_report( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`master@{comparison.project_coverage_base.commit.commitid[:7]}`). [Learn more](https://docs.codecov.io/docs/error-reference#section-missing-base-commit) about missing BASE report.", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=========================================", - f" Coverage ? 60.00% ", - f" Complexity ? 10 ", - f"=========================================", - f" Files ? 2 ", - f" Lines ? 10 ", - f" Branches ? 1 ", - f"=========================================", - f" Hits ? 6 ", - f" Misses ? 3 ", - f" Partials ? 1 ", - f"```", - f"", + "=========================================", + " Coverage ? 60.00% ", + " Complexity ? 10 ", + "=========================================", + " Files ? 2 ", + " Lines ? 10 ", + " Branches ? 1 ", + "=========================================", + " Hits ? 6 ", + " Misses ? 3 ", + " Partials ? 1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (?)` | `0.00 <0.00> (?)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", - f"", - f"------", - f"", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{comparison.project_coverage_base.commit.commitid[:7]}...{comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -1509,49 +1509,49 @@ async def test_build_message_no_base_commit( expected_result = [ f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", - f"> Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`master@cdf9aa4`). [Learn more](https://docs.codecov.io/docs/error-reference#section-missing-base-commit) about missing BASE report.", - f"", + "> Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`master@cdf9aa4`). [Learn more](https://docs.codecov.io/docs/error-reference#section-missing-base-commit) about missing BASE report.", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=========================================", - f" Coverage ? 60.00% ", - f" Complexity ? 10 ", - f"=========================================", - f" Files ? 2 ", - f" Lines ? 10 ", - f" Branches ? 1 ", - f"=========================================", - f" Hits ? 6 ", - f" Misses ? 3 ", - f" Partials ? 1 ", - f"```", - f"", + "=========================================", + " Coverage ? 60.00% ", + " Complexity ? 10 ", + "=========================================", + " Files ? 2 ", + " Lines ? 10 ", + " Branches ? 1 ", + "=========================================", + " Hits ? 6 ", + " Misses ? 3 ", + " Partials ? 1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (?)` | `0.00 <0.00> (?)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", - f"", - f"------", - f"", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[cdf9aa4...{comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -1583,48 +1583,48 @@ async def test_build_message_no_change( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=========================================", - f" Coverage 60.00% 60.00% ", - f" Complexity 10 10 ", - f"=========================================", - f" Files 2 2 ", - f" Lines 10 10 ", - f" Branches 1 1 ", - f"=========================================", - f" Hits 6 6 ", - f" Misses 3 3 ", - f" Partials 1 1 ", - f"```", - f"", + "=========================================", + " Coverage 60.00% 60.00% ", + " Complexity 10 10 ", + "=========================================", + " Files 2 2 ", + " Lines 10 10 ", + " Branches 1 1 ", + "=========================================", + " Hits 6 6 ", + " Misses 3 3 ", + " Partials 1 1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (ø)` | `0.00 <0.00> (ø)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (ø)` | |", - f"", - f"------", - f"", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{sample_comparison_no_change.project_coverage_base.commit.commitid[:7]}...{sample_comparison_no_change.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] li = 0 for exp, res in zip(expected_result, result): @@ -1656,51 +1656,51 @@ async def test_build_message_negative_change( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 50.00%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=============================================", - f"- Coverage 60.00% 50.00% -10.00% ", - f"- Complexity 10 11 +1 ", - f"=============================================", - f" Files 2 2 ", - f" Lines 10 6 -4 ", - f" Branches 1 0 -1 ", - f"=============================================", - f"- Hits 6 3 -3 ", - f" Misses 3 3 ", - f"+ Partials 1 0 -1 ", - f"```", - f"", + "=============================================", + "- Coverage 60.00% 50.00% -10.00% ", + "- Complexity 10 11 +1 ", + "=============================================", + " Files 2 2 ", + " Lines 10 6 -4 ", + " Branches 1 0 -1 ", + "=============================================", + "- Hits 6 3 -3 ", + " Misses 3 3 ", + "+ Partials 1 0 -1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [integration](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <ø> (?)` | `0.00 <ø> (?)` | |", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `?` | `?` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `50.00% <ø> (-12.50%)` | `11.00 <0.00> (+1.00)` | :arrow_down: |", - f"", + "", f"... and [1 file with indirect coverage changes](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/indirect-changes?src=pr&el=tree-more)", - f"", - f"------", - f"", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{comparison.project_coverage_base.commit.commitid[:7]}...{comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -1752,20 +1752,20 @@ async def test_build_message_negative_change_tricky_rounding( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 88.54%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"==========================================", - f"- Coverage 88.58% 88.54% -0.04% ", - f"==========================================", - f" Files 1 1 ", - f" Lines 7630 7631 +1 ", - f"==========================================", - f"- Hits 6759 6757 -2 ", - f"- Misses 871 874 +3 ", - f"```", - f"", + "==========================================", + "- Coverage 88.58% 88.54% -0.04% ", + "==========================================", + " Files 1 1 ", + " Lines 7630 7631 +1 ", + "==========================================", + "- Hits 6759 6757 -2 ", + "- Misses 871 874 +3 ", + "```", + "", ] li = 0 for exp, res in zip(expected_result, result): @@ -1817,9 +1817,9 @@ async def test_build_message_negative_change_tricky_rounding_newheader( result = await notifier.build_message(comparison) expected_result = [ f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", - f"All modified and coverable lines are covered by tests :white_check_mark:", + "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 88.54%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", ] li = 0 for exp, res in zip(expected_result, result): @@ -1850,49 +1850,49 @@ async def test_build_message_show_carriedforward_flags_no_cf_coverage( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{sample_comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{sample_comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=============================================", - f"+ Coverage 50.00% 60.00% +10.00% ", - f"+ Complexity 11 10 -1 ", - f"=============================================", - f" Files 2 2 ", - f" Lines 6 10 +4 ", - f" Branches 0 1 +1 ", - f"=============================================", - f"+ Hits 3 6 +3 ", - f" Misses 3 3 ", - f"- Partials 0 1 +1 ", - f"```", - f"", + "=============================================", + "+ Coverage 50.00% 60.00% +10.00% ", + "+ Complexity 11 10 -1 ", + "=============================================", + " Files 2 2 ", + " Lines 6 10 +4 ", + " Branches 0 1 +1 ", + "=============================================", + "+ Hits 3 6 +3 ", + " Misses 3 3 ", + "- Partials 0 1 +1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [integration](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `?` | `?` | |", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (?)` | `0.00 <0.00> (?)` | |", - f"", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", - f"", + "", f"... and [1 file with indirect coverage changes](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/indirect-changes?src=pr&el=tree-more)", - f"", - f"------", - f"", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{sample_comparison.project_coverage_base.commit.commitid[:7]}...{sample_comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -1926,37 +1926,37 @@ async def test_build_message_with_without_flags( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 65.38%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=======================================", - f" Coverage 65.38% 65.38% ", - f"=======================================", - f" Files 15 15 ", - f" Lines 208 208 ", - f"=======================================", - f" Hits 136 136 ", - f" Misses 4 4 ", - f" Partials 68 68 ", - f"```", - f"", - f"", - f"------", - f"", + "=======================================", + " Coverage 65.38% 65.38% ", + "=======================================", + " Files 15 15 ", + " Lines 208 208 ", + "=======================================", + " Hits 136 136 ", + " Misses 4 4 ", + " Partials 68 68 ", + "```", + "", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{comparison.project_coverage_base.commit.commitid[:7]}...{comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] li = 0 for exp, res in zip(expected_result, result): @@ -1984,46 +1984,46 @@ async def test_build_message_with_without_flags( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 65.38%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=======================================", - f" Coverage 65.38% 65.38% ", - f"=======================================", - f" Files 15 15 ", - f" Lines 208 208 ", - f"=======================================", - f" Hits 136 136 ", - f" Misses 4 4 ", - f" Partials 68 68 ", - f"```", - f"", + "=======================================", + " Coverage 65.38% 65.38% ", + "=======================================", + " Files 15 15 ", + " Lines 208 208 ", + "=======================================", + " Hits 136 136 ", + " Misses 4 4 ", + " Partials 68 68 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | | *Carryforward flag |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [enterprise](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `25.00% <ø> (ø)` | | Carriedforward from [1234567](test.example.br/gh/{repository.slug}/commit/123456789sha) |", f"| [integration](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `25.00% <ø> (ø)` | | Carriedforward |", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `25.00% <ø> (ø)` | | |", - f"", - f"*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags) to find out more." - f"", - f"", - f"", - f"------", - f"", + "", + "*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags) to find out more." + "", + "", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{comparison.project_coverage_base.commit.commitid[:7]}...{comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] li = 0 for exp, res in zip(expected_result, result): @@ -2058,46 +2058,46 @@ async def test_build_message_show_carriedforward_flags_has_cf_coverage( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 65.38%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=======================================", - f" Coverage 65.38% 65.38% ", - f"=======================================", - f" Files 15 15 ", - f" Lines 208 208 ", - f"=======================================", - f" Hits 136 136 ", - f" Misses 4 4 ", - f" Partials 68 68 ", - f"```", - f"", + "=======================================", + " Coverage 65.38% 65.38% ", + "=======================================", + " Files 15 15 ", + " Lines 208 208 ", + "=======================================", + " Hits 136 136 ", + " Misses 4 4 ", + " Partials 68 68 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | | *Carryforward flag |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [enterprise](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `25.00% <ø> (ø)` | | Carriedforward from [1234567](test.example.br/gh/{repository.slug}/commit/123456789sha) |", f"| [integration](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `25.00% <ø> (ø)` | | Carriedforward |", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `25.00% <ø> (ø)` | | |", - f"", - f"*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags) to find out more." - f"", - f"", - f"", - f"------", - f"", + "", + "*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags) to find out more." + "", + "", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{comparison.project_coverage_base.commit.commitid[:7]}...{comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] li = 0 for exp, res in zip(expected_result, result): @@ -2132,44 +2132,44 @@ async def test_build_message_hide_carriedforward_flags_has_cf_coverage( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 65.38%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=======================================", - f" Coverage 65.38% 65.38% ", - f"=======================================", - f" Files 15 15 ", - f" Lines 208 208 ", - f"=======================================", - f" Hits 136 136 ", - f" Misses 4 4 ", - f" Partials 68 68 ", - f"```", - f"", + "=======================================", + " Coverage 65.38% 65.38% ", + "=======================================", + " Files 15 15 ", + " Lines 208 208 ", + "=======================================", + " Hits 136 136 ", + " Misses 4 4 ", + " Partials 68 68 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | |", - f"|---|---|---|", + "|---|---|---|", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `25.00% <ø> (ø)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more." - f"", - f"", - f"", - f"------", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more." + "", + "", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{comparison.project_coverage_base.commit.commitid[:7]}...{comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] li = 0 for exp, res in zip(expected_result, result): @@ -2231,50 +2231,50 @@ async def test_build_message_no_flags( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{sample_comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{sample_comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=============================================", - f"+ Coverage 50.00% 60.00% +10.00% ", - f"+ Complexity 11 10 -1 ", - f"=============================================", - f" Files 2 2 ", - f" Lines 6 10 +4 ", - f" Branches 0 1 +1 ", - f"=============================================", - f"+ Hits 3 6 +3 ", - f" Misses 3 3 ", - f"- Partials 0 1 +1 ", - f"```", - f"", + "=============================================", + "+ Coverage 50.00% 60.00% +10.00% ", + "+ Complexity 11 10 -1 ", + "=============================================", + " Files 2 2 ", + " Lines 6 10 +4 ", + " Branches 0 1 +1 ", + "=============================================", + "+ Hits 3 6 +3 ", + " Misses 3 3 ", + "- Partials 0 1 +1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [integration](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `?` | `?` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", - f"", + "", f"... and [1 file with indirect coverage changes](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/indirect-changes?src=pr&el=tree-more)", - f"", - f"------", - f"", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{comparison.project_coverage_base.commit.commitid[:7]}...{comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -3286,12 +3286,12 @@ async def test_message_hide_details_github( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{sample_comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{sample_comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", - f"
Additional details and impacted files\n", - f"", + "", + "
Additional details and impacted files\n", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"
", + "", + "
", ] li = 0 for exp, res in zip(expected_result, result): @@ -3357,9 +3357,9 @@ async def test_message_hide_details_bitbucket( f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{sample_comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{sample_comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{sample_comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", + "", ] li = 0 for exp, res in zip(expected_result, result): @@ -3450,7 +3450,7 @@ async def test_filesection_no_extra_settings(self, sample_comparison, mocker): "| [Files](pull.link?dropdown=coverage&src=pr&el=tree) | Coverage Δ | |", "|---|---|---|", "| [file\\_1.go](pull.link?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.66%> (+12.50%)` | :arrow_up: |", - f"", + "", "... and [3 files with indirect coverage changes](pull.link/indirect-changes?src=pr&el=tree-more)", ] @@ -4459,16 +4459,16 @@ async def test_create_message_files_section_with_critical_files_new_layout( repository = sample_comparison.head.commit.repository expected_result = [ f"## [Codecov](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", - f"All modified and coverable lines are covered by tests :white_check_mark:", + "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 60.00%. Comparing base [(`{sample_comparison.project_coverage_base.commit.commitid[:7]}`)](https://app.codecov.io/gh/{repository.slug}/commit/{sample_comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{sample_comparison.head.commit.commitid[:7]}`)](https://app.codecov.io/gh/{repository.slug}/commit/{sample_comparison.head.commit.commitid}?dropdown=coverage&el=desc).", "", "Changes have been made to critical files, which contain lines commonly executed in production. [Learn more](https://docs.codecov.com/docs/impact-analysis)", "", f"| [Files](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\\_1.go](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <ø> (+12.50%)` | `10.00 <0.00> (-1.00)` | :arrow_up: |", f"| [file\\_2.py](https://app.codecov.io/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_2.py#diff-ZmlsZV8yLnB5) **Critical** | `50.00% <ø> (ø)` | `0.00 <0.00> (ø)` | |", - f"", + "", "", ] res = await notifier.build_message(comparison) @@ -4503,41 +4503,41 @@ async def test_build_message_no_base_commit_new_layout( result = await notifier.build_message(comparison) expected_result = [ f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", - f"Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", - f"> Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`master@cdf9aa4`). [Learn more](https://docs.codecov.io/docs/error-reference#section-missing-base-commit) about missing BASE report.", - f"", + "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", + "> Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`master@cdf9aa4`). [Learn more](https://docs.codecov.io/docs/error-reference#section-missing-base-commit) about missing BASE report.", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=========================================", - f" Coverage ? 60.00% ", - f" Complexity ? 10 ", - f"=========================================", - f" Files ? 2 ", - f" Lines ? 10 ", - f" Branches ? 1 ", - f"=========================================", - f" Hits ? 6 ", - f" Misses ? 3 ", - f" Partials ? 1 ", - f"```", - f"", + "=========================================", + " Coverage ? 60.00% ", + " Complexity ? 10 ", + "=========================================", + " Files ? 2 ", + " Lines ? 10 ", + " Branches ? 1 ", + "=========================================", + " Hits ? 6 ", + " Misses ? 3 ", + " Partials ? 1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (?)` | `0.00 <0.00> (?)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", - f"", - f"", + "", + "", f"[:umbrella: View full report in Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue). ", - f":loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/).", - f"", + ":loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/).", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -4569,44 +4569,44 @@ async def test_build_message_no_base_report_new_layout( result = await notifier.build_message(comparison) expected_result = [ f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", - f"Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", + "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`master@{comparison.project_coverage_base.commit.commitid[:7]}`). [Learn more](https://docs.codecov.io/docs/error-reference#section-missing-base-commit) about missing BASE report.", - f"", - f"
Additional details and impacted files\n", - f"", + "", + "
Additional details and impacted files\n", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=========================================", - f" Coverage ? 60.00% ", - f" Complexity ? 10 ", - f"=========================================", - f" Files ? 2 ", - f" Lines ? 10 ", - f" Branches ? 1 ", - f"=========================================", - f" Hits ? 6 ", - f" Misses ? 3 ", - f" Partials ? 1 ", - f"```", - f"", + "=========================================", + " Coverage ? 60.00% ", + " Complexity ? 10 ", + "=========================================", + " Files ? 2 ", + " Lines ? 10 ", + " Branches ? 1 ", + "=========================================", + " Hits ? 6 ", + " Misses ? 3 ", + " Partials ? 1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (?)` | `0.00 <0.00> (?)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=tree) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [file\_1.go](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | `62.50% <66.67%> (ø)` | `10.00 <0.00> (?)` | |", - f"", - f"
", - f"", + "", + "
", + "", f"[:umbrella: View full report in Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue). ", - f":loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/).", - f"", + ":loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/).", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -4639,15 +4639,15 @@ async def test_build_message_no_project_coverage( pull_url = f"test.example.br/gh/{repository.slug}/pull/{pull.pullid}" expected_result = [ f"## [Codecov]({pull_url}?dropdown=coverage&src=pr&el=h1) Report", - f"Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", - f"", + "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", + "", f"| [Files]({pull_url}?dropdown=coverage&src=pr&el=tree) | Patch % | Lines |", - f"|---|---|---|", + "|---|---|---|", f"| [file\\_1.go]({pull_url}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | 66.67% | [1 Missing :warning: ]({pull_url}?src=pr&el=tree) |", - f"", - f"", - f":loudspeaker: Thoughts on this report? [Let us know!](https://about.codecov.io/pull-request-comment-report/)", - f"", + "", + "", + ":loudspeaker: Thoughts on this report? [Let us know!](https://about.codecov.io/pull-request-comment-report/)", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -4680,15 +4680,15 @@ async def test_build_message_no_project_coverage_condensed_yaml_configs( pull_url = f"test.example.br/gh/{repository.slug}/pull/{pull.pullid}" expected_result = [ f"## [Codecov]({pull_url}?dropdown=coverage&src=pr&el=h1) Report", - f"Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", - f"", + "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", + "", f"| [Files]({pull_url}?dropdown=coverage&src=pr&el=tree) | Patch % | Lines |", - f"|---|---|---|", + "|---|---|---|", f"| [file\\_1.go]({pull_url}?src=pr&el=tree&filepath=file_1.go#diff-ZmlsZV8xLmdv) | 66.67% | [1 Missing :warning: ]({pull_url}?src=pr&el=tree) |", - f"", - f"", - f":loudspeaker: Thoughts on this report? [Let us know!](https://about.codecov.io/pull-request-comment-report/)", - f"", + "", + "", + ":loudspeaker: Thoughts on this report? [Let us know!](https://about.codecov.io/pull-request-comment-report/)", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -4720,45 +4720,45 @@ async def test_build_message_head_and_pull_head_differ_new_layout( result = await notifier.build_message(comparison) expected_result = [ f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", - f"Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", + "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"> :exclamation: **Current head {comparison.head.commit.commitid[:7]} differs from pull request most recent head {comparison.enriched_pull.provider_pull['head']['commitid'][:7]}**", - f"> ", + "> ", f"> Please [upload](https://docs.codecov.com/docs/codecov-uploader) reports for the commit {comparison.enriched_pull.provider_pull['head']['commitid'][:7]} to get more accurate results.", - f"", - f"
Additional details and impacted files\n", - f"", + "", + "
Additional details and impacted files\n", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=============================================", - f"+ Coverage 50.00% 60.00% +10.00% ", - f"+ Complexity 11 10 -1 ", - f"=============================================", - f" Files 2 2 ", - f" Lines 6 10 +4 ", - f" Branches 0 1 +1 ", - f"=============================================", - f"+ Hits 3 6 +3 ", - f" Misses 3 3 ", - f"- Partials 0 1 +1 ", - f"```", - f"", + "=============================================", + "+ Coverage 50.00% 60.00% +10.00% ", + "+ Complexity 11 10 -1 ", + "=============================================", + " Files 2 2 ", + " Lines 6 10 +4 ", + " Branches 0 1 +1 ", + "=============================================", + "+ Hits 3 6 +3 ", + " Misses 3 3 ", + "- Partials 0 1 +1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [integration](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `?` | `?` | |", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (?)` | `0.00 <0.00> (?)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", - f"
", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", + "
", + "", f"[:umbrella: View full report in Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue). ", - f":loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/).", - f"", + ":loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/).", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -4797,50 +4797,50 @@ async def test_build_message_head_and_pull_head_differ_with_components( result = await notifier.build_message(comparison) expected_result = [ f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", - f"Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", + "Attention: Patch coverage is `66.66667%` with `1 line` in your changes missing coverage. Please review.", f"> Project coverage is 60.00%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"> :exclamation: **Current head {comparison.head.commit.commitid[:7]} differs from pull request most recent head {comparison.enriched_pull.provider_pull['head']['commitid'][:7]}**", - f"> ", + "> ", f"> Please [upload](https://docs.codecov.com/docs/codecov-uploader) reports for the commit {comparison.enriched_pull.provider_pull['head']['commitid'][:7]} to get more accurate results.", - f"", - f"
Additional details and impacted files\n", - f"", + "", + "
Additional details and impacted files\n", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=============================================", - f"+ Coverage 50.00% 60.00% +10.00% ", - f"+ Complexity 11 10 -1 ", - f"=============================================", - f" Files 2 2 ", - f" Lines 6 10 +4 ", - f" Branches 0 1 +1 ", - f"=============================================", - f"+ Hits 3 6 +3 ", - f" Misses 3 3 ", - f"- Partials 0 1 +1 ", - f"```", - f"", + "=============================================", + "+ Coverage 50.00% 60.00% +10.00% ", + "+ Complexity 11 10 -1 ", + "=============================================", + " Files 2 2 ", + " Lines 6 10 +4 ", + " Branches 0 1 +1 ", + "=============================================", + "+ Hits 3 6 +3 ", + " Misses 3 3 ", + "- Partials 0 1 +1 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | Complexity Δ | |", - f"|---|---|---|---|", + "|---|---|---|---|", f"| [integration](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `?` | `?` | |", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `100.00% <100.00%> (?)` | `0.00 <0.00> (?)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.", + "", f"| [Components](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/components?src=pr&el=components) | Coverage Δ | |", - f"|---|---|---|", + "|---|---|---|", f"| [go_files](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/components?src=pr&el=component) | `62.50% <66.67%> (+12.50%)` | :arrow_up: |", f"| [unit_flags](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/components?src=pr&el=component) | `100.00% <100.00%> (∅)` | |", - f"", - f"
", - f"", + "", + "
", + "", f"[:umbrella: View full report in Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue). ", - f":loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/).", - f"", + ":loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/).", + "", ] for exp, res in zip(expected_result, result): assert exp == res @@ -4977,7 +4977,7 @@ async def test_build_message_team_plan_customer_all_lines_covered_test_results_e assert result == expected_result @pytest.mark.asyncio - async def test_build_message_team_plan_customer_all_lines_covered( + async def test_build_message_team_plan_customer_all_lines_covered_no_third_line( self, dbsession, mock_configuration, @@ -5040,46 +5040,46 @@ async def test_build_message_no_patch_or_proj_change( result = await notifier.build_message(comparison) expected_result = [ f"## [Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=h1) Report", - f"All modified and coverable lines are covered by tests :white_check_mark:", + "All modified and coverable lines are covered by tests :white_check_mark:", f"> Project coverage is 65.38%. Comparing base [(`{comparison.project_coverage_base.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.project_coverage_base.commit.commitid}?dropdown=coverage&el=desc) to head [(`{comparison.head.commit.commitid[:7]}`)](test.example.br/gh/{repository.slug}/commit/{comparison.head.commit.commitid}?dropdown=coverage&el=desc).", - f"", + "", f"[![Impacted file tree graph](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/graphs/tree.svg?width=650&height=150&src=pr&token={repository.image_token})](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?src=pr&el=tree)", - f"", - f"```diff", - f"@@ Coverage Diff @@", + "", + "```diff", + "@@ Coverage Diff @@", f"## master #{pull.pullid} +/- ##", - f"=======================================", - f" Coverage 65.38% 65.38% ", - f"=======================================", - f" Files 15 15 ", - f" Lines 208 208 ", - f"=======================================", - f" Hits 136 136 ", - f" Misses 4 4 ", - f" Partials 68 68 ", - f"```", - f"", + "=======================================", + " Coverage 65.38% 65.38% ", + "=======================================", + " Files 15 15 ", + " Lines 208 208 ", + "=======================================", + " Hits 136 136 ", + " Misses 4 4 ", + " Partials 68 68 ", + "```", + "", f"| [Flag](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flags) | Coverage Δ | |", - f"|---|---|---|", + "|---|---|---|", f"| [unit](test.example.br/gh/{repository.slug}/pull/{pull.pullid}/flags?src=pr&el=flag) | `25.00% <ø> (ø)` | |", - f"", - f"Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more." - f"", - f"", - f"", - f"------", - f"", + "", + "Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more." + "", + "", + "", + "------", + "", f"[Continue to review full report in " f"Codecov by Sentry](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=continue).", - f"> **Legend** - [Click here to learn " - f"more](https://docs.codecov.io/docs/codecov-delta)", - f"> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", + "> **Legend** - [Click here to learn " + "more](https://docs.codecov.io/docs/codecov-delta)", + "> `Δ = absolute (impact)`, `ø = not affected`, `? = missing data`", f"> Powered by " f"[Codecov](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=footer). " f"Last update " f"[{comparison.project_coverage_base.commit.commitid[:7]}...{comparison.head.commit.commitid[:7]}](test.example.br/gh/{repository.slug}/pull/{pull.pullid}?dropdown=coverage&src=pr&el=lastupdated). " f"Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).", - f"", + "", ] for exp, res in zip(expected_result, result): diff --git a/services/notification/notifiers/tests/unit/test_status.py b/services/notification/notifiers/tests/unit/test_status.py index 8ec08a5d5..0f31100da 100644 --- a/services/notification/notifiers/tests/unit/test_status.py +++ b/services/notification/notifiers/tests/unit/test_status.py @@ -1576,7 +1576,7 @@ async def test_notify_adjust_base_behavior_skips_if_target_coverage_defined( current_yaml=UserYaml({}), ) expected_result = { - "message": f"50.00% (target 80.00%)", + "message": "50.00% (target 80.00%)", "state": "failure", } result = await notifier.build_payload(sample_comparison) @@ -2123,7 +2123,7 @@ async def test_build_payload_no_diff_no_base_report( notifier_site_settings=True, current_yaml=UserYaml({}), ) - expected_result = {"message": f"Coverage not affected", "state": "success"} + expected_result = {"message": "Coverage not affected", "state": "success"} result = await notifier.build_payload(comparison) assert expected_result == result @@ -2144,7 +2144,7 @@ async def test_build_payload_without_base_report( current_yaml=UserYaml({}), ) expected_result = { - "message": f"No report found to compare against", + "message": "No report found to compare against", "state": "success", } result = await notifier.build_payload(comparison) diff --git a/services/notification/tests/unit/test_notification_service.py b/services/notification/tests/unit/test_notification_service.py index 2341a468a..c49dedcba 100644 --- a/services/notification/tests/unit/test_notification_service.py +++ b/services/notification/tests/unit/test_notification_service.py @@ -329,7 +329,7 @@ def test_get_notifiers_instances_checks_percentage_whitelist( mocker.patch.dict( os.environ, { - "CHECKS_WHITELISTED_OWNERS": f"0,1", + "CHECKS_WHITELISTED_OWNERS": "0,1", "CHECKS_WHITELISTED_PERCENTAGE": "35", }, ) diff --git a/services/report/__init__.py b/services/report/__init__.py index 09aa2daa8..ec0264b5c 100644 --- a/services/report/__init__.py +++ b/services/report/__init__.py @@ -25,7 +25,6 @@ from shared.utils.sessions import Session, SessionType from shared.yaml import UserYaml -from database.enums import ReportType from database.models import Commit, Repository, Upload, UploadError from database.models.reports import ( AbstractTotals, @@ -639,7 +638,7 @@ async def _do_build_report_from_commit(self, commit) -> Report: return await self.create_new_report_for_commit(commit) @metrics.timer( - f"services.report.ReportService.get_appropriate_commit_to_carryforward_from" + "services.report.ReportService.get_appropriate_commit_to_carryforward_from" ) def get_appropriate_commit_to_carryforward_from( self, commit: Commit, max_parenthood_deepness: int = 10 @@ -754,7 +753,7 @@ async def _possibly_shift_carryforward_report( async def create_new_report_for_commit(self, commit: Commit) -> Report: with metrics.timer( - f"services.report.ReportService.create_new_report_for_commit" + "services.report.ReportService.create_new_report_for_commit" ): log.info( "Creating new report for commit", diff --git a/services/tests/test_bots.py b/services/tests/test_bots.py index 444c39916..bf208fe2b 100644 --- a/services/tests/test_bots.py +++ b/services/tests/test_bots.py @@ -429,9 +429,9 @@ def test_get_owner_installation_id_yes_installation_all_rate_limited( with pytest.raises(NoConfiguredAppsAvailable): get_github_app_info_for_owner(owner, installation_name="my_app") mock_redis.exists.assert_any_call( - f"rate_limited_installations_default_app_123456" + "rate_limited_installations_default_app_123456" ) - mock_redis.exists.assert_any_call(f"rate_limited_installations_1212_12000") + mock_redis.exists.assert_any_call("rate_limited_installations_1212_12000") @pytest.mark.parametrize( "time_edited_days,expected_weight", diff --git a/services/tests/test_flake_detector.py b/services/tests/test_flake_detector.py index eaf3230d6..8825e81e8 100644 --- a/services/tests/test_flake_detector.py +++ b/services/tests/test_flake_detector.py @@ -161,32 +161,6 @@ def test_flake_consecutive_differing_outcomes_no_main_branch_specified(dbsession assert flaky_tests[test_id] == {FlakeSymptomType.CONSECUTIVE_DIFF_OUTCOMES} -def test_flake_consecutive_differing_outcomes_no_main_branch_specified(dbsession): - repoid = create_repo( - dbsession, - ) - commitid = create_commit(dbsession, repoid, "not_main") - reportid = create_report(dbsession, commitid) - reportid2 = create_report(dbsession, commitid) - uploadid = create_upload(dbsession, reportid) - uploadid2 = create_upload(dbsession, reportid2) - test_id = create_test(dbsession, repoid) - ti1 = create_test_instance( - dbsession, test_id, uploadid, str(Outcome.Failure), "failure message" - ) - _ = create_test_instance(dbsession, test_id, uploadid2, str(Outcome.Pass), None) - - dbfd = DefaultBranchFailureDetector(dbsession, repoid) - umd = UnrelatedMatchesDetector() - dod = DiffOutcomeDetector() - - fd = FlakeDetectionEngine(dbsession, repoid, [dbfd, dod, umd]) - flaky_tests = fd.detect_flakes() - - assert test_id in flaky_tests - assert flaky_tests[test_id] == {FlakeSymptomType.CONSECUTIVE_DIFF_OUTCOMES} - - def test_flake_matching_failures_on_unrelated_branches(dbsession): repoid = create_repo( dbsession, diff --git a/services/tests/test_urls.py b/services/tests/test_urls.py index 196625ee6..144d1ea16 100644 --- a/services/tests/test_urls.py +++ b/services/tests/test_urls.py @@ -15,8 +15,8 @@ def test_append_tracking_params_to_urls(): org_name = "Acme Corporation" expected_result = [ - f"[This link](https://stage.codecov.io/gh/test_repo/pull/pull123?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Acme+Corporation) should be changed", - f"And [this one](https://codecov.io/bb/test_repo/pull?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Acme+Corporation) too, plus also [this one](codecov.io?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Acme+Corporation)", + "[This link](https://stage.codecov.io/gh/test_repo/pull/pull123?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Acme+Corporation) should be changed", + "And [this one](https://codecov.io/bb/test_repo/pull?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Acme+Corporation) too, plus also [this one](codecov.io?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Acme+Corporation)", "However, [this one](https://www.xkcd.com/) should not be changed since it does not link to Codecov", "(Also should not replace this parenthetical non-link reference to codecov.io)", "Also should recognize that these are two separate URLs: [banana](https://codecov.io/pokemon?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Acme+Corporation)and[banana](https://codecov.io/pokemon?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Acme+Corporation)", diff --git a/services/timeseries.py b/services/timeseries.py index 53779182a..bae4b95f3 100644 --- a/services/timeseries.py +++ b/services/timeseries.py @@ -8,7 +8,6 @@ from database.models import Commit, Dataset, Measurement, MeasurementName from database.models.core import Repository from database.models.reports import RepositoryFlag -from database.models.timeseries import Dataset from helpers.timeseries import backfill_max_batch_size, timeseries_enabled from services.report import ReportService from services.yaml import get_repo_yaml diff --git a/tasks/send_email.py b/tasks/send_email.py index e08077180..9990b35cf 100644 --- a/tasks/send_email.py +++ b/tasks/send_email.py @@ -68,7 +68,7 @@ def run_impl( email_wrapper = Email(to_addr, from_addr, subject, text, html) err_msg = None - metrics.incr(f"worker.tasks.send_email.attempt") + metrics.incr("worker.tasks.send_email.attempt") with metrics.timer("worker.tasks.send_email.send"): try: smtp_service.send(email_wrapper) @@ -77,11 +77,11 @@ def run_impl( if err_msg is not None: log.warning(f"Failed to send email: {err_msg}", extra=log_extra_dict) - metrics.incr(f"worker.tasks.send_email.fail") + metrics.incr("worker.tasks.send_email.fail") return {"email_successful": False, "err_msg": err_msg} log.info("Sent email", extra=log_extra_dict) - metrics.incr(f"worker.tasks.send_email.succeed") + metrics.incr("worker.tasks.send_email.succeed") return {"email_successful": True, "err_msg": None} diff --git a/tasks/tests/integration/test_notify_task.py b/tasks/tests/integration/test_notify_task.py index cba066e6f..33cda2961 100644 --- a/tasks/tests/integration/test_notify_task.py +++ b/tasks/tests/integration/test_notify_task.py @@ -1003,7 +1003,7 @@ def test_simple_call_status_and_notifiers( notification_successful=True, explanation=None, data_sent={ - "text": f"Coverage for *no change* `` on `test` is `85.00000%` via ``", + "text": "Coverage for *no change* `` on `test` is `85.00000%` via ``", "author_name": "Codecov", "author_link": "https://myexamplewebsite.io/gh/joseph-sentry/codecov-demo/commit/5601846871b8142ab0df1e0b8774756c658bcc7d", "attachments": [], @@ -1164,7 +1164,7 @@ def test_simple_call_status_and_notifiers( "message": [ "## [Codecov](https://myexamplewebsite.io/gh/joseph-sentry/codecov-demo/pull/9?dropdown=coverage&src=pr&el=h1) Report", "All modified and coverable lines are covered by tests :white_check_mark:", - f"> Project coverage is 85.00%. Comparing base [(`5b174c2`)](https://myexamplewebsite.io/gh/joseph-sentry/codecov-demo/commit/5b174c2b40d501a70c479e91025d5109b1ad5c1b?dropdown=coverage&el=desc) to head [(`5601846`)](https://myexamplewebsite.io/gh/joseph-sentry/codecov-demo/commit/5601846871b8142ab0df1e0b8774756c658bcc7d?dropdown=coverage&el=desc).", + "> Project coverage is 85.00%. Comparing base [(`5b174c2`)](https://myexamplewebsite.io/gh/joseph-sentry/codecov-demo/commit/5b174c2b40d501a70c479e91025d5109b1ad5c1b?dropdown=coverage&el=desc) to head [(`5601846`)](https://myexamplewebsite.io/gh/joseph-sentry/codecov-demo/commit/5601846871b8142ab0df1e0b8774756c658bcc7d?dropdown=coverage&el=desc).", "> Report is 2 commits behind head on main.", "", ":exclamation: Your organization needs to install the [Codecov GitHub app](https://github.com/apps/codecov/installations/select_target) to enable full functionality.", diff --git a/tasks/tests/unit/test_backfill_commit_data_to_storage_task.py b/tasks/tests/unit/test_backfill_commit_data_to_storage_task.py index af32429f5..b96e2c91a 100644 --- a/tasks/tests/unit/test_backfill_commit_data_to_storage_task.py +++ b/tasks/tests/unit/test_backfill_commit_data_to_storage_task.py @@ -68,7 +68,7 @@ def test_all_report_rows(self, mock_handle_single_row, dbsession): def mock_handle_single_row_return_side_effect(db_session, commit, report_row): if report_row.code is None: return {"success": True, "errors": []} - if report_row.code is "local": + if report_row.code == "local": return {"success": False, "errors": [BackfillError.missing_data.value]} mock_handle_single_row.side_effect = mock_handle_single_row_return_side_effect diff --git a/tasks/tests/unit/test_backfill_existing_gh_app_installations.py b/tasks/tests/unit/test_backfill_existing_gh_app_installations.py index be8657c95..6f3040f0c 100644 --- a/tasks/tests/unit/test_backfill_existing_gh_app_installations.py +++ b/tasks/tests/unit/test_backfill_existing_gh_app_installations.py @@ -47,7 +47,7 @@ def test_gh_app_with_selection_all( "repository_selection": "all" } mocker.patch( - f"tasks.backfill_existing_gh_app_installations.get_owner_provider_service", + "tasks.backfill_existing_gh_app_installations.get_owner_provider_service", return_value=mock_repo_provider, ) @@ -96,7 +96,7 @@ def test_gh_app_with_specific_owner_ids( "repository_selection": "all" } mocker.patch( - f"tasks.backfill_existing_gh_app_installations.get_owner_provider_service", + "tasks.backfill_existing_gh_app_installations.get_owner_provider_service", return_value=mock_repo_provider, ) diff --git a/tasks/tests/unit/test_bundle_analysis_processor_task.py b/tasks/tests/unit/test_bundle_analysis_processor_task.py index f1f7775a5..8e9209a66 100644 --- a/tasks/tests/unit/test_bundle_analysis_processor_task.py +++ b/tasks/tests/unit/test_bundle_analysis_processor_task.py @@ -19,7 +19,7 @@ def test_bundle_analysis_processor_task( celery_app, ): storage_path = ( - f"v1/repos/testing/ed1bdd67-8fd2-4cdb-ac9e-39b99e4a3892/bundle_report.sqlite" + "v1/repos/testing/ed1bdd67-8fd2-4cdb-ac9e-39b99e4a3892/bundle_report.sqlite" ) mock_storage.write_file(get_bucket_name(), storage_path, "test-content") @@ -75,7 +75,7 @@ def test_bundle_analysis_processor_task_error( celery_app, ): storage_path = ( - f"v1/repos/testing/ed1bdd67-8fd2-4cdb-ac9e-39b99e4a3892/bundle_report.sqlite" + "v1/repos/testing/ed1bdd67-8fd2-4cdb-ac9e-39b99e4a3892/bundle_report.sqlite" ) mock_storage.write_file(get_bucket_name(), storage_path, "test-content") @@ -191,7 +191,7 @@ def test_bundle_analysis_process_upload_general_error( celery_app, ): storage_path = ( - f"v1/repos/testing/ed1bdd67-8fd2-4cdb-ac9e-39b99e4a3892/bundle_report.sqlite" + "v1/repos/testing/ed1bdd67-8fd2-4cdb-ac9e-39b99e4a3892/bundle_report.sqlite" ) mock_storage.write_file(get_bucket_name(), storage_path, "test-content") @@ -258,7 +258,7 @@ def test_bundle_analysis_processor_task_locked( celery_app, ): storage_path = ( - f"v1/repos/testing/ed1bdd67-8fd2-4cdb-ac9e-39b99e4a3892/bundle_report.sqlite" + "v1/repos/testing/ed1bdd67-8fd2-4cdb-ac9e-39b99e4a3892/bundle_report.sqlite" ) mock_storage.write_file(get_bucket_name(), storage_path, "test-content") @@ -310,7 +310,7 @@ def test_bundle_analysis_process_upload_rate_limit_error( celery_app, ): storage_path = ( - f"v1/repos/testing/ed1bdd67-8fd2-4cdb-ac9e-39b99e4a3892/bundle_report.sqlite" + "v1/repos/testing/ed1bdd67-8fd2-4cdb-ac9e-39b99e4a3892/bundle_report.sqlite" ) mock_storage.write_file(get_bucket_name(), storage_path, "test-content") diff --git a/tasks/tests/unit/test_clean_labels_index.py b/tasks/tests/unit/test_clean_labels_index.py index fba983159..8c029484b 100644 --- a/tasks/tests/unit/test_clean_labels_index.py +++ b/tasks/tests/unit/test_clean_labels_index.py @@ -111,7 +111,7 @@ class TestCleanLabelsIndexSyncronization(object): def test__is_currently_processing( self, mock_redis, commitid, is_currently_processing ): - mock_redis.keys = {f"upload_processing_lock_1_sha_1": True} + mock_redis.keys = {"upload_processing_lock_1_sha_1": True} lock_name = UPLOAD_PROCESSING_LOCK_NAME(1, commitid) task = CleanLabelsIndexTask() assert ( diff --git a/tasks/tests/unit/test_new_user_activated.py b/tasks/tests/unit/test_new_user_activated.py index 6df3d2f9c..4d7becf0d 100644 --- a/tasks/tests/unit/test_new_user_activated.py +++ b/tasks/tests/unit/test_new_user_activated.py @@ -118,18 +118,6 @@ def test_org_not_on_pr_plan(self, mocker, dbsession, pull): "reason": "org not on pr author billing plan", } - def test_org_not_on_pr_plan(self, mocker, dbsession, pull): - pull.repository.owner.plan = "users-inappm" - dbsession.flush() - res = NewUserActivatedTask().run_impl( - dbsession, pull.repository.owner.ownerid, pull.author.ownerid - ) - assert res == { - "notifies_scheduled": False, - "pulls_notified": [], - "reason": "org not on pr author billing plan", - } - def test_no_commit_notifications_found(self, mocker, dbsession, pull): mocked_possibly_resend_notifications = mocker.patch( "tasks.new_user_activated.NewUserActivatedTask.possibly_resend_notifications" diff --git a/tasks/tests/unit/test_notify_task.py b/tasks/tests/unit/test_notify_task.py index 4ce0e1a5a..2068670f3 100644 --- a/tasks/tests/unit/test_notify_task.py +++ b/tasks/tests/unit/test_notify_task.py @@ -278,7 +278,7 @@ def test__possibly_refresh_previous_selection( assert task._possibly_refresh_previous_selection(commit) == True mock_set_gh_app_for_commit.assert_called_with(app_to_save, commit) - def test__possibly_refresh_previous_selection(self, mocker, dbsession): + def test__possibly_refresh_previous_selection_false(self, mocker, dbsession): commit = CommitFactory(repository__owner__service="github") dbsession.add(commit) dbsession.flush() diff --git a/tasks/tests/unit/test_sync_repo_languages.py b/tasks/tests/unit/test_sync_repo_languages.py index d5569800b..bcd4eb3e5 100644 --- a/tasks/tests/unit/test_sync_repo_languages.py +++ b/tasks/tests/unit/test_sync_repo_languages.py @@ -183,7 +183,7 @@ def test_languages_intersection_and_synced_beyond_threshold( task.run_impl(dbsession, repoid=repo.repoid, manual_trigger=False) == None ) - def test_languages_intersection_and_synced_beyond_threshold( + def test_languages_intersection_and_synced_beyond_threshold_with_languages( self, dbsession, setup_with_languages ): mocked_beyond_threshold = MOCKED_NOW + timedelta(days=-10) diff --git a/tasks/tests/unit/test_test_results_finisher.py b/tasks/tests/unit/test_test_results_finisher.py index 374cfccfc..be6bad5b5 100644 --- a/tasks/tests/unit/test_test_results_finisher.py +++ b/tasks/tests/unit/test_test_results_finisher.py @@ -337,7 +337,7 @@ def test_upload_finisher_task_call( assert expected_result == result mock_repo_provider_comments.post_comment.assert_called_with( pull.pullid, - f"**Test Failures Detected**: Due to failing tests, we cannot provide coverage reports at this time.\n\n### :x: Failed Test Results: \nCompleted 4 tests with **`4 failed`**, 0 passed and 0 skipped.\n
View the full list of failed tests\n\n| **Test Description** | **Failure message** |\n| :-- | :-- |\n|
**Testsuite:**
test_testsuite

**Test name:**
test_name0

**Envs:**
- 0
|
<pre>Fourth 

</pre> | test | instance |
|\n|
**Testsuite:**
test_testsuite

**Test name:**
test_name1

**Envs:**
- 1
|
Shared failure message
|\n|
**Testsuite:**
test_testsuite

**Test name:**
test_name2

**Envs:**
- default
|
Shared failure message
|\n|
**Testsuite:**
test_testsuite

**Test name:**
test_name3

**Envs:**
- 0
|
No failure message available
|", + "**Test Failures Detected**: Due to failing tests, we cannot provide coverage reports at this time.\n\n### :x: Failed Test Results: \nCompleted 4 tests with **`4 failed`**, 0 passed and 0 skipped.\n
View the full list of failed tests\n\n| **Test Description** | **Failure message** |\n| :-- | :-- |\n|
**Testsuite:**
test_testsuite

**Test name:**
test_name0

**Envs:**
- 0
|
<pre>Fourth 

</pre> | test | instance |
|\n|
**Testsuite:**
test_testsuite

**Test name:**
test_name1

**Envs:**
- 1
|
Shared failure message
|\n|
**Testsuite:**
test_testsuite

**Test name:**
test_name2

**Envs:**
- default
|
Shared failure message
|\n|
**Testsuite:**
test_testsuite

**Test name:**
test_name3

**Envs:**
- 0
|
No failure message available
|", ) mock_metrics.incr.assert_has_calls( diff --git a/tasks/upload.py b/tasks/upload.py index 50828dad3..e45664468 100644 --- a/tasks/upload.py +++ b/tasks/upload.py @@ -35,7 +35,6 @@ from services.archive import ArchiveService from services.bundle_analysis import BundleAnalysisReportService from services.redis import ( - Redis, download_archive_from_redis, get_parallel_upload_processing_session_counter_redis_key, get_redis_connection, @@ -409,7 +408,7 @@ def run_impl_within_lock( checkpoints.log(UploadFlow.PROCESSING_BEGIN) except ValueError as e: log.warning( - f"CheckpointLogger failed to log/submit", extra=dict(error=e) + "CheckpointLogger failed to log/submit", extra=dict(error=e) ) commit = None diff --git a/tasks/upload_finisher.py b/tasks/upload_finisher.py index 032f2bc6a..d133657e5 100644 --- a/tasks/upload_finisher.py +++ b/tasks/upload_finisher.py @@ -70,7 +70,7 @@ def run_impl( checkpoints = checkpoints_from_kwargs(UploadFlow, kwargs) checkpoints.log(UploadFlow.BATCH_PROCESSING_COMPLETE) except ValueError as e: - log.warning(f"CheckpointLogger failed to log/submit", extra=dict(error=e)) + log.warning("CheckpointLogger failed to log/submit", extra=dict(error=e)) log.info( "Received upload_finisher task",