Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass args to send_reports_result_request #545

Merged
merged 9 commits into from
Nov 13, 2024
7 changes: 5 additions & 2 deletions codecov_cli/services/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import time
import typing

import requests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed?


from codecov_cli.helpers import request
from codecov_cli.helpers.config import CODECOV_API_URL, CODECOV_INGEST_URL
from codecov_cli.helpers.encoder import encode_slug
Expand All @@ -26,7 +28,7 @@ def create_report_logic(
enterprise_url: str,
pull_request_number: int,
fail_on_error: bool = False,
args: dict = None,
args: typing.Union[dict, None] = None,
):
encoded_slug = encode_slug(slug)
sending_result = send_create_report_request(
Expand Down Expand Up @@ -71,7 +73,7 @@ def create_report_results_logic(
token: typing.Optional[str],
enterprise_url: str,
fail_on_error: bool = False,
args: dict = None,
args: typing.Union[dict, None] = None,
):
encoded_slug = encode_slug(slug)
sending_result = send_reports_result_request(
Expand All @@ -81,6 +83,7 @@ def create_report_results_logic(
service=service,
token=token,
enterprise_url=enterprise_url,
args=args,
)

log_warnings_and_errors_if_any(
Expand Down
2 changes: 2 additions & 0 deletions tests/services/report/test_report_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def test_report_results_command_with_warnings(mocker):

assert res == mock_send_reports_result_request.return_value
mock_send_reports_result_request.assert_called_with(
args=None,
commit_sha="commit_sha",
report_code="code",
service="service",
Expand Down Expand Up @@ -85,6 +86,7 @@ def test_report_results_command_with_error(mocker):
]
assert res == mock_send_reports_result_request.return_value
mock_send_reports_result_request.assert_called_with(
args=None,
commit_sha="commit_sha",
report_code="code",
service="service",
Expand Down
Loading