Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ lint:
make lint.install
make lint.run

test:
cd codecov-cli && uv run pytest

command_dump:
cd prevent-cli && uv run command_dump.py

Expand Down
2 changes: 1 addition & 1 deletion codecov-cli/codecov_cli/helpers/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def log_warnings_and_errors_if_any(
sending_result: RequestResult, process_desc: str, fail_on_error: bool = False
):
logger.info(
f"Process {process_desc} complete",
f"{process_desc} complete",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The word "Process" seemed a little redundant to me.

)
logger.debug(
f"{process_desc} result",
Expand Down
2 changes: 1 addition & 1 deletion codecov-cli/codecov_cli/services/upload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,5 @@ def do_upload_logic(
status_code=200,
text="Data NOT sent to Codecov because of dry-run option",
)
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
log_warnings_and_errors_if_any(sending_result, "Upload queued for processing", fail_on_error)
return sending_result
2 changes: 1 addition & 1 deletion codecov-cli/codecov_cli/services/upload/upload_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def send_upload_data(
resp_json_obj = json.loads(resp_from_codecov.text)
if resp_json_obj.get("url"):
logger.info(
f"Your upload is now processing. When finished, results will be available at: {resp_json_obj.get('url')}"
f"Your upload is now queued for processing. When finished, results will be available at: {resp_json_obj.get('url')}"
)
logger.debug(
"Upload request to Codecov complete.",
Expand Down
2 changes: 1 addition & 1 deletion codecov-cli/tests/commands/test_invoke_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_upload_raise_Z_option(mocker):
result = runner.invoke(cli, ["do-upload", "--fail-on-error"], obj={})
upload_sender.assert_called()
upload_collector.assert_called()
assert ("error", "Upload failed: Unauthorized") in parse_outstreams_into_log_lines(
assert ("error", "Upload queued for processing failed: Unauthorized") in parse_outstreams_into_log_lines(
result.output
)
assert str(result) == "<Result SystemExit(1)>"
4 changes: 2 additions & 2 deletions codecov-cli/tests/services/commit/test_commit_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_commit_command_with_warnings(mocker):

out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Commit creating complete"),
("info", "Commit creating complete"),
("info", "Commit creating process had 1 warning"),
("warning", "Warning 1: somewarningmessage"),
]
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_commit_command_with_error(mocker):
assert out_bytes == [
(
"info",
"Process Commit creating complete",
"Commit creating complete",
),
("error", "Commit creating failed: Permission denied"),
]
Expand Down
10 changes: 5 additions & 5 deletions codecov-cli/tests/services/empty_upload/test_empty_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_empty_upload_with_warnings(mocker):
)
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Empty Upload complete"),
("info", "Empty Upload complete"),
("info", "Empty Upload process had 1 warning"),
("warning", "Warning 1: somewarningmessage"),
]
Expand Down Expand Up @@ -71,7 +71,7 @@ def test_empty_upload_with_error(mocker):

out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Empty Upload complete"),
("info", "Empty Upload complete"),
("error", "Empty Upload failed: Permission denied"),
]
assert res == mock_send_commit_data.return_value
Expand All @@ -97,7 +97,7 @@ def test_empty_upload_200(mocker):
)
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Empty Upload complete"),
("info", "Empty Upload complete"),
("info", "All changed files are ignored. Triggering passing notifications."),
("info", "Non ignored files []"),
]
Expand Down Expand Up @@ -142,7 +142,7 @@ def test_empty_upload_force(mocker):
)
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Empty Upload complete"),
("info", "Empty Upload complete"),
("info", "Force option was enabled. Triggering passing notifications."),
("info", "Non ignored files []"),
]
Expand Down Expand Up @@ -170,7 +170,7 @@ def test_empty_upload_no_token(mocker):

out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Empty Upload complete"),
("info", "Empty Upload complete"),
("info", "All changed files are ignored. Triggering passing notifications."),
("info", "Non ignored files []"),
]
Expand Down
4 changes: 2 additions & 2 deletions codecov-cli/tests/services/report/test_report_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_report_results_command_with_warnings(mocker):

out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Report results creating complete"),
("info", "Report results creating complete"),
("info", "Report results creating process had 1 warning"),
("warning", "Warning 1: somewarningmessage"),
]
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_report_results_command_with_error(mocker):

out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Report results creating complete"),
("info", "Report results creating complete"),
("error", "Report results creating failed: Permission denied"),
]
assert res == mock_send_reports_result_request.return_value
Expand Down
4 changes: 2 additions & 2 deletions codecov-cli/tests/services/report/test_report_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_create_report_command_with_warnings(mocker):

out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Report creating complete"),
("info", "Report creating complete"),
("info", "Report creating process had 1 warning"),
("warning", "Warning 1: somewarningmessage"),
]
Expand Down Expand Up @@ -130,7 +130,7 @@ def test_create_report_command_with_error(mocker):

out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Report creating complete"),
("info", "Report creating complete"),
("error", "Report creating failed: Permission denied"),
]
assert res == RequestResult(
Expand Down
18 changes: 9 additions & 9 deletions codecov-cli/tests/services/upload/test_upload_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def test_do_upload_logic_happy_path_legacy_uploader(mocker):
)
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Upload complete"),
("info", "Upload process had 1 warning"),
("info", "Upload queued for processing complete"),
("info", "Upload queued for processing process had 1 warning"),
("warning", "Warning 1: somewarningmessage"),
]

Expand Down Expand Up @@ -195,8 +195,8 @@ def test_do_upload_logic_happy_path(mocker):
)
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Upload complete"),
("info", "Upload process had 1 warning"),
("info", "Upload queued for processing complete"),
("info", "Upload queued for processing process had 1 warning"),
("warning", "Warning 1: somewarningmessage"),
]

Expand Down Expand Up @@ -333,7 +333,7 @@ def test_do_upload_logic_dry_run(mocker):
)
assert out_bytes == [
("info", "dry-run option activated. NOT sending data to Codecov."),
("info", "Process Upload complete"),
("info", "Upload queued for processing complete"),
]
assert res == RequestResult(
error=None,
Expand Down Expand Up @@ -399,10 +399,10 @@ def test_do_upload_logic_verbose(mocker, use_verbose_option):
"Selected uploader to use: <class 'codecov_cli.services.upload.legacy_upload_sender.LegacyUploadSender'>",
),
("info", "dry-run option activated. NOT sending data to Codecov."),
("info", "Process Upload complete"),
("info", "Upload queued for processing complete"),
(
"debug",
'Upload result --- {"result": "RequestResult(error=None, warnings=None, status_code=200, text=\'Data NOT sent to Codecov because of dry-run option\')"}',
'Upload queued for processing result --- {"result": "RequestResult(error=None, warnings=None, status_code=200, text=\'Data NOT sent to Codecov because of dry-run option\')"}',
),
]
assert res == RequestResult(
Expand Down Expand Up @@ -671,8 +671,8 @@ def test_do_upload_logic_happy_path_test_results(mocker):
)
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Upload complete"),
("info", "Upload process had 1 warning"),
("info", "Upload queued for processing complete"),
("info", "Upload queued for processing process had 1 warning"),
("warning", "Warning 1: somewarningmessage"),
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_upload_completion_with_warnings(mocker):
)
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Upload Completion complete"),
("info", "Upload Completion complete"),
("info", "Upload Completion process had 1 warning"),
("warning", "Warning 1: somewarningmessage"),
]
Expand Down Expand Up @@ -56,7 +56,7 @@ def test_upload_completion_with_error(mocker):
)
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Upload Completion complete"),
("info", "Upload Completion complete"),
("error", "Upload Completion failed: Permission denied"),
]
assert res == mock_send_commit_data.return_value
Expand Down Expand Up @@ -84,7 +84,7 @@ def test_upload_completion_200(mocker):
)
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Upload Completion complete"),
("info", "Upload Completion complete"),
(
"info",
"{'uploads_total': 2, 'uploads_success': 2, 'uploads_processing': 0, 'uploads_error': 0}",
Expand Down Expand Up @@ -113,7 +113,7 @@ def test_upload_completion_no_token(mocker):
res = upload_completion_logic("commit_sha", "owner/repo", None, "service", None)
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
assert out_bytes == [
("info", "Process Upload Completion complete"),
("info", "Upload Completion complete"),
(
"info",
"{'uploads_total': 2, 'uploads_success': 2, 'uploads_processing': 0, 'uploads_error': 0}",
Expand Down
Loading