Skip to content

Commit 31f1161

Browse files
test: Change tests for new changes
1 parent 402ad67 commit 31f1161

8 files changed

Lines changed: 28 additions & 25 deletions

File tree

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ lint:
2323
make lint.install
2424
make lint.run
2525

26+
test:
27+
cd codecov-cli && uv run pytest --cov --junitxml=junit.xml
28+
2629
command_dump:
2730
cd prevent-cli && uv run command_dump.py
2831

codecov-cli/tests/commands/test_invoke_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def test_upload_raise_Z_option(mocker):
4040
result = runner.invoke(cli, ["do-upload", "--fail-on-error"], obj={})
4141
upload_sender.assert_called()
4242
upload_collector.assert_called()
43-
assert ("error", "Upload failed: Unauthorized") in parse_outstreams_into_log_lines(
43+
assert ("error", "Upload queued for processing failed: Unauthorized") in parse_outstreams_into_log_lines(
4444
result.output
4545
)
4646
assert str(result) == "<Result SystemExit(1)>"

codecov-cli/tests/services/commit/test_commit_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_commit_command_with_warnings(mocker):
3131

3232
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
3333
assert out_bytes == [
34-
("info", "Process Commit creating complete"),
34+
("info", "Commit creating complete"),
3535
("info", "Commit creating process had 1 warning"),
3636
("warning", "Warning 1: somewarningmessage"),
3737
]
@@ -81,7 +81,7 @@ def test_commit_command_with_error(mocker):
8181
assert out_bytes == [
8282
(
8383
"info",
84-
"Process Commit creating complete",
84+
"Commit creating complete",
8585
),
8686
("error", "Commit creating failed: Permission denied"),
8787
]

codecov-cli/tests/services/empty_upload/test_empty_upload.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_empty_upload_with_warnings(mocker):
3434
)
3535
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
3636
assert out_bytes == [
37-
("info", "Process Empty Upload complete"),
37+
("info", "Empty Upload complete"),
3838
("info", "Empty Upload process had 1 warning"),
3939
("warning", "Warning 1: somewarningmessage"),
4040
]
@@ -71,7 +71,7 @@ def test_empty_upload_with_error(mocker):
7171

7272
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
7373
assert out_bytes == [
74-
("info", "Process Empty Upload complete"),
74+
("info", "Empty Upload complete"),
7575
("error", "Empty Upload failed: Permission denied"),
7676
]
7777
assert res == mock_send_commit_data.return_value
@@ -97,7 +97,7 @@ def test_empty_upload_200(mocker):
9797
)
9898
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
9999
assert out_bytes == [
100-
("info", "Process Empty Upload complete"),
100+
("info", "Empty Upload complete"),
101101
("info", "All changed files are ignored. Triggering passing notifications."),
102102
("info", "Non ignored files []"),
103103
]
@@ -142,7 +142,7 @@ def test_empty_upload_force(mocker):
142142
)
143143
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
144144
assert out_bytes == [
145-
("info", "Process Empty Upload complete"),
145+
("info", "Empty Upload complete"),
146146
("info", "Force option was enabled. Triggering passing notifications."),
147147
("info", "Non ignored files []"),
148148
]
@@ -170,7 +170,7 @@ def test_empty_upload_no_token(mocker):
170170

171171
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
172172
assert out_bytes == [
173-
("info", "Process Empty Upload complete"),
173+
("info", "Empty Upload complete"),
174174
("info", "All changed files are ignored. Triggering passing notifications."),
175175
("info", "Non ignored files []"),
176176
]

codecov-cli/tests/services/report/test_report_results.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_report_results_command_with_warnings(mocker):
3636

3737
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
3838
assert out_bytes == [
39-
("info", "Process Report results creating complete"),
39+
("info", "Report results creating complete"),
4040
("info", "Report results creating process had 1 warning"),
4141
("warning", "Warning 1: somewarningmessage"),
4242
]
@@ -81,7 +81,7 @@ def test_report_results_command_with_error(mocker):
8181

8282
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
8383
assert out_bytes == [
84-
("info", "Process Report results creating complete"),
84+
("info", "Report results creating complete"),
8585
("error", "Report results creating failed: Permission denied"),
8686
]
8787
assert res == mock_send_reports_result_request.return_value

codecov-cli/tests/services/report/test_report_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_create_report_command_with_warnings(mocker):
8787

8888
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
8989
assert out_bytes == [
90-
("info", "Process Report creating complete"),
90+
("info", "Report creating complete"),
9191
("info", "Report creating process had 1 warning"),
9292
("warning", "Warning 1: somewarningmessage"),
9393
]
@@ -130,7 +130,7 @@ def test_create_report_command_with_error(mocker):
130130

131131
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
132132
assert out_bytes == [
133-
("info", "Process Report creating complete"),
133+
("info", "Report creating complete"),
134134
("error", "Report creating failed: Permission denied"),
135135
]
136136
assert res == RequestResult(

codecov-cli/tests/services/upload/test_upload_service.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def test_do_upload_logic_happy_path_legacy_uploader(mocker):
8080
)
8181
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
8282
assert out_bytes == [
83-
("info", "Process Upload complete"),
84-
("info", "Upload process had 1 warning"),
83+
("info", "Upload queued for processing complete"),
84+
("info", "Upload queued for processing process had 1 warning"),
8585
("warning", "Warning 1: somewarningmessage"),
8686
]
8787

@@ -195,8 +195,8 @@ def test_do_upload_logic_happy_path(mocker):
195195
)
196196
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
197197
assert out_bytes == [
198-
("info", "Process Upload complete"),
199-
("info", "Upload process had 1 warning"),
198+
("info", "Upload queued for processing complete"),
199+
("info", "Upload queued for processing process had 1 warning"),
200200
("warning", "Warning 1: somewarningmessage"),
201201
]
202202

@@ -333,7 +333,7 @@ def test_do_upload_logic_dry_run(mocker):
333333
)
334334
assert out_bytes == [
335335
("info", "dry-run option activated. NOT sending data to Codecov."),
336-
("info", "Process Upload complete"),
336+
("info", "Upload queued for processing complete"),
337337
]
338338
assert res == RequestResult(
339339
error=None,
@@ -399,10 +399,10 @@ def test_do_upload_logic_verbose(mocker, use_verbose_option):
399399
"Selected uploader to use: <class 'codecov_cli.services.upload.legacy_upload_sender.LegacyUploadSender'>",
400400
),
401401
("info", "dry-run option activated. NOT sending data to Codecov."),
402-
("info", "Process Upload complete"),
402+
("info", "Upload queued for processing complete"),
403403
(
404404
"debug",
405-
'Upload result --- {"result": "RequestResult(error=None, warnings=None, status_code=200, text=\'Data NOT sent to Codecov because of dry-run option\')"}',
405+
'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\')"}',
406406
),
407407
]
408408
assert res == RequestResult(
@@ -671,8 +671,8 @@ def test_do_upload_logic_happy_path_test_results(mocker):
671671
)
672672
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
673673
assert out_bytes == [
674-
("info", "Process Upload complete"),
675-
("info", "Upload process had 1 warning"),
674+
("info", "Upload queued for processing complete"),
675+
("info", "Upload queued for processing process had 1 warning"),
676676
("warning", "Warning 1: somewarningmessage"),
677677
]
678678

codecov-cli/tests/services/upload_completion/test_upload_completion.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_upload_completion_with_warnings(mocker):
2727
)
2828
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
2929
assert out_bytes == [
30-
("info", "Process Upload Completion complete"),
30+
("info", "Upload Completion complete"),
3131
("info", "Upload Completion process had 1 warning"),
3232
("warning", "Warning 1: somewarningmessage"),
3333
]
@@ -56,7 +56,7 @@ def test_upload_completion_with_error(mocker):
5656
)
5757
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
5858
assert out_bytes == [
59-
("info", "Process Upload Completion complete"),
59+
("info", "Upload Completion complete"),
6060
("error", "Upload Completion failed: Permission denied"),
6161
]
6262
assert res == mock_send_commit_data.return_value
@@ -84,7 +84,7 @@ def test_upload_completion_200(mocker):
8484
)
8585
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
8686
assert out_bytes == [
87-
("info", "Process Upload Completion complete"),
87+
("info", "Upload Completion complete"),
8888
(
8989
"info",
9090
"{'uploads_total': 2, 'uploads_success': 2, 'uploads_processing': 0, 'uploads_error': 0}",
@@ -113,7 +113,7 @@ def test_upload_completion_no_token(mocker):
113113
res = upload_completion_logic("commit_sha", "owner/repo", None, "service", None)
114114
out_bytes = parse_outstreams_into_log_lines(outstreams[0].getvalue())
115115
assert out_bytes == [
116-
("info", "Process Upload Completion complete"),
116+
("info", "Upload Completion complete"),
117117
(
118118
"info",
119119
"{'uploads_total': 2, 'uploads_success': 2, 'uploads_processing': 0, 'uploads_error': 0}",

0 commit comments

Comments
 (0)