codecov-cli icon indicating copy to clipboard operation
codecov-cli copied to clipboard

fix: sanitize yaml token from logs

Open thomasrockhu-codecov opened this issue 1 year ago • 28 comments

fixes https://github.com/codecov/codecov-cli/issues/469 fixes https://github.com/codecov/codecov-cli/issues/468 fixes https://github.com/codecov/codecov-action/issues/1498

thomasrockhu-codecov avatar Aug 15 '24 19:08 thomasrockhu-codecov

:x: Failed Test Results:

Completed 693 tests with 23 failed, 670 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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
Testsuite:
tests.commands.test_invoke_upload::test_upload_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17cc9550>

def test_upload_raise_Z_option(mocker):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
upload_sender = mocker.patch.object(
UploadSender, "send_upload_data", return_value=result
)
upload_collector = mocker.patch.object(UploadCollector, "generate_upload_data")
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)

runner = CliRunner()
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(
result.output
)
E AssertionError: assert ('error', 'Upload failed: Unauthorized') in [('info', 'Process Upload complete')]
E + where [('info', 'Process Upload complete')] = parse_outstreams_into_log_lines('info - 2024-08-15 19:19:44,060 -- Process Upload complete\n')
E + where 'info - 2024-08-15 19:19:44,060 -- Process Upload complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload.py:43: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17d708b0>
use_verbose_option = None

def test_upload_process_raise_Z_option(mocker, use_verbose_option):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
command_result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)

runner = CliRunner()
with runner.isolated_filesystem():
with patch(
"codecov_cli.services.commit.send_commit_data"
) as mocked_create_commit:
mocked_create_commit.return_value = command_result
result = runner.invoke(
cli,
[
"upload-process",
"--fail-on-error",
"-C",
"command-sha",
"--slug",
"owner/repo",
],
obj={},
)

assert result.exit_code != 0
> assert "Commit creating failed: Unauthorized" in result.output
E AssertionError: assert 'Commit creating failed: Unauthorized' in 'info - 2024-08-15 19:19:44,122 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:44,131 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:44,133 -- Process Commit creating complete\n'
E + where 'info - 2024-08-15 19:19:44,122 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:44,131 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:44,133 -- Process Commit creating complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload_process.py:52: AssertionError
Testsuite:
tests.commands.test_process_test_results::test_process_test_results

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17ddd580>
tmpdir = local('.../pytest-of-runner/pytest-0/test_process_test_results0')

def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
os.environ,
{
"GITHUB_REPOSITORY": "fake/repo",
"GITHUB_REF": "pull/fake/pull",
"GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename,
},
)
mocked_post = mocker.patch(
"codecov_cli.commands.process_test_results.send_post_request",
return_value=RequestResult(
status_code=200, error=None, warnings=[], text="yay it worked"
),
)
runner = CliRunner()
result = runner.invoke(
cli,
[
"process-test-results",
"--provider-token",
"whatever",
"--file",
"samples/junit.xml",
"--disable-search",
],
obj={},
)

> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

tests/commands/test_process_test_results.py:45: AssertionError
Testsuite:
tests.helpers.test_request::test_log_error_no_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17c271c0>

def test_log_error_no_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=False)

tests/helpers/test_request.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.helpers.test_request::test_log_error_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17d8c6d0>

def test_log_error_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
with pytest.raises(SystemExit):
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=True)

tests/helpers/test_request.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17b80d60>

def test_base_picking_command(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(status_code=200, error=None, warnings=[], text=""),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:34: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17b01c40>

def test_base_picking_command_warnings(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="some random warning")],
status_code=200,
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:92: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17bbf1c0>

def test_base_picking_command_error(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
status_code=401,
error=RequestError(
code="HTTP Error 401",
description="Unauthorized",
params={},
),
warnings=[],
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
mocked_response.assert_called_once()
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:137: AssertionError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17d13a60>

def test_commit_command_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
)

.../services/commit/test_commit_service.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17d8cfa0>

def test_commit_command_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
enterprise_url=None,
)

.../services/commit/test_commit_service.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17cd5100>

def test_empty_upload_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17d9e550>

def test_empty_upload_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17ed4d00>

def test_empty_upload_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = empty_upload_logic(
"commit_sha", "owner/repo", token, "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17dfb6a0>

def test_report_results_command_with_warnings(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17b0a070>

def test_report_results_command_with_error(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17b01160>

def test_create_report_command_with_warnings(mocker):
mocked_send_request = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=200,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
enterprise_url=None,
pull_request_number=1,
)

.../services/report/test_report_service.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17df3850>

def test_create_report_command_with_error(mocker):
mock_send_report_data = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
status_code=403,
text="",
warnings=[],
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
pull_request_number=1,
enterprise_url="enterprise_url",
)

.../services/report/test_report_service.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_dry_run

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb178a4970>

def test_do_upload_logic_dry_run(mocker):
mock_select_preparation_plugins = mocker.patch(
"codecov_cli.services.upload.select_preparation_plugins"
)
mock_select_file_finder = mocker.patch(
"codecov_cli.services.upload.select_file_finder"
)
mock_select_network_finder = mocker.patch(
"codecov_cli.services.upload.select_network_finder"
)
mock_generate_upload_data = mocker.patch.object(
UploadCollector, "generate_upload_data"
)
mock_send_upload_data = mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_verbose

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17698dc0>
use_verbose_option = None

def test_do_upload_logic_verbose(mocker, use_verbose_option):
mocker.patch("codecov_cli.services.upload.select_preparation_plugins")
mocker.patch("codecov_cli.services.upload.select_file_finder")
mocker.patch("codecov_cli.services.upload.select_network_finder")
mocker.patch.object(UploadCollector, "generate_upload_data")
mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
use_legacy_uploader=True,
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17cd3970>

def test_upload_completion_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17bb3070>

def test_upload_completion_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffb17881f40>

def test_upload_completion_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = upload_completion_logic("commit_sha", "owner/repo", token, "service", None)

.../services/upload_completion/test_upload_completion.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ffb1a2de460>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 23 failed, 670 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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
Testsuite:
tests.commands.test_invoke_upload::test_upload_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504ad47f0>

def test_upload_raise_Z_option(mocker):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
upload_sender = mocker.patch.object(
UploadSender, "send_upload_data", return_value=result
)
upload_collector = mocker.patch.object(UploadCollector, "generate_upload_data")
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)

runner = CliRunner()
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(
result.output
)
E AssertionError: assert ('error', 'Upload failed: Unauthorized') in [('info', 'Process Upload complete')]
E + where [('info', 'Process Upload complete')] = parse_outstreams_into_log_lines('info - 2024-08-15 19:19:48,227 -- Process Upload complete\n')
E + where 'info - 2024-08-15 19:19:48,227 -- Process Upload complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload.py:43: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa50495ce50>
use_verbose_option = None

def test_upload_process_raise_Z_option(mocker, use_verbose_option):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
command_result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)

runner = CliRunner()
with runner.isolated_filesystem():
with patch(
"codecov_cli.services.commit.send_commit_data"
) as mocked_create_commit:
mocked_create_commit.return_value = command_result
result = runner.invoke(
cli,
[
"upload-process",
"--fail-on-error",
"-C",
"command-sha",
"--slug",
"owner/repo",
],
obj={},
)

assert result.exit_code != 0
> assert "Commit creating failed: Unauthorized" in result.output
E AssertionError: assert 'Commit creating failed: Unauthorized' in 'info - 2024-08-15 19:19:48,292 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:48,297 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:48,299 -- Process Commit creating complete\n'
E + where 'info - 2024-08-15 19:19:48,292 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:48,297 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:48,299 -- Process Commit creating complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload_process.py:52: AssertionError
Testsuite:
tests.commands.test_process_test_results::test_process_test_results

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504af2740>
tmpdir = local('.../pytest-of-runner/pytest-0/test_process_test_results0')

def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
os.environ,
{
"GITHUB_REPOSITORY": "fake/repo",
"GITHUB_REF": "pull/fake/pull",
"GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename,
},
)
mocked_post = mocker.patch(
"codecov_cli.commands.process_test_results.send_post_request",
return_value=RequestResult(
status_code=200, error=None, warnings=[], text="yay it worked"
),
)
runner = CliRunner()
result = runner.invoke(
cli,
[
"process-test-results",
"--provider-token",
"whatever",
"--file",
"samples/junit.xml",
"--disable-search",
],
obj={},
)

> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

tests/commands/test_process_test_results.py:45: AssertionError
Testsuite:
tests.helpers.test_request::test_log_error_no_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504965db0>

def test_log_error_no_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=False)

tests/helpers/test_request.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.helpers.test_request::test_log_error_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa5049650c0>

def test_log_error_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
with pytest.raises(SystemExit):
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=True)

tests/helpers/test_request.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa5047a0670>

def test_base_picking_command(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(status_code=200, error=None, warnings=[], text=""),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:34: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504798a90>

def test_base_picking_command_warnings(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="some random warning")],
status_code=200,
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:92: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa5048638b0>

def test_base_picking_command_error(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
status_code=401,
error=RequestError(
code="HTTP Error 401",
description="Unauthorized",
params={},
),
warnings=[],
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
mocked_response.assert_called_once()
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:137: AssertionError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504918640>

def test_commit_command_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
)

.../services/commit/test_commit_service.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504c722f0>

def test_commit_command_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
enterprise_url=None,
)

.../services/commit/test_commit_service.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504abdcc0>

def test_empty_upload_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504bc6b60>

def test_empty_upload_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa50483cc40>

def test_empty_upload_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = empty_upload_logic(
"commit_sha", "owner/repo", token, "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504ad6d40>

def test_report_results_command_with_warnings(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504790460>

def test_report_results_command_with_error(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa5048960e0>

def test_create_report_command_with_warnings(mocker):
mocked_send_request = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=200,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
enterprise_url=None,
pull_request_number=1,
)

.../services/report/test_report_service.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504aa94b0>

def test_create_report_command_with_error(mocker):
mock_send_report_data = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
status_code=403,
text="",
warnings=[],
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
pull_request_number=1,
enterprise_url="enterprise_url",
)

.../services/report/test_report_service.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_dry_run

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa50491b730>

def test_do_upload_logic_dry_run(mocker):
mock_select_preparation_plugins = mocker.patch(
"codecov_cli.services.upload.select_preparation_plugins"
)
mock_select_file_finder = mocker.patch(
"codecov_cli.services.upload.select_file_finder"
)
mock_select_network_finder = mocker.patch(
"codecov_cli.services.upload.select_network_finder"
)
mock_generate_upload_data = mocker.patch.object(
UploadCollector, "generate_upload_data"
)
mock_send_upload_data = mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_verbose

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa5047a19c0>
use_verbose_option = None

def test_do_upload_logic_verbose(mocker, use_verbose_option):
mocker.patch("codecov_cli.services.upload.select_preparation_plugins")
mocker.patch("codecov_cli.services.upload.select_file_finder")
mocker.patch("codecov_cli.services.upload.select_network_finder")
mocker.patch.object(UploadCollector, "generate_upload_data")
mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
use_legacy_uploader=True,
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa5046b4160>

def test_upload_completion_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa50467ff10>

def test_upload_completion_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa504a92170>

def test_upload_completion_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = upload_completion_logic("commit_sha", "owner/repo", token, "service", None)

.../services/upload_completion/test_upload_completion.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fa50786d360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 23 failed, 670 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.commands.test_invoke_upload::test_upload_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6955ee0>

def test_upload_raise_Z_option(mocker):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
upload_sender = mocker.patch.object(
UploadSender, "send_upload_data", return_value=result
)
upload_collector = mocker.patch.object(UploadCollector, "generate_upload_data")
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)

runner = CliRunner()
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(
result.output
)
E AssertionError: assert ('error', 'Upload failed: Unauthorized') in [('info', 'Process Upload complete')]
E + where [('info', 'Process Upload complete')] = parse_outstreams_into_log_lines('info - 2024-08-15 19:19:49,202 -- Process Upload complete\n')
E + where 'info - 2024-08-15 19:19:49,202 -- Process Upload complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload.py:43: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6939df0>
use_verbose_option = None

def test_upload_process_raise_Z_option(mocker, use_verbose_option):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
command_result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)

runner = CliRunner()
with runner.isolated_filesystem():
with patch(
"codecov_cli.services.commit.send_commit_data"
) as mocked_create_commit:
mocked_create_commit.return_value = command_result
result = runner.invoke(
cli,
[
"upload-process",
"--fail-on-error",
"-C",
"command-sha",
"--slug",
"owner/repo",
],
obj={},
)

assert result.exit_code != 0
> assert "Commit creating failed: Unauthorized" in result.output
E AssertionError: assert 'Commit creating failed: Unauthorized' in 'info - 2024-08-15 19:19:49,267 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:49,276 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:49,279 -- Process Commit creating complete\n'
E + where 'info - 2024-08-15 19:19:49,267 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:49,276 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:49,279 -- Process Commit creating complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload_process.py:52: AssertionError
Testsuite:
tests.commands.test_process_test_results::test_process_test_results

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6912d90>
tmpdir = local('.../pytest-of-runner/pytest-0/test_process_test_results0')

def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
os.environ,
{
"GITHUB_REPOSITORY": "fake/repo",
"GITHUB_REF": "pull/fake/pull",
"GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename,
},
)
mocked_post = mocker.patch(
"codecov_cli.commands.process_test_results.send_post_request",
return_value=RequestResult(
status_code=200, error=None, warnings=[], text="yay it worked"
),
)
runner = CliRunner()
result = runner.invoke(
cli,
[
"process-test-results",
"--provider-token",
"whatever",
"--file",
"samples/junit.xml",
"--disable-search",
],
obj={},
)

> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

tests/commands/test_process_test_results.py:45: AssertionError
Testsuite:
tests.helpers.test_request::test_log_error_no_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d678f2e0>

def test_log_error_no_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=False)

tests/helpers/test_request.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.helpers.test_request::test_log_error_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d690d430>

def test_log_error_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
with pytest.raises(SystemExit):
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=True)

tests/helpers/test_request.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d66dbd30>

def test_base_picking_command(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(status_code=200, error=None, warnings=[], text=""),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:34: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6abdfd0>

def test_base_picking_command_warnings(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="some random warning")],
status_code=200,
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:92: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6694d90>

def test_base_picking_command_error(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
status_code=401,
error=RequestError(
code="HTTP Error 401",
description="Unauthorized",
params={},
),
warnings=[],
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
mocked_response.assert_called_once()
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:137: AssertionError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6699d90>

def test_commit_command_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
)

.../services/commit/test_commit_service.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d66f4370>

def test_commit_command_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
enterprise_url=None,
)

.../services/commit/test_commit_service.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d66871c0>

def test_empty_upload_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d66ad6d0>

def test_empty_upload_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6927460>

def test_empty_upload_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = empty_upload_logic(
"commit_sha", "owner/repo", token, "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6888580>

def test_report_results_command_with_warnings(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6909d90>

def test_report_results_command_with_error(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6978f10>

def test_create_report_command_with_warnings(mocker):
mocked_send_request = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=200,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
enterprise_url=None,
pull_request_number=1,
)

.../services/report/test_report_service.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6ab8eb0>

def test_create_report_command_with_error(mocker):
mock_send_report_data = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
status_code=403,
text="",
warnings=[],
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
pull_request_number=1,
enterprise_url="enterprise_url",
)

.../services/report/test_report_service.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_dry_run

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d6965eb0>

def test_do_upload_logic_dry_run(mocker):
mock_select_preparation_plugins = mocker.patch(
"codecov_cli.services.upload.select_preparation_plugins"
)
mock_select_file_finder = mocker.patch(
"codecov_cli.services.upload.select_file_finder"
)
mock_select_network_finder = mocker.patch(
"codecov_cli.services.upload.select_network_finder"
)
mock_generate_upload_data = mocker.patch.object(
UploadCollector, "generate_upload_data"
)
mock_send_upload_data = mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_verbose

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d65884c0>
use_verbose_option = None

def test_do_upload_logic_verbose(mocker, use_verbose_option):
mocker.patch("codecov_cli.services.upload.select_preparation_plugins")
mocker.patch("codecov_cli.services.upload.select_file_finder")
mocker.patch("codecov_cli.services.upload.select_network_finder")
mocker.patch.object(UploadCollector, "generate_upload_data")
mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
use_legacy_uploader=True,
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d65ad3d0>

def test_upload_completion_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d673ed90>

def test_upload_completion_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fe2d69233a0>

def test_upload_completion_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = upload_completion_logic("commit_sha", "owner/repo", token, "service", None)

.../services/upload_completion/test_upload_completion.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fe2d9090940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
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

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 23 failed, 670 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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
Testsuite:
tests.commands.test_invoke_upload::test_upload_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1082158820>

def test_upload_raise_Z_option(mocker):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
upload_sender = mocker.patch.object(
UploadSender, "send_upload_data", return_value=result
)
upload_collector = mocker.patch.object(UploadCollector, "generate_upload_data")
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)

runner = CliRunner()
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(
result.output
)
E AssertionError: assert ('error', 'Upload failed: Unauthorized') in [('info', 'Process Upload complete')]
E + where [('info', 'Process Upload complete')] = parse_outstreams_into_log_lines('info - 2024-08-15 19:19:53,396 -- Process Upload complete\n')
E + where 'info - 2024-08-15 19:19:53,396 -- Process Upload complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload.py:43: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f108217a8e0>
use_verbose_option = None

def test_upload_process_raise_Z_option(mocker, use_verbose_option):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
command_result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)

runner = CliRunner()
with runner.isolated_filesystem():
with patch(
"codecov_cli.services.commit.send_commit_data"
) as mocked_create_commit:
mocked_create_commit.return_value = command_result
result = runner.invoke(
cli,
[
"upload-process",
"--fail-on-error",
"-C",
"command-sha",
"--slug",
"owner/repo",
],
obj={},
)

assert result.exit_code != 0
> assert "Commit creating failed: Unauthorized" in result.output
E AssertionError: assert 'Commit creating failed: Unauthorized' in 'info - 2024-08-15 19:19:53,460 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:53,469 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:53,472 -- Process Commit creating complete\n'
E + where 'info - 2024-08-15 19:19:53,460 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:53,469 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:53,472 -- Process Commit creating complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload_process.py:52: AssertionError
Testsuite:
tests.commands.test_process_test_results::test_process_test_results

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f10822d4820>
tmpdir = local('.../pytest-of-runner/pytest-0/test_process_test_results0')

def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
os.environ,
{
"GITHUB_REPOSITORY": "fake/repo",
"GITHUB_REF": "pull/fake/pull",
"GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename,
},
)
mocked_post = mocker.patch(
"codecov_cli.commands.process_test_results.send_post_request",
return_value=RequestResult(
status_code=200, error=None, warnings=[], text="yay it worked"
),
)
runner = CliRunner()
result = runner.invoke(
cli,
[
"process-test-results",
"--provider-token",
"whatever",
"--file",
"samples/junit.xml",
"--disable-search",
],
obj={},
)

> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

tests/commands/test_process_test_results.py:45: AssertionError
Testsuite:
tests.helpers.test_request::test_log_error_no_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081fcf130>

def test_log_error_no_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=False)

tests/helpers/test_request.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.helpers.test_request::test_log_error_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f10820c83d0>

def test_log_error_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
with pytest.raises(SystemExit):
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=True)

tests/helpers/test_request.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081f13a90>

def test_base_picking_command(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(status_code=200, error=None, warnings=[], text=""),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:34: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1082167940>

def test_base_picking_command_warnings(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="some random warning")],
status_code=200,
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:92: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1082175310>

def test_base_picking_command_error(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
status_code=401,
error=RequestError(
code="HTTP Error 401",
description="Unauthorized",
params={},
),
warnings=[],
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
mocked_response.assert_called_once()
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:137: AssertionError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081ec5d90>

def test_commit_command_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
)

.../services/commit/test_commit_service.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081f26520>

def test_commit_command_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
enterprise_url=None,
)

.../services/commit/test_commit_service.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081eeff40>

def test_empty_upload_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081fefe80>

def test_empty_upload_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f108210ce50>

def test_empty_upload_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = empty_upload_logic(
"commit_sha", "owner/repo", token, "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f10820c2760>

def test_report_results_command_with_warnings(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1082194be0>

def test_report_results_command_with_error(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081fc7cd0>

def test_create_report_command_with_warnings(mocker):
mocked_send_request = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=200,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
enterprise_url=None,
pull_request_number=1,
)

.../services/report/test_report_service.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081f64640>

def test_create_report_command_with_error(mocker):
mock_send_report_data = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
status_code=403,
text="",
warnings=[],
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
pull_request_number=1,
enterprise_url="enterprise_url",
)

.../services/report/test_report_service.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_dry_run

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081fbd370>

def test_do_upload_logic_dry_run(mocker):
mock_select_preparation_plugins = mocker.patch(
"codecov_cli.services.upload.select_preparation_plugins"
)
mock_select_file_finder = mocker.patch(
"codecov_cli.services.upload.select_file_finder"
)
mock_select_network_finder = mocker.patch(
"codecov_cli.services.upload.select_network_finder"
)
mock_generate_upload_data = mocker.patch.object(
UploadCollector, "generate_upload_data"
)
mock_send_upload_data = mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_verbose

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081eda8e0>
use_verbose_option = None

def test_do_upload_logic_verbose(mocker, use_verbose_option):
mocker.patch("codecov_cli.services.upload.select_preparation_plugins")
mocker.patch("codecov_cli.services.upload.select_file_finder")
mocker.patch("codecov_cli.services.upload.select_network_finder")
mocker.patch.object(UploadCollector, "generate_upload_data")
mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
use_legacy_uploader=True,
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081de92e0>

def test_upload_completion_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081c59df0>

def test_upload_completion_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f1081eed310>

def test_upload_completion_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = upload_completion_logic("commit_sha", "owner/repo", token, "service", None)

.../services/upload_completion/test_upload_completion.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f10848d0940>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.9.19........./x64/lib/python3.9/json/decoder.py:355: JSONDecodeError

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 23 failed, 670 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.commands.test_invoke_upload::test_upload_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f44878d05f0>

def test_upload_raise_Z_option(mocker):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
upload_sender = mocker.patch.object(
UploadSender, "send_upload_data", return_value=result
)
upload_collector = mocker.patch.object(UploadCollector, "generate_upload_data")
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)

runner = CliRunner()
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(
result.output
)
E AssertionError: assert ('error', 'Upload failed: Unauthorized') in [('info', 'Process Upload complete')]
E + where [('info', 'Process Upload complete')] = parse_outstreams_into_log_lines('info - 2024-08-15 19:19:53,632 -- Process Upload complete\n')
E + where 'info - 2024-08-15 19:19:53,632 -- Process Upload complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload.py:43: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f44878be4b0>
use_verbose_option = None

def test_upload_process_raise_Z_option(mocker, use_verbose_option):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
command_result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)

runner = CliRunner()
with runner.isolated_filesystem():
with patch(
"codecov_cli.services.commit.send_commit_data"
) as mocked_create_commit:
mocked_create_commit.return_value = command_result
result = runner.invoke(
cli,
[
"upload-process",
"--fail-on-error",
"-C",
"command-sha",
"--slug",
"owner/repo",
],
obj={},
)

assert result.exit_code != 0
> assert "Commit creating failed: Unauthorized" in result.output
E AssertionError: assert 'Commit creating failed: Unauthorized' in 'info - 2024-08-15 19:19:53,694 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:53,698 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:53,700 -- Process Commit creating complete\n'
E + where 'info - 2024-08-15 19:19:53,694 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:53,698 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:53,700 -- Process Commit creating complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload_process.py:52: AssertionError
Testsuite:
tests.commands.test_process_test_results::test_process_test_results

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f44878be990>
tmpdir = local('.../pytest-of-runner/pytest-0/test_process_test_results0')

def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
os.environ,
{
"GITHUB_REPOSITORY": "fake/repo",
"GITHUB_REF": "pull/fake/pull",
"GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename,
},
)
mocked_post = mocker.patch(
"codecov_cli.commands.process_test_results.send_post_request",
return_value=RequestResult(
status_code=200, error=None, warnings=[], text="yay it worked"
),
)
runner = CliRunner()
result = runner.invoke(
cli,
[
"process-test-results",
"--provider-token",
"whatever",
"--file",
"samples/junit.xml",
"--disable-search",
],
obj={},
)

> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

tests/commands/test_process_test_results.py:45: AssertionError
Testsuite:
tests.helpers.test_request::test_log_error_no_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f448797cf50>

def test_log_error_no_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=False)

tests/helpers/test_request.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.helpers.test_request::test_log_error_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4487846c30>

def test_log_error_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
with pytest.raises(SystemExit):
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=True)

tests/helpers/test_request.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f448786b650>

def test_base_picking_command(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(status_code=200, error=None, warnings=[], text=""),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:34: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f44878bf410>

def test_base_picking_command_warnings(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="some random warning")],
status_code=200,
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:92: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f44878934a0>

def test_base_picking_command_error(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
status_code=401,
error=RequestError(
code="HTTP Error 401",
description="Unauthorized",
params={},
),
warnings=[],
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
mocked_response.assert_called_once()
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:137: AssertionError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4487893200>

def test_commit_command_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
)

.../services/commit/test_commit_service.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4487885c40>

def test_commit_command_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
enterprise_url=None,
)

.../services/commit/test_commit_service.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4487844ad0>

def test_empty_upload_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f448784c860>

def test_empty_upload_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f448787fc80>

def test_empty_upload_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = empty_upload_logic(
"commit_sha", "owner/repo", token, "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f44879ed340>

def test_report_results_command_with_warnings(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4487847350>

def test_report_results_command_with_error(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f44878db7a0>

def test_create_report_command_with_warnings(mocker):
mocked_send_request = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=200,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
enterprise_url=None,
pull_request_number=1,
)

.../services/report/test_report_service.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f448788c1a0>

def test_create_report_command_with_error(mocker):
mock_send_report_data = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
status_code=403,
text="",
warnings=[],
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
pull_request_number=1,
enterprise_url="enterprise_url",
)

.../services/report/test_report_service.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_dry_run

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f448752a390>

def test_do_upload_logic_dry_run(mocker):
mock_select_preparation_plugins = mocker.patch(
"codecov_cli.services.upload.select_preparation_plugins"
)
mock_select_file_finder = mocker.patch(
"codecov_cli.services.upload.select_file_finder"
)
mock_select_network_finder = mocker.patch(
"codecov_cli.services.upload.select_network_finder"
)
mock_generate_upload_data = mocker.patch.object(
UploadCollector, "generate_upload_data"
)
mock_send_upload_data = mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_verbose

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4487670fe0>
use_verbose_option = None

def test_do_upload_logic_verbose(mocker, use_verbose_option):
mocker.patch("codecov_cli.services.upload.select_preparation_plugins")
mocker.patch("codecov_cli.services.upload.select_file_finder")
mocker.patch("codecov_cli.services.upload.select_network_finder")
mocker.patch.object(UploadCollector, "generate_upload_data")
mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
use_legacy_uploader=True,
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f44871e6de0>

def test_upload_completion_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4487163d40>

def test_upload_completion_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4487876360>

def test_upload_completion_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = upload_completion_logic("commit_sha", "owner/repo", token, "service", None)

.../services/upload_completion/test_upload_completion.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f448a311160>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
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

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 23 failed, 670 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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
Testsuite:
tests.commands.test_invoke_upload::test_upload_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a8c9820>

def test_upload_raise_Z_option(mocker):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
upload_sender = mocker.patch.object(
UploadSender, "send_upload_data", return_value=result
)
upload_collector = mocker.patch.object(UploadCollector, "generate_upload_data")
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)

runner = CliRunner()
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(
result.output
)
E AssertionError: assert ('error', 'Upload failed: Unauthorized') in [('info', 'Process Upload complete')]
E + where [('info', 'Process Upload complete')] = parse_outstreams_into_log_lines('info - 2024-08-15 19:19:58,241 -- Process Upload complete\n')
E + where 'info - 2024-08-15 19:19:58,241 -- Process Upload complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload.py:43: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a9ac610>
use_verbose_option = None

def test_upload_process_raise_Z_option(mocker, use_verbose_option):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
command_result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)

runner = CliRunner()
with runner.isolated_filesystem():
with patch(
"codecov_cli.services.commit.send_commit_data"
) as mocked_create_commit:
mocked_create_commit.return_value = command_result
result = runner.invoke(
cli,
[
"upload-process",
"--fail-on-error",
"-C",
"command-sha",
"--slug",
"owner/repo",
],
obj={},
)

assert result.exit_code != 0
> assert "Commit creating failed: Unauthorized" in result.output
E AssertionError: assert 'Commit creating failed: Unauthorized' in 'info - 2024-08-15 19:19:58,305 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:58,314 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:58,316 -- Process Commit creating complete\n'
E + where 'info - 2024-08-15 19:19:58,305 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:58,314 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:58,316 -- Process Commit creating complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload_process.py:52: AssertionError
Testsuite:
tests.commands.test_process_test_results::test_process_test_results

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a9b2550>
tmpdir = local('.../pytest-of-runner/pytest-0/test_process_test_results0')

def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
os.environ,
{
"GITHUB_REPOSITORY": "fake/repo",
"GITHUB_REF": "pull/fake/pull",
"GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename,
},
)
mocked_post = mocker.patch(
"codecov_cli.commands.process_test_results.send_post_request",
return_value=RequestResult(
status_code=200, error=None, warnings=[], text="yay it worked"
),
)
runner = CliRunner()
result = runner.invoke(
cli,
[
"process-test-results",
"--provider-token",
"whatever",
"--file",
"samples/junit.xml",
"--disable-search",
],
obj={},
)

> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

tests/commands/test_process_test_results.py:45: AssertionError
Testsuite:
tests.helpers.test_request::test_log_error_no_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a8264c0>

def test_log_error_no_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=False)

tests/helpers/test_request.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.helpers.test_request::test_log_error_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a997b50>

def test_log_error_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
with pytest.raises(SystemExit):
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=True)

tests/helpers/test_request.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a7933d0>

def test_base_picking_command(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(status_code=200, error=None, warnings=[], text=""),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:34: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a94dd30>

def test_base_picking_command_warnings(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="some random warning")],
status_code=200,
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:92: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a785700>

def test_base_picking_command_error(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
status_code=401,
error=RequestError(
code="HTTP Error 401",
description="Unauthorized",
params={},
),
warnings=[],
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
mocked_response.assert_called_once()
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:137: AssertionError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a9b9b50>

def test_commit_command_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
)

.../services/commit/test_commit_service.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a7227c0>

def test_commit_command_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
enterprise_url=None,
)

.../services/commit/test_commit_service.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a920520>

def test_empty_upload_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a7c08e0>

def test_empty_upload_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a989070>

def test_empty_upload_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = empty_upload_logic(
"commit_sha", "owner/repo", token, "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a9ed0a0>

def test_report_results_command_with_warnings(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a710370>

def test_report_results_command_with_error(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a7c3a00>

def test_create_report_command_with_warnings(mocker):
mocked_send_request = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=200,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
enterprise_url=None,
pull_request_number=1,
)

.../services/report/test_report_service.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a9ac5e0>

def test_create_report_command_with_error(mocker):
mock_send_report_data = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
status_code=403,
text="",
warnings=[],
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
pull_request_number=1,
enterprise_url="enterprise_url",
)

.../services/report/test_report_service.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_dry_run

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a6f35e0>

def test_do_upload_logic_dry_run(mocker):
mock_select_preparation_plugins = mocker.patch(
"codecov_cli.services.upload.select_preparation_plugins"
)
mock_select_file_finder = mocker.patch(
"codecov_cli.services.upload.select_file_finder"
)
mock_select_network_finder = mocker.patch(
"codecov_cli.services.upload.select_network_finder"
)
mock_generate_upload_data = mocker.patch.object(
UploadCollector, "generate_upload_data"
)
mock_send_upload_data = mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_verbose

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f74694b9580>
use_verbose_option = None

def test_do_upload_logic_verbose(mocker, use_verbose_option):
mocker.patch("codecov_cli.services.upload.select_preparation_plugins")
mocker.patch("codecov_cli.services.upload.select_file_finder")
mocker.patch("codecov_cli.services.upload.select_network_finder")
mocker.patch.object(UploadCollector, "generate_upload_data")
mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
use_legacy_uploader=True,
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a941520>

def test_upload_completion_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a8c65b0>

def test_upload_completion_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f746a95ca90>

def test_upload_completion_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = upload_completion_logic("commit_sha", "owner/repo", token, "service", None)

.../services/upload_completion/test_upload_completion.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/init.py:357: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f746ceb9430>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.8.18........./x64/lib/python3.8/json/decoder.py:355: JSONDecodeError

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 23 failed, 670 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.commands.test_invoke_upload::test_upload_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff034e86050>

def test_upload_raise_Z_option(mocker):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
upload_sender = mocker.patch.object(
UploadSender, "send_upload_data", return_value=result
)
upload_collector = mocker.patch.object(UploadCollector, "generate_upload_data")
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)

runner = CliRunner()
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(
result.output
)
E AssertionError: assert ('error', 'Upload failed: Unauthorized') in [('info', 'Process Upload complete')]
E + where [('info', 'Process Upload complete')] = parse_outstreams_into_log_lines('info - 2024-08-15 19:19:58,465 -- Process Upload complete\n')
E + where 'info - 2024-08-15 19:19:58,465 -- Process Upload complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload.py:43: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff03408b750>
use_verbose_option = None

def test_upload_process_raise_Z_option(mocker, use_verbose_option):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
command_result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)

runner = CliRunner()
with runner.isolated_filesystem():
with patch(
"codecov_cli.services.commit.send_commit_data"
) as mocked_create_commit:
mocked_create_commit.return_value = command_result
result = runner.invoke(
cli,
[
"upload-process",
"--fail-on-error",
"-C",
"command-sha",
"--slug",
"owner/repo",
],
obj={},
)

assert result.exit_code != 0
> assert "Commit creating failed: Unauthorized" in result.output
E AssertionError: assert 'Commit creating failed: Unauthorized' in 'info - 2024-08-15 19:19:58,521 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:58,525 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:58,527 -- Process Commit creating complete\n'
E + where 'info - 2024-08-15 19:19:58,521 -- ci service found: github-actions\nwarning - 2024-08-15 19:19:58,525 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:19:58,527 -- Process Commit creating complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload_process.py:52: AssertionError
Testsuite:
tests.commands.test_process_test_results::test_process_test_results

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff0340c8cd0>
tmpdir = local('.../pytest-of-runner/pytest-0/test_process_test_results0')

def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
os.environ,
{
"GITHUB_REPOSITORY": "fake/repo",
"GITHUB_REF": "pull/fake/pull",
"GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename,
},
)
mocked_post = mocker.patch(
"codecov_cli.commands.process_test_results.send_post_request",
return_value=RequestResult(
status_code=200, error=None, warnings=[], text="yay it worked"
),
)
runner = CliRunner()
result = runner.invoke(
cli,
[
"process-test-results",
"--provider-token",
"whatever",
"--file",
"samples/junit.xml",
"--disable-search",
],
obj={},
)

> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

tests/commands/test_process_test_results.py:45: AssertionError
Testsuite:
tests.helpers.test_request::test_log_error_no_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff0340c8b10>

def test_log_error_no_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=False)

tests/helpers/test_request.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.helpers.test_request::test_log_error_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033f38690>

def test_log_error_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
with pytest.raises(SystemExit):
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=True)

tests/helpers/test_request.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033e7c350>

def test_base_picking_command(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(status_code=200, error=None, warnings=[], text=""),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:34: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033fefb50>

def test_base_picking_command_warnings(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="some random warning")],
status_code=200,
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:92: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033f42950>

def test_base_picking_command_error(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
status_code=401,
error=RequestError(
code="HTTP Error 401",
description="Unauthorized",
params={},
),
warnings=[],
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
mocked_response.assert_called_once()
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:137: AssertionError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033e0a710>

def test_commit_command_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
)

.../services/commit/test_commit_service.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff034264950>

def test_commit_command_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
enterprise_url=None,
)

.../services/commit/test_commit_service.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033e7ec90>

def test_empty_upload_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033e8e890>

def test_empty_upload_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff0340c7c90>

def test_empty_upload_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = empty_upload_logic(
"commit_sha", "owner/repo", token, "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033d02d90>

def test_report_results_command_with_warnings(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff0340a2fd0>

def test_report_results_command_with_error(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff034264e50>

def test_create_report_command_with_warnings(mocker):
mocked_send_request = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=200,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
enterprise_url=None,
pull_request_number=1,
)

.../services/report/test_report_service.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033fe2350>

def test_create_report_command_with_error(mocker):
mock_send_report_data = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
status_code=403,
text="",
warnings=[],
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
pull_request_number=1,
enterprise_url="enterprise_url",
)

.../services/report/test_report_service.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_dry_run

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033d31b10>

def test_do_upload_logic_dry_run(mocker):
mock_select_preparation_plugins = mocker.patch(
"codecov_cli.services.upload.select_preparation_plugins"
)
mock_select_file_finder = mocker.patch(
"codecov_cli.services.upload.select_file_finder"
)
mock_select_network_finder = mocker.patch(
"codecov_cli.services.upload.select_network_finder"
)
mock_generate_upload_data = mocker.patch.object(
UploadCollector, "generate_upload_data"
)
mock_send_upload_data = mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_verbose

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033dfce10>
use_verbose_option = None

def test_do_upload_logic_verbose(mocker, use_verbose_option):
mocker.patch("codecov_cli.services.upload.select_preparation_plugins")
mocker.patch("codecov_cli.services.upload.select_file_finder")
mocker.patch("codecov_cli.services.upload.select_network_finder")
mocker.patch.object(UploadCollector, "generate_upload_data")
mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
use_legacy_uploader=True,
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033da52d0>

def test_upload_completion_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033aab390>

def test_upload_completion_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff033da7090>

def test_upload_completion_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = upload_completion_logic("commit_sha", "owner/repo", token, "service", None)

.../services/upload_completion/test_upload_completion.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7ff036da6b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
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

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 23 failed, 670 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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
Testsuite:
tests.commands.test_invoke_upload::test_upload_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a61c7d0>

def test_upload_raise_Z_option(mocker):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
upload_sender = mocker.patch.object(
UploadSender, "send_upload_data", return_value=result
)
upload_collector = mocker.patch.object(UploadCollector, "generate_upload_data")
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)

runner = CliRunner()
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(
result.output
)
E AssertionError: assert ('error', 'Upload failed: Unauthorized') in [('info', 'Process Upload complete')]
E + where [('info', 'Process Upload complete')] = parse_outstreams_into_log_lines('info - 2024-08-15 19:20:02,285 -- Process Upload complete\n')
E + where 'info - 2024-08-15 19:20:02,285 -- Process Upload complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload.py:43: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a75f1d0>
use_verbose_option = None

def test_upload_process_raise_Z_option(mocker, use_verbose_option):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
command_result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)

runner = CliRunner()
with runner.isolated_filesystem():
with patch(
"codecov_cli.services.commit.send_commit_data"
) as mocked_create_commit:
mocked_create_commit.return_value = command_result
result = runner.invoke(
cli,
[
"upload-process",
"--fail-on-error",
"-C",
"command-sha",
"--slug",
"owner/repo",
],
obj={},
)

assert result.exit_code != 0
> assert "Commit creating failed: Unauthorized" in result.output
E AssertionError: assert 'Commit creating failed: Unauthorized' in 'info - 2024-08-15 19:20:02,356 -- ci service found: github-actions\nwarning - 2024-08-15 19:20:02,362 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:20:02,364 -- Process Commit creating complete\n'
E + where 'info - 2024-08-15 19:20:02,356 -- ci service found: github-actions\nwarning - 2024-08-15 19:20:02,362 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:20:02,364 -- Process Commit creating complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload_process.py:52: AssertionError
Testsuite:
tests.commands.test_process_test_results::test_process_test_results

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a622b10>
tmpdir = local('.../pytest-of-runner/pytest-0/test_process_test_results0')

def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
os.environ,
{
"GITHUB_REPOSITORY": "fake/repo",
"GITHUB_REF": "pull/fake/pull",
"GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename,
},
)
mocked_post = mocker.patch(
"codecov_cli.commands.process_test_results.send_post_request",
return_value=RequestResult(
status_code=200, error=None, warnings=[], text="yay it worked"
),
)
runner = CliRunner()
result = runner.invoke(
cli,
[
"process-test-results",
"--provider-token",
"whatever",
"--file",
"samples/junit.xml",
"--disable-search",
],
obj={},
)

> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

tests/commands/test_process_test_results.py:45: AssertionError
Testsuite:
tests.helpers.test_request::test_log_error_no_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a6f0050>

def test_log_error_no_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=False)

tests/helpers/test_request.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.helpers.test_request::test_log_error_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a546910>

def test_log_error_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
with pytest.raises(SystemExit):
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=True)

tests/helpers/test_request.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a4247d0>

def test_base_picking_command(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(status_code=200, error=None, warnings=[], text=""),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:34: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a5f5a50>

def test_base_picking_command_warnings(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="some random warning")],
status_code=200,
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:92: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a422990>

def test_base_picking_command_error(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
status_code=401,
error=RequestError(
code="HTTP Error 401",
description="Unauthorized",
params={},
),
warnings=[],
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
mocked_response.assert_called_once()
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:137: AssertionError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a43f790>

def test_commit_command_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
)

.../services/commit/test_commit_service.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a573fd0>

def test_commit_command_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
enterprise_url=None,
)

.../services/commit/test_commit_service.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a8c9f90>

def test_empty_upload_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a40e090>

def test_empty_upload_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a5f6790>

def test_empty_upload_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = empty_upload_logic(
"commit_sha", "owner/repo", token, "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a33b110>

def test_report_results_command_with_warnings(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a5f2d10>

def test_report_results_command_with_error(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a41aed0>

def test_create_report_command_with_warnings(mocker):
mocked_send_request = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=200,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
enterprise_url=None,
pull_request_number=1,
)

.../services/report/test_report_service.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a499c90>

def test_create_report_command_with_error(mocker):
mock_send_report_data = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
status_code=403,
text="",
warnings=[],
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
pull_request_number=1,
enterprise_url="enterprise_url",
)

.../services/report/test_report_service.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_dry_run

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a371b90>

def test_do_upload_logic_dry_run(mocker):
mock_select_preparation_plugins = mocker.patch(
"codecov_cli.services.upload.select_preparation_plugins"
)
mock_select_file_finder = mocker.patch(
"codecov_cli.services.upload.select_file_finder"
)
mock_select_network_finder = mocker.patch(
"codecov_cli.services.upload.select_network_finder"
)
mock_generate_upload_data = mocker.patch.object(
UploadCollector, "generate_upload_data"
)
mock_send_upload_data = mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_verbose

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a0406d0>
use_verbose_option = None

def test_do_upload_logic_verbose(mocker, use_verbose_option):
mocker.patch("codecov_cli.services.upload.select_preparation_plugins")
mocker.patch("codecov_cli.services.upload.select_file_finder")
mocker.patch("codecov_cli.services.upload.select_network_finder")
mocker.patch.object(UploadCollector, "generate_upload_data")
mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
use_legacy_uploader=True,
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a060e10>

def test_upload_completion_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a3d2310>

def test_upload_completion_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fae3a46be50>

def test_upload_completion_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = upload_completion_logic("commit_sha", "owner/repo", token, "service", None)

.../services/upload_completion/test_upload_completion.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7fae3d442b50>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.11.9........./x64/lib/python3.11/json/decoder.py:355: JSONDecodeError

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 23 failed, 670 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.commands.test_invoke_upload::test_upload_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee3c08c40>

def test_upload_raise_Z_option(mocker):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
upload_sender = mocker.patch.object(
UploadSender, "send_upload_data", return_value=result
)
upload_collector = mocker.patch.object(UploadCollector, "generate_upload_data")
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)

runner = CliRunner()
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(
result.output
)
E AssertionError: assert ('error', 'Upload failed: Unauthorized') in [('info', 'Process Upload complete')]
E + where [('info', 'Process Upload complete')] = parse_outstreams_into_log_lines('info - 2024-08-15 19:20:05,369 -- Process Upload complete\n')
E + where 'info - 2024-08-15 19:20:05,369 -- Process Upload complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload.py:43: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2b593c0>
use_verbose_option = None

def test_upload_process_raise_Z_option(mocker, use_verbose_option):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
command_result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)

runner = CliRunner()
with runner.isolated_filesystem():
with patch(
"codecov_cli.services.commit.send_commit_data"
) as mocked_create_commit:
mocked_create_commit.return_value = command_result
result = runner.invoke(
cli,
[
"upload-process",
"--fail-on-error",
"-C",
"command-sha",
"--slug",
"owner/repo",
],
obj={},
)

assert result.exit_code != 0
> assert "Commit creating failed: Unauthorized" in result.output
E AssertionError: assert 'Commit creating failed: Unauthorized' in 'info - 2024-08-15 19:20:05,433 -- ci service found: github-actions\nwarning - 2024-08-15 19:20:05,438 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:20:05,440 -- Process Commit creating complete\n'
E + where 'info - 2024-08-15 19:20:05,433 -- ci service found: github-actions\nwarning - 2024-08-15 19:20:05,438 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:20:05,440 -- Process Commit creating complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload_process.py:52: AssertionError
Testsuite:
tests.commands.test_process_test_results::test_process_test_results

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2b73d30>
tmpdir = local('.../pytest-of-runner/pytest-0/test_process_test_results0')

def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
os.environ,
{
"GITHUB_REPOSITORY": "fake/repo",
"GITHUB_REF": "pull/fake/pull",
"GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename,
},
)
mocked_post = mocker.patch(
"codecov_cli.commands.process_test_results.send_post_request",
return_value=RequestResult(
status_code=200, error=None, warnings=[], text="yay it worked"
),
)
runner = CliRunner()
result = runner.invoke(
cli,
[
"process-test-results",
"--provider-token",
"whatever",
"--file",
"samples/junit.xml",
"--disable-search",
],
obj={},
)

> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

tests/commands/test_process_test_results.py:45: AssertionError
Testsuite:
tests.helpers.test_request::test_log_error_no_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2cb3c10>

def test_log_error_no_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=False)

tests/helpers/test_request.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.helpers.test_request::test_log_error_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2cb2bf0>

def test_log_error_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
with pytest.raises(SystemExit):
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=True)

tests/helpers/test_request.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2991f90>

def test_base_picking_command(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(status_code=200, error=None, warnings=[], text=""),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:34: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee299b820>

def test_base_picking_command_warnings(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="some random warning")],
status_code=200,
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:92: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2a538e0>

def test_base_picking_command_error(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
status_code=401,
error=RequestError(
code="HTTP Error 401",
description="Unauthorized",
params={},
),
warnings=[],
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
mocked_response.assert_called_once()
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:137: AssertionError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2e4bc70>

def test_commit_command_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
)

.../services/commit/test_commit_service.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2ddd5a0>

def test_commit_command_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
enterprise_url=None,
)

.../services/commit/test_commit_service.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2ac3610>

def test_empty_upload_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2cba800>

def test_empty_upload_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2a5f0d0>

def test_empty_upload_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = empty_upload_logic(
"commit_sha", "owner/repo", token, "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2cd84f0>

def test_report_results_command_with_warnings(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2cd28c0>

def test_report_results_command_with_error(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2ce4e50>

def test_create_report_command_with_warnings(mocker):
mocked_send_request = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=200,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
enterprise_url=None,
pull_request_number=1,
)

.../services/report/test_report_service.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2924cd0>

def test_create_report_command_with_error(mocker):
mock_send_report_data = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
status_code=403,
text="",
warnings=[],
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
pull_request_number=1,
enterprise_url="enterprise_url",
)

.../services/report/test_report_service.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_dry_run

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2947700>

def test_do_upload_logic_dry_run(mocker):
mock_select_preparation_plugins = mocker.patch(
"codecov_cli.services.upload.select_preparation_plugins"
)
mock_select_file_finder = mocker.patch(
"codecov_cli.services.upload.select_file_finder"
)
mock_select_network_finder = mocker.patch(
"codecov_cli.services.upload.select_network_finder"
)
mock_generate_upload_data = mocker.patch.object(
UploadCollector, "generate_upload_data"
)
mock_send_upload_data = mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_verbose

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2998cd0>
use_verbose_option = None

def test_do_upload_logic_verbose(mocker, use_verbose_option):
mocker.patch("codecov_cli.services.upload.select_preparation_plugins")
mocker.patch("codecov_cli.services.upload.select_file_finder")
mocker.patch("codecov_cli.services.upload.select_network_finder")
mocker.patch.object(UploadCollector, "generate_upload_data")
mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
use_legacy_uploader=True,
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee28beef0>

def test_upload_completion_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee287bca0>

def test_upload_completion_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f4ee2a33c10>

def test_upload_completion_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = upload_completion_logic("commit_sha", "owner/repo", token, "service", None)

.../services/upload_completion/test_upload_completion.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f4ee5aad360>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.10.14........./x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
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

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 23 failed, 670 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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
Testsuite:
tests.commands.test_invoke_upload::test_upload_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f1e8290>

def test_upload_raise_Z_option(mocker):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
upload_sender = mocker.patch.object(
UploadSender, "send_upload_data", return_value=result
)
upload_collector = mocker.patch.object(UploadCollector, "generate_upload_data")
fake_ci_provider = FakeProvider({FallbackFieldEnum.commit_sha: None})
mocker.patch("codecov_cli.main.get_ci_adapter", return_value=fake_ci_provider)

runner = CliRunner()
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(
result.output
)
E AssertionError: assert ('error', 'Upload failed: Unauthorized') in [('info', 'Process Upload complete')]
E + where [('info', 'Process Upload complete')] = parse_outstreams_into_log_lines('info - 2024-08-15 19:20:14,484 -- Process Upload complete\n')
E + where 'info - 2024-08-15 19:20:14,484 -- Process Upload complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload.py:43: AssertionError
Testsuite:
tests.commands.test_invoke_upload_process::test_upload_process_raise_Z_option

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f1d6180>
use_verbose_option = None

def test_upload_process_raise_Z_option(mocker, use_verbose_option):
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
command_result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)

runner = CliRunner()
with runner.isolated_filesystem():
with patch(
"codecov_cli.services.commit.send_commit_data"
) as mocked_create_commit:
mocked_create_commit.return_value = command_result
result = runner.invoke(
cli,
[
"upload-process",
"--fail-on-error",
"-C",
"command-sha",
"--slug",
"owner/repo",
],
obj={},
)

assert result.exit_code != 0
> assert "Commit creating failed: Unauthorized" in result.output
E AssertionError: assert 'Commit creating failed: Unauthorized' in 'info - 2024-08-15 19:20:14,545 -- ci service found: github-actions\nwarning - 2024-08-15 19:20:14,550 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:20:14,552 -- Process Commit creating complete\n'
E + where 'info - 2024-08-15 19:20:14,545 -- ci service found: github-actions\nwarning - 2024-08-15 19:20:14,550 -- No config file could be found. Ignoring config.\ninfo - 2024-08-15 19:20:14,552 -- Process Commit creating complete\n' = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.output

tests/commands/test_invoke_upload_process.py:52: AssertionError
Testsuite:
tests.commands.test_process_test_results::test_process_test_results

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f1d6930>
tmpdir = local('.../pytest-of-runner/pytest-0/test_process_test_results0')

def test_process_test_results(
mocker,
tmpdir,
):

tmp_file = tmpdir.mkdir("folder").join("summary.txt")

mocker.patch.dict(
os.environ,
{
"GITHUB_REPOSITORY": "fake/repo",
"GITHUB_REF": "pull/fake/pull",
"GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename,
},
)
mocked_post = mocker.patch(
"codecov_cli.commands.process_test_results.send_post_request",
return_value=RequestResult(
status_code=200, error=None, warnings=[], text="yay it worked"
),
)
runner = CliRunner()
result = runner.invoke(
cli,
[
"process-test-results",
"--provider-token",
"whatever",
"--file",
"samples/junit.xml",
"--disable-search",
],
obj={},
)

> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

tests/commands/test_process_test_results.py:45: AssertionError
Testsuite:
tests.helpers.test_request::test_log_error_no_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f298c20>

def test_log_error_no_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=False)

tests/helpers/test_request.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.helpers.test_request::test_log_error_raise

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f15e0c0>

def test_log_error_raise(mocker):
mock_log_error = mocker.patch.object(req_log, "error")
error = RequestError(
code=401, params={"some": "params"}, description="Unauthorized"
)
result = RequestResult(
error=error, warnings=[], status_code=401, text="Unauthorized"
)
with pytest.raises(SystemExit):
> log_warnings_and_errors_if_any(result, "Process", fail_on_error=True)

tests/helpers/test_request.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>, s = 'Unauthorized'
idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f16ff20>

def test_base_picking_command(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(status_code=200, error=None, warnings=[], text=""),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:34: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f1674d0>

def test_base_picking_command_warnings(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="some random warning")],
status_code=200,
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:92: AssertionError
Testsuite:
tests.services.commit.test_base_picking::test_base_picking_command_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f19e4e0>

def test_base_picking_command_error(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.base_picking.send_put_request",
return_value=RequestResult(
status_code=401,
error=RequestError(
code="HTTP Error 401",
description="Unauthorized",
params={},
),
warnings=[],
text="",
),
)
token = uuid.uuid4()
runner = CliRunner()
result = runner.invoke(
pr_base_picking,
[
"-t",
token,
"--pr",
"11",
"--base-sha",
"9a6902ee94c18e8e27561ce316b16d75a02c7bc1",
"--service",
"github",
"--slug",
"owner/repo",
],
obj=mocker.MagicMock(), # context object
)
mocked_response.assert_called_once()
> assert result.exit_code == 0
E AssertionError: assert 1 == 0
E + where 1 = <Result JSONDecodeError('Expecting value: line 1 column 1 (char 0)')>.exit_code

.../services/commit/test_base_picking.py:137: AssertionError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f19e0c0>

def test_commit_command_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
)

.../services/commit/test_commit_service.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.commit.test_commit_service::test_commit_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f15e060>

def test_commit_command_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.commit.send_commit_data",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_commit_logic(
commit_sha="commit_sha",
parent_sha="parent_sha",
pr="pr_num",
branch="branch",
slug="owner/repo",
token="token",
service="service",
enterprise_url=None,
)

.../services/commit/test_commit_service.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/commit/init.py:39: in create_commit_logic
log_warnings_and_errors_if_any(sending_result, "Commit creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f164950>

def test_empty_upload_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f16d7f0>

def test_empty_upload_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.empty_upload.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = empty_upload_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.empty_upload.test_empty_upload::test_empty_upload_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f191d60>

def test_empty_upload_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = empty_upload_logic(
"commit_sha", "owner/repo", token, "service", None, False, False
)

.../services/empty_upload/test_empty_upload.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/empty_upload/init.py:25: in empty_upload_logic
log_warnings_and_errors_if_any(sending_result, "Empty Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f1d61e0>

def test_report_results_command_with_warnings(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:27:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_results::test_report_results_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f19ef00>

def test_report_results_command_with_error(mocker):
mock_send_reports_result_request = mocker.patch(
"codecov_cli.services.report.send_reports_result_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_results_logic(
commit_sha="commit_sha",
code="code",
service="service",
slug="owner/repo",
token="token",
enterprise_url=None,
)

.../services/report/test_report_results.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:75: in create_report_results_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f1f3b90>

def test_create_report_command_with_warnings(mocker):
mocked_send_request = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=200,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
enterprise_url=None,
pull_request_number=1,
)

.../services/report/test_report_service.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.report.test_report_service::test_create_report_command_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f1e2600>

def test_create_report_command_with_error(mocker):
mock_send_report_data = mocker.patch(
"codecov_cli.services.report.send_create_report_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
status_code=403,
text="",
warnings=[],
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = create_report_logic(
commit_sha="commit_sha",
code="code",
slug="owner/repo",
service="github",
token="token",
pull_request_number=1,
enterprise_url="enterprise_url",
)

.../services/report/test_report_service.py:100:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/report/init.py:42: in create_report_logic
log_warnings_and_errors_if_any(sending_result, "Report creating", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_dry_run

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5ee5f740>

def test_do_upload_logic_dry_run(mocker):
mock_select_preparation_plugins = mocker.patch(
"codecov_cli.services.upload.select_preparation_plugins"
)
mock_select_file_finder = mocker.patch(
"codecov_cli.services.upload.select_file_finder"
)
mock_select_network_finder = mocker.patch(
"codecov_cli.services.upload.select_network_finder"
)
mock_generate_upload_data = mocker.patch.object(
UploadCollector, "generate_upload_data"
)
mock_send_upload_data = mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:221:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload.test_upload_service::test_do_upload_logic_verbose

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5ea63f80>
use_verbose_option = None

def test_do_upload_logic_verbose(mocker, use_verbose_option):
mocker.patch("codecov_cli.services.upload.select_preparation_plugins")
mocker.patch("codecov_cli.services.upload.select_file_finder")
mocker.patch("codecov_cli.services.upload.select_network_finder")
mocker.patch.object(UploadCollector, "generate_upload_data")
mocker.patch.object(
LegacyUploadSender,
"send_upload_data",
)
cli_config = {}
versioning_system = mocker.MagicMock()
ci_adapter = mocker.MagicMock()
ci_adapter.get_fallback_value.return_value = "service"
runner = CliRunner()
with runner.isolation() as outstreams:
> res = do_upload_logic(
cli_config,
versioning_system,
ci_adapter,
upload_file_type="coverage",
commit_sha="commit_sha",
report_code="report_code",
build_code="build_code",
build_url="build_url",
job_code="job_code",
env_vars=None,
flags=None,
name="name",
network_filter=None,
network_prefix=None,
network_root_folder=None,
files_search_root_folder=None,
files_search_exclude_folders=None,
files_search_explicitly_listed_files=None,
plugin_names=["first_plugin", "another", "forth"],
token="token",
branch="branch",
slug="slug",
use_legacy_uploader=True,
pull_request_number="pr",
dry_run=True,
git_service="git_service",
enterprise_url=None,
)

.../services/upload/test_upload_service.py:284:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/init.py:139: in do_upload_logic
log_warnings_and_errors_if_any(sending_result, "Upload", fail_on_error)
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>
s = 'Data NOT sent to Codecov because of dry-run option', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_warnings

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5eae2b40>

def test_upload_completion_with_warnings(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=None,
warnings=[RequestResultWarning(message="somewarningmessage")],
status_code=201,
text="",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:23:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>, s = '', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_with_error

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f1af200>

def test_upload_completion_with_error(mocker):
mock_send_commit_data = mocker.patch(
"codecov_cli.services.upload_completion.send_post_request",
return_value=RequestResult(
error=RequestError(
code="HTTP Error 403",
description="Permission denied",
params={},
),
warnings=[],
status_code=403,
text="Permission denied",
),
)
runner = CliRunner()
with runner.isolation() as outstreams:
> res = upload_completion_logic(
"commit_sha", "owner/repo", uuid.uuid4(), "service", None
)

.../services/upload_completion/test_upload_completion.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError
Testsuite:
tests.services.upload_completion.test_upload_completion::test_upload_completion_403

Test name:
pytest
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3a5f174080>

def test_upload_completion_403(mocker):
mocked_response = mocker.patch(
"codecov_cli.helpers.request.requests.post",
return_value=mocker.MagicMock(status_code=403, text="Permission denied"),
)
token = uuid.uuid4()
> res = upload_completion_logic("commit_sha", "owner/repo", token, "service", None)

.../services/upload_completion/test_upload_completion.py:102:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload_completion/init.py:23: in upload_completion_logic
log_warnings_and_errors_if_any(
codecov_cli/helpers/request.py:148: in log_warnings_and_errors_if_any
extra_log_attributes=dict(result=_sanitize_request_result(sending_result))
codecov_cli/helpers/request.py:170: in _sanitize_request_result
text_as_dict = json.loads(result.text)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/init.py:346: in loads
return _default_decoder.decode(s)
.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x7f3a61bc6600>
s = 'Permission denied', idx = 0

def raw_decode(self, s, idx=0):
"""Decode a JSON document from s (a str beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in s where the document ended.

This can be used to decode a JSON document from a string that may
have extraneous data at the end.

"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

.../hostedtoolcache/Python/3.12.4........./x64/lib/python3.12/json/decoder.py:355: JSONDecodeError

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 1 failed, 692 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 15 '24 19:08 github-actions[bot]

:x: 5 Tests Failed:

Tests completed Failed Passed Skipped
3475 5 3470 0
View the top 3 failed tests by shortest run time
api.temp.calculator.test_calculator test_divide
Stack Traces | 0.001s run time
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
api.temp.calculator.test_calculator test_divide
Stack Traces | 0.001s run time
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
api.temp.calculator.test_calculator test_divide
Stack Traces | 0.001s run time
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

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

codecov[bot] avatar Aug 15 '24 19:08 codecov[bot]

I'm kind of thinking this should go in the API side

thomasrockhu-codecov avatar Aug 15 '24 19:08 thomasrockhu-codecov

may as well write a test too

matt-codecov avatar Aug 15 '24 22:08 matt-codecov

:x: Failed Test Results:

Completed 695 tests with 1 failed, 694 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 695 tests with 1 failed, 694 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 695 tests with 1 failed, 694 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 695 tests with 1 failed, 694 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 695 tests with 1 failed, 694 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 695 tests with 1 failed, 694 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 695 tests with 1 failed, 694 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 695 tests with 1 failed, 694 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 695 tests with 1 failed, 694 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

:x: Failed Test Results:

Completed 695 tests with 1 failed, 694 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
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

github-actions[bot] avatar Aug 19 '24 19:08 github-actions[bot]

@thomasrockhu-codecov could you document why you decided not to mark the token as a secret using GitHub Actions workflow commands? That would prevent it from being printed out if leaked through other commands that follow the codecov-cli invocation.

webknjaz avatar Aug 22 '24 17:08 webknjaz