From 86b75eae26c4734352ac16134df11cbddee8d751 Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Mon, 29 Apr 2024 11:13:48 -0400 Subject: [PATCH 01/11] feat: add matrix to process test results cmd --- .github/workflows/ci.yml | 4 +- codecov_cli/commands/process_test_results.py | 44 +++++++++++++++----- codecov_cli/helpers/request.py | 12 ++++++ 3 files changed, 49 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05a0c615..57754b57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,4 +166,6 @@ jobs: - name: Dogfooding codecov-cli if: ${{ !cancelled() }} run: | - codecovcli process-test-results --provider-token ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + codecovcli process-test-results --provider-token ${{ secrets.GITHUB_TOKEN }} --matrix '${{ toJSON(matrix) }}' + sleep 5 + codecovcli process-test-results --provider-token ${{ secrets.GITHUB_TOKEN }} --matrix '${{ toJSON(matrix) }}' \ No newline at end of file diff --git a/codecov_cli/commands/process_test_results.py b/codecov_cli/commands/process_test_results.py index 1bf4558a..fe0296c0 100644 --- a/codecov_cli/commands/process_test_results.py +++ b/codecov_cli/commands/process_test_results.py @@ -3,6 +3,7 @@ import pathlib from dataclasses import dataclass from typing import List +from json import loads import click from test_results_parser import ( @@ -16,6 +17,8 @@ from codecov_cli.helpers.request import ( log_warnings_and_errors_if_any, send_post_request, + send_get_request, + send_patch_request ) from codecov_cli.services.upload.file_finder import select_file_finder @@ -64,6 +67,12 @@ type=str, default=None, ), + click.option( + "--matrix", + help="github actions matrix", + type=str, + default=None + ) ] @@ -84,8 +93,9 @@ class TestResultsNotificationPayload: @click.command() @process_test_results_options def process_test_results( - dir=None, files=None, exclude_folders=None, disable_search=None, provider_token=None + dir=None, files=None, exclude_folders=None, disable_search=None, provider_token=None, matrix=None ): + if provider_token is None: raise click.ClickException( "Provider token was not provided. Make sure to pass --provider-token option with the contents of the GITHUB_TOKEN secret, so we can make a comment." @@ -130,23 +140,37 @@ def process_test_results( # GITHUB_REF is documented here: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables pr_number = ref.split("/")[2] - create_github_comment(provider_token, slug, pr_number, message) - + create_github_comment(provider_token, slug, pr_number, message, matrix) -def create_github_comment(token, repo_slug, pr_number, message): - url = f"https://api.github.com/repos/{repo_slug}/issues/{pr_number}/comments" +def create_github_comment(token, repo_slug, pr_number, message, matrix: str): headers = { "Accept": "application/vnd.github+json", "Authorization": f"Bearer {token}", "X-GitHub-Api-Version": "2022-11-28", } - logger.info("Posting github comment") - log_warnings_and_errors_if_any( - send_post_request(url=url, data={"body": message}, headers=headers), - "Posting test results comment", - ) + url = f"https://api.github.com/repos/{repo_slug}/issues/{pr_number}/comments" + # list comments + result = send_get_request(url=url, headers=headers) + comments = loads(result.text) + matrix = matrix.strip() + for comment in comments: + if f"" in comment: + logger.info("Patching github comment") + + url = comment['url'] + log_warnings_and_errors_if_any( + send_patch_request(url=url, json={"body": message}, headers=headers), + "Patching test results comment", + ) + else: + logger.info("Posting github comment") + + log_warnings_and_errors_if_any( + send_post_request(url=url, data={"body": message}, headers=headers), + "Posting test results comment", + ) def generate_message_payload(upload_collection_results): diff --git a/codecov_cli/helpers/request.py b/codecov_cli/helpers/request.py index d356eed8..7d2ea629 100644 --- a/codecov_cli/helpers/request.py +++ b/codecov_cli/helpers/request.py @@ -80,6 +80,18 @@ def wrapper(*args, **kwargs): return wrapper +@retry_request +def send_get_request( + url: str, headers: dict = None, params: dict = None +): + return request_result(get(url=url, headers=headers, params=params)) + +@retry_request +def send_patch_request( + url: str, headers: dict = None, json: dict = None +): + return request_result(patch(url=url, headers=headers, json=json)) + @retry_request def send_post_request( url: str, data: dict = None, headers: dict = None, params: dict = None From 8b36d5df18c572f2ab75a2da2ad2a290f3bedb0a Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Mon, 29 Apr 2024 11:20:18 -0400 Subject: [PATCH 02/11] chore: make lint --- codecov_cli/commands/process_test_results.py | 31 ++++++++++---------- codecov_cli/helpers/request.py | 10 +++---- tests/commands/test_process_test_results.py | 8 ++--- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/codecov_cli/commands/process_test_results.py b/codecov_cli/commands/process_test_results.py index fe0296c0..6fa9a6cd 100644 --- a/codecov_cli/commands/process_test_results.py +++ b/codecov_cli/commands/process_test_results.py @@ -2,8 +2,8 @@ import os import pathlib from dataclasses import dataclass -from typing import List from json import loads +from typing import List import click from test_results_parser import ( @@ -16,9 +16,9 @@ from codecov_cli.helpers.request import ( log_warnings_and_errors_if_any, - send_post_request, send_get_request, - send_patch_request + send_patch_request, + send_post_request, ) from codecov_cli.services.upload.file_finder import select_file_finder @@ -67,12 +67,7 @@ type=str, default=None, ), - click.option( - "--matrix", - help="github actions matrix", - type=str, - default=None - ) + click.option("--matrix", help="github actions matrix", type=str, default=None), ] @@ -93,7 +88,12 @@ class TestResultsNotificationPayload: @click.command() @process_test_results_options def process_test_results( - dir=None, files=None, exclude_folders=None, disable_search=None, provider_token=None, matrix=None + dir=None, + files=None, + exclude_folders=None, + disable_search=None, + provider_token=None, + matrix=None, ): if provider_token is None: @@ -143,7 +143,7 @@ def process_test_results( create_github_comment(provider_token, slug, pr_number, message, matrix) -def create_github_comment(token, repo_slug, pr_number, message, matrix: str): +def create_github_comment(token, repo_slug, pr_number, message, matrix): headers = { "Accept": "application/vnd.github+json", "Authorization": f"Bearer {token}", @@ -154,12 +154,13 @@ def create_github_comment(token, repo_slug, pr_number, message, matrix: str): # list comments result = send_get_request(url=url, headers=headers) comments = loads(result.text) - matrix = matrix.strip() - for comment in comments: + if matrix is not None: + matrix = matrix.strip() + for comment in comments: if f"" in comment: logger.info("Patching github comment") - - url = comment['url'] + + url = comment["url"] log_warnings_and_errors_if_any( send_patch_request(url=url, json={"body": message}, headers=headers), "Patching test results comment", diff --git a/codecov_cli/helpers/request.py b/codecov_cli/helpers/request.py index 7d2ea629..12d73240 100644 --- a/codecov_cli/helpers/request.py +++ b/codecov_cli/helpers/request.py @@ -81,17 +81,15 @@ def wrapper(*args, **kwargs): @retry_request -def send_get_request( - url: str, headers: dict = None, params: dict = None -): +def send_get_request(url: str, headers: dict = None, params: dict = None): return request_result(get(url=url, headers=headers, params=params)) + @retry_request -def send_patch_request( - url: str, headers: dict = None, json: dict = None -): +def send_patch_request(url: str, headers: dict = None, json: dict = None): return request_result(patch(url=url, headers=headers, json=json)) + @retry_request def send_post_request( url: str, data: dict = None, headers: dict = None, params: dict = None diff --git a/tests/commands/test_process_test_results.py b/tests/commands/test_process_test_results.py index d0c62eb7..bf1d77f4 100644 --- a/tests/commands/test_process_test_results.py +++ b/tests/commands/test_process_test_results.py @@ -44,7 +44,6 @@ def test_process_test_results( assert result.exit_code == 0 - mocked_post.assert_called_with( url="https://api.github.com/repos/fake/repo/issues/pull/comments", data={ @@ -53,12 +52,12 @@ def test_process_test_results( headers={ "Accept": "application/vnd.github+json", "Authorization": "Bearer whatever", + "User-Agent": "codecov-cli/0.5.2", "X-GitHub-Api-Version": "2022-11-28", }, ) - def test_process_test_results_non_existent_file(mocker, tmpdir): tmp_file = tmpdir.mkdir("folder").join("summary.txt") @@ -93,7 +92,7 @@ def test_process_test_results_non_existent_file(mocker, tmpdir): assert result.exit_code == 1 expected_logs = [ "ci service found", - 'Some files were not found', + "Some files were not found", ] for log in expected_logs: assert log in result.output @@ -182,7 +181,6 @@ def test_process_test_results_missing_ref(mocker, tmpdir): assert log in result.output - def test_process_test_results_missing_step_summary(mocker, tmpdir): tmp_file = tmpdir.mkdir("folder").join("summary.txt") @@ -221,4 +219,4 @@ def test_process_test_results_missing_step_summary(mocker, tmpdir): "Error: Error getting step summary file path from environment. Can't find GITHUB_STEP_SUMMARY environment variable.", ] for log in expected_logs: - assert log in result.output \ No newline at end of file + assert log in result.output From 1390b1b1e6f6ed0774208be90ead51f15cd02e07 Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Thu, 2 May 2024 16:10:42 -0400 Subject: [PATCH 03/11] fix: fix matrix help message Signed-off-by: joseph-sentry --- codecov_cli/commands/process_test_results.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/codecov_cli/commands/process_test_results.py b/codecov_cli/commands/process_test_results.py index 6fa9a6cd..6e789a2f 100644 --- a/codecov_cli/commands/process_test_results.py +++ b/codecov_cli/commands/process_test_results.py @@ -67,7 +67,12 @@ type=str, default=None, ), - click.option("--matrix", help="github actions matrix", type=str, default=None), + click.option( + "--matrix", + help="Used by the test results action to let the CLI know which combination of values are currently selected for the matrix in the Github Actions run. This is used so that different runs in the matrix don't overwrite each other's comments.", + type=str, + default=None, + ), ] From bb8c65fac65e45a431254c0b3719c14ee9e2fe66 Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Fri, 10 May 2024 10:10:51 -0400 Subject: [PATCH 04/11] fix: remove matrix, just overwrite a single comment with this change we are assuming that users are running this command only once per CI run. Signed-off-by: joseph-sentry --- codecov_cli/commands/process_test_results.py | 25 ++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/codecov_cli/commands/process_test_results.py b/codecov_cli/commands/process_test_results.py index 6e789a2f..933b3d11 100644 --- a/codecov_cli/commands/process_test_results.py +++ b/codecov_cli/commands/process_test_results.py @@ -67,12 +67,6 @@ type=str, default=None, ), - click.option( - "--matrix", - help="Used by the test results action to let the CLI know which combination of values are currently selected for the matrix in the Github Actions run. This is used so that different runs in the matrix don't overwrite each other's comments.", - type=str, - default=None, - ), ] @@ -98,7 +92,6 @@ def process_test_results( exclude_folders=None, disable_search=None, provider_token=None, - matrix=None, ): if provider_token is None: @@ -145,10 +138,20 @@ def process_test_results( # GITHUB_REF is documented here: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables pr_number = ref.split("/")[2] - create_github_comment(provider_token, slug, pr_number, message, matrix) + create_github_comment( + provider_token, + slug, + pr_number, + message, + ) -def create_github_comment(token, repo_slug, pr_number, message, matrix): +def create_github_comment( + token, + repo_slug, + pr_number, + message, +): headers = { "Accept": "application/vnd.github+json", "Authorization": f"Bearer {token}", @@ -159,10 +162,8 @@ def create_github_comment(token, repo_slug, pr_number, message, matrix): # list comments result = send_get_request(url=url, headers=headers) comments = loads(result.text) - if matrix is not None: - matrix = matrix.strip() for comment in comments: - if f"" in comment: + if "" in comment: logger.info("Patching github comment") url = comment["url"] From fd7c4e66143c8a89100db82924c882ed5d65bb62 Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Fri, 10 May 2024 10:53:12 -0400 Subject: [PATCH 05/11] fix: add markdown comment to message Signed-off-by: joseph-sentry --- codecov_cli/commands/process_test_results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov_cli/commands/process_test_results.py b/codecov_cli/commands/process_test_results.py index 933b3d11..ab6de628 100644 --- a/codecov_cli/commands/process_test_results.py +++ b/codecov_cli/commands/process_test_results.py @@ -130,7 +130,7 @@ def process_test_results( payload = generate_message_payload(upload_collection_results) message = build_message(payload) - + message += "\n" # write to step summary file with open(summary_file_path, "w") as f: f.write(message) From dcfad1a4327b5026451c47b2537fe846fb7b3996 Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Fri, 10 May 2024 13:04:51 -0400 Subject: [PATCH 06/11] test: fix tests Signed-off-by: joseph-sentry --- tests/commands/test_process_test_results.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/commands/test_process_test_results.py b/tests/commands/test_process_test_results.py index bf1d77f4..171243dd 100644 --- a/tests/commands/test_process_test_results.py +++ b/tests/commands/test_process_test_results.py @@ -1,4 +1,3 @@ -import logging import os from click.testing import CliRunner @@ -47,7 +46,7 @@ def test_process_test_results( mocked_post.assert_called_with( url="https://api.github.com/repos/fake/repo/issues/pull/comments", data={ - "body": "### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n
View the full list of failed tests\n\n| **Test Description** | **Failure message** |\n| :-- | :-- |\n|
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
|
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError
|" + "body": "### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n
View the full list of failed tests\n\n| **Test Description** | **Failure message** |\n| :-- | :-- |\n|
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
|
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError
|\n" }, headers={ "Accept": "application/vnd.github+json", From 08bb4a82332e150227b8c624fbc3c1247a1021a5 Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Fri, 10 May 2024 16:08:34 -0400 Subject: [PATCH 07/11] fix: add view checks link at end of comment Signed-off-by: joseph-sentry --- codecov_cli/commands/process_test_results.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/codecov_cli/commands/process_test_results.py b/codecov_cli/commands/process_test_results.py index ab6de628..86583ff0 100644 --- a/codecov_cli/commands/process_test_results.py +++ b/codecov_cli/commands/process_test_results.py @@ -127,17 +127,19 @@ def process_test_results( "No JUnit XML files were found. Make sure to specify them using the --file option." ) + # GITHUB_REF is documented here: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + pr_number = ref.split("/")[2] + payload = generate_message_payload(upload_collection_results) message = build_message(payload) + server_url = os.getenv("GITHUB_SERVER_URL") + message += f"\n[View checks]({server_url}/{slug}/pull/{pr_number}/checks" message += "\n" # write to step summary file with open(summary_file_path, "w") as f: f.write(message) - # GITHUB_REF is documented here: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables - pr_number = ref.split("/")[2] - create_github_comment( provider_token, slug, From fa051b974e5308f50926854936235f2ec858b38b Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Fri, 10 May 2024 16:12:39 -0400 Subject: [PATCH 08/11] test: fix tests Signed-off-by: joseph-sentry --- tests/commands/test_process_test_results.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/commands/test_process_test_results.py b/tests/commands/test_process_test_results.py index 171243dd..cc87dd4b 100644 --- a/tests/commands/test_process_test_results.py +++ b/tests/commands/test_process_test_results.py @@ -17,8 +17,9 @@ def test_process_test_results( os.environ, { "GITHUB_REPOSITORY": "fake/repo", - "GITHUB_REF": "pull/fake/pull", + "GITHUB_REF": "refs/pull/1/merge", "GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename, + "GITHUB_SERVER_URL": "https://github.com", }, ) mocked_post = mocker.patch( @@ -44,9 +45,9 @@ def test_process_test_results( assert result.exit_code == 0 mocked_post.assert_called_with( - url="https://api.github.com/repos/fake/repo/issues/pull/comments", + url="https://api.github.com/repos/fake/repo/issues/1/comments", data={ - "body": "### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n
View the full list of failed tests\n\n| **Test Description** | **Failure message** |\n| :-- | :-- |\n|
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
|
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError
|\n" + "body": "### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n
View the full list of failed tests\n\n| **Test Description** | **Failure message** |\n| :-- | :-- |\n|
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
|
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError
|\n[View checks](https://github.com/fake/repo/pull/1/checks\n" }, headers={ "Accept": "application/vnd.github+json", From 94a77d73c95b6a1243abd2f9f8be60ac320e5441 Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Fri, 10 May 2024 16:14:22 -0400 Subject: [PATCH 09/11] build: fix build Signed-off-by: joseph-sentry --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57754b57..9698ff8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,6 +166,6 @@ jobs: - name: Dogfooding codecov-cli if: ${{ !cancelled() }} run: | - codecovcli process-test-results --provider-token ${{ secrets.GITHUB_TOKEN }} --matrix '${{ toJSON(matrix) }}' + codecovcli process-test-results --provider-token ${{ secrets.GITHUB_TOKEN }} sleep 5 - codecovcli process-test-results --provider-token ${{ secrets.GITHUB_TOKEN }} --matrix '${{ toJSON(matrix) }}' \ No newline at end of file + codecovcli process-test-results --provider-token ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 33494f2d37609cc5b3eb9593181eaada9a1b3623 Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Fri, 10 May 2024 16:19:09 -0400 Subject: [PATCH 10/11] test: fix tests Signed-off-by: joseph-sentry --- tests/commands/test_process_test_results.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/commands/test_process_test_results.py b/tests/commands/test_process_test_results.py index cc87dd4b..1c702dc3 100644 --- a/tests/commands/test_process_test_results.py +++ b/tests/commands/test_process_test_results.py @@ -2,6 +2,7 @@ from click.testing import CliRunner +from codecov_cli import __version__ from codecov_cli.main import cli from codecov_cli.types import RequestResult @@ -52,7 +53,7 @@ def test_process_test_results( headers={ "Accept": "application/vnd.github+json", "Authorization": "Bearer whatever", - "User-Agent": "codecov-cli/0.5.2", + "User-Agent": f"codecov-cli/{__version__}", "X-GitHub-Api-Version": "2022-11-28", }, ) From b1b9dc35ebf042cac91d31254b0094f993a8e539 Mon Sep 17 00:00:00 2001 From: joseph-sentry Date: Fri, 10 May 2024 16:32:21 -0400 Subject: [PATCH 11/11] fix: view checks in comment --- codecov_cli/commands/process_test_results.py | 2 +- tests/commands/test_process_test_results.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codecov_cli/commands/process_test_results.py b/codecov_cli/commands/process_test_results.py index 86583ff0..6f362e3f 100644 --- a/codecov_cli/commands/process_test_results.py +++ b/codecov_cli/commands/process_test_results.py @@ -134,7 +134,7 @@ def process_test_results( message = build_message(payload) server_url = os.getenv("GITHUB_SERVER_URL") - message += f"\n[View checks]({server_url}/{slug}/pull/{pr_number}/checks" + message += f"\n\n[View checks]({server_url}/{slug}/pull/{pr_number}/checks)" message += "\n" # write to step summary file with open(summary_file_path, "w") as f: diff --git a/tests/commands/test_process_test_results.py b/tests/commands/test_process_test_results.py index 1c702dc3..8e29d5af 100644 --- a/tests/commands/test_process_test_results.py +++ b/tests/commands/test_process_test_results.py @@ -48,7 +48,7 @@ def test_process_test_results( mocked_post.assert_called_with( url="https://api.github.com/repos/fake/repo/issues/1/comments", data={ - "body": "### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n
View the full list of failed tests\n\n| **Test Description** | **Failure message** |\n| :-- | :-- |\n|
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
|
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError
|\n[View checks](https://github.com/fake/repo/pull/1/checks\n" + "body": "### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n
View the full list of failed tests\n\n| **Test Description** | **Failure message** |\n| :-- | :-- |\n|
Testsuite:
api.temp.calculator.test_calculator::test_divide

Test name:
pytest
|
def
test_divide():
> assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError
|\n\n[View checks](https://github.com/fake/repo/pull/1/checks\n" }, headers={ "Accept": "application/vnd.github+json",