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

feat: support new tokenless protocol

Open joseph-sentry opened this issue 1 year ago • 9 comments

it's no longer necessary for us to use the X-Tokenless header to provide tokenless information to the API, the information in the regular request bodies will suffice.

joseph-sentry avatar May 22 '24 18:05 joseph-sentry

:x: Failed Test Results:

Completed 693 tests with 2 failed, 691 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.services.commit.test_commit_service::test_commit_sender_with_forked_repo

Test name:
pytest
self = <MagicMock name='send_post_request' id='140684238398368'>, args = ()
kwargs = {'data': {'branch': 'user_forked_repo/codecov-cli:branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha',...epo/codecov-cli', 'X-Tokenless-PR': '1'}, 'url': 'https://api.codecov..../upload/github/codecov::::codecov-cli/commits'}
expected = call(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'paren...'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
actual = call(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7ff399f28670>
cause = None

def assert_called_with(self, /, *args, **kwargs):
"""assert that the last call was made with the specified arguments.

Raises an AssertionError if the args and keyword args passed in are
different to the last call to the mock."""
if self.call_args is None:
expected = self._format_mock_call_signature(args, kwargs)
actual = 'not called.'
error_message = ('expected call not found.\nExpected: %s\nActual: %s'
% (expected, actual))
raise AssertionError(error_message)

def _error_message():
msg = self._format_mock_failure_message(args, kwargs)
return msg
expected = self._call_matcher(_Call((args, kwargs), two=True))
actual = self._call_matcher(self.call_args)
if actual != expected:
cause = expected if isinstance(expected, Exception) else None
> raise AssertionError(_error_message()) from cause
E AssertionError: expected call not found.
E Expected: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
E Actual: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)

.../hostedtoolcache/Python/3.9.19.../x64/lib/python3.9/unittest/mock.py:907: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7ff39a042940>

def test_commit_sender_with_forked_repo(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.send_post_request",
return_value=mocker.MagicMock(status_code=200, text="success"),
)

def mock_request(*args, headers={}, **kwargs):
assert headers["X-GitHub-Api-Version"] == "2022-11-28"
res = {
"url": "https://api.github..../codecov-cli/pulls/1",
"head": {
"sha": "123",
"label": "codecov-cli:branch",
"ref": "branch",
"repo": {"full_name": "user_forked_repo/codecov-cli"},
},
"base": {
"sha": "123",
"label": "codecov-cli:main",
"ref": "main",
"repo": {"full_name": "codecov/codecov-cli"},
},
}
response = Response()
response.status_code = 200
response._content = json.dumps(res).encode("utf-8")
return response

mocker.patch.object(
requests,
"get",
side_effect=mock_request,
)
res = send_commit_data(
"commit_sha",
"parent_sha",
"1",
"branch",
"codecov::::codecov-cli",
None,
"github",
None,
)
> mocked_response.assert_called_with(
url="https://api.codecov..../upload/github/codecov::::codecov-cli/commits",
data={
"commitid": "commit_sha",
"parent_commit_id": "parent_sha",
"pullid": "1",
"branch": "user_forked_repo/codecov-cli:branch",
},
headers={"X-Tokenless": "user_forked_repo/codecov-cli", "X-Tokenless-PR": "1"},
)
E AssertionError: expected call not found.
E Expected: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
E Actual: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)
E
E pytest introspection follows:
E
E Kwargs:
E assert {'data': {'br...-cli/commits'} == {'data': {'br...-cli/commits'}
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'data': {'branch': 'branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1'}} != {'data': {'branch': 'user_forked_repo/codecov-cli:branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1'}}
E {'headers': None} != {'headers': {'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'}}
E Full diff:
E {
E - 'data': {'branch': 'user_forked_repo/codecov-cli:branch',
E + 'data': {'branch': 'branch',
E 'commitid': 'commit_sha',
E 'parent_commit_id': 'parent_sha',
E 'pullid': '1'},
E + 'headers': None,
E - 'headers': {'X-Tokenless': 'user_forked_repo/codecov-cli',
E - 'X-Tokenless-PR': '1'},
E 'url': 'https://api.codecov..../upload/github/codecov::::codecov-cli/commits',
E }

.../services/commit/test_commit_service.py:190: AssertionError

github-actions[bot] avatar May 22 '24 18:05 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 2 failed, 691 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.services.commit.test_commit_service::test_commit_sender_with_forked_repo

Test name:
pytest
self = <MagicMock name='send_post_request' id='139891383112912'>, args = ()
kwargs = {'data': {'branch': 'user_forked_repo/codecov-cli:branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha',...epo/codecov-cli', 'X-Tokenless-PR': '1'}, 'url': 'https://api.codecov..../upload/github/codecov::::codecov-cli/commits'}
expected = call(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'paren...'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
actual = call(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f3b00319a80>
cause = None

def assert_called_with(self, /, *args, **kwargs):
"""assert that the last call was made with the specified arguments.

Raises an AssertionError if the args and keyword args passed in are
different to the last call to the mock."""
if self.call_args is None:
expected = self._format_mock_call_signature(args, kwargs)
actual = 'not called.'
error_message = ('expected call not found.\nExpected: %s\n Actual: %s'
% (expected, actual))
raise AssertionError(error_message)

def _error_message():
msg = self._format_mock_failure_message(args, kwargs)
return msg
expected = self._call_matcher(_Call((args, kwargs), two=True))
actual = self._call_matcher(self.call_args)
if actual != expected:
cause = expected if isinstance(expected, Exception) else None
> raise AssertionError(_error_message()) from cause
E AssertionError: expected call not found.
E Expected: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
E Actual: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)

.../hostedtoolcache/Python/3.11.9.../x64/lib/python3.11/unittest/mock.py:939: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7f3b0033fa10>

def test_commit_sender_with_forked_repo(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.send_post_request",
return_value=mocker.MagicMock(status_code=200, text="success"),
)

def mock_request(*args, headers={}, **kwargs):
assert headers["X-GitHub-Api-Version"] == "2022-11-28"
res = {
"url": "https://api.github..../codecov-cli/pulls/1",
"head": {
"sha": "123",
"label": "codecov-cli:branch",
"ref": "branch",
"repo": {"full_name": "user_forked_repo/codecov-cli"},
},
"base": {
"sha": "123",
"label": "codecov-cli:main",
"ref": "main",
"repo": {"full_name": "codecov/codecov-cli"},
},
}
response = Response()
response.status_code = 200
response._content = json.dumps(res).encode("utf-8")
return response

mocker.patch.object(
requests,
"get",
side_effect=mock_request,
)
res = send_commit_data(
"commit_sha",
"parent_sha",
"1",
"branch",
"codecov::::codecov-cli",
None,
"github",
None,
)
> mocked_response.assert_called_with(
url="https://api.codecov..../upload/github/codecov::::codecov-cli/commits",
data={
"commitid": "commit_sha",
"parent_commit_id": "parent_sha",
"pullid": "1",
"branch": "user_forked_repo/codecov-cli:branch",
},
headers={"X-Tokenless": "user_forked_repo/codecov-cli", "X-Tokenless-PR": "1"},
)
E AssertionError: expected call not found.
E Expected: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
E Actual: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)
E
E pytest introspection follows:
E
E Kwargs:
E assert {'data': {'br...-cli/commits'} == {'data': {'br...-cli/commits'}
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'headers': None} != {'headers': {'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'}}
E {'data': {'branch': 'branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1'}} != {'data': {'branch': 'user_forked_repo/codecov-cli:branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1'}}
E Full diff:
E {
E - 'data': {'branch': 'user_forked_repo/codecov-cli:branch',
E + 'data': {'branch': 'branch',
E 'commitid': 'commit_sha',
E 'parent_commit_id': 'parent_sha',
E 'pullid': '1'},
E + 'headers': None,
E - 'headers': {'X-Tokenless': 'user_forked_repo/codecov-cli',
E - 'X-Tokenless-PR': '1'},
E 'url': 'https://api.codecov..../upload/github/codecov::::codecov-cli/commits',
E }

.../services/commit/test_commit_service.py:190: AssertionError

github-actions[bot] avatar May 22 '24 18:05 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 2 failed, 691 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
tests.services.commit.test_commit_service::test_commit_sender_with_forked_repo

Test name:
pytest
self = <MagicMock name='send_post_request' id='140494929927040'>, args = ()
kwargs = {'data': {'branch': 'user_forked_repo/codecov-cli:branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha',...epo/codecov-cli', 'X-Tokenless-PR': '1'}, 'url': 'https://api.codecov..../upload/github/codecov::::codecov-cli/commits'}
expected = ((), {'data': {'branch': 'user_forked_repo/codecov-cli:branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_...po/codecov-cli', 'X-Tokenless-PR': '1'}, 'url': 'https://api.codecov..../upload/github/codecov::::codecov-cli/commits'})
actual = call(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7fc786332160>
cause = None

def assert_called_with(self, /, *args, **kwargs):
"""assert that the last call was made with the specified arguments.

Raises an AssertionError if the args and keyword args passed in are
different to the last call to the mock."""
if self.call_args is None:
expected = self._format_mock_call_signature(args, kwargs)
actual = 'not called.'
error_message = ('expected call not found.\nExpected: %s\nActual: %s'
% (expected, actual))
raise AssertionError(error_message)

def _error_message():
msg = self._format_mock_failure_message(args, kwargs)
return msg
expected = self._call_matcher((args, kwargs))
actual = self._call_matcher(self.call_args)
if expected != actual:
cause = expected if isinstance(expected, Exception) else None
> raise AssertionError(_error_message()) from cause
E AssertionError: expected call not found.
E Expected: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
E Actual: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)

.../hostedtoolcache/Python/3.8.18.../x64/lib/python3.8/unittest/mock.py:913: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7fc7866ad370>

def test_commit_sender_with_forked_repo(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.send_post_request",
return_value=mocker.MagicMock(status_code=200, text="success"),
)

def mock_request(*args, headers={}, **kwargs):
assert headers["X-GitHub-Api-Version"] == "2022-11-28"
res = {
"url": "https://api.github..../codecov-cli/pulls/1",
"head": {
"sha": "123",
"label": "codecov-cli:branch",
"ref": "branch",
"repo": {"full_name": "user_forked_repo/codecov-cli"},
},
"base": {
"sha": "123",
"label": "codecov-cli:main",
"ref": "main",
"repo": {"full_name": "codecov/codecov-cli"},
},
}
response = Response()
response.status_code = 200
response._content = json.dumps(res).encode("utf-8")
return response

mocker.patch.object(
requests,
"get",
side_effect=mock_request,
)
res = send_commit_data(
"commit_sha",
"parent_sha",
"1",
"branch",
"codecov::::codecov-cli",
None,
"github",
None,
)
> mocked_response.assert_called_with(
url="https://api.codecov..../upload/github/codecov::::codecov-cli/commits",
data={
"commitid": "commit_sha",
"parent_commit_id": "parent_sha",
"pullid": "1",
"branch": "user_forked_repo/codecov-cli:branch",
},
headers={"X-Tokenless": "user_forked_repo/codecov-cli", "X-Tokenless-PR": "1"},
)
E AssertionError: expected call not found.
E Expected: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
E Actual: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)
E
E pytest introspection follows:
E
E Kwargs:
E assert {'data': {'br...-cli/commits'} == {'data': {'br...-cli/commits'}
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'headers': None} != {'headers': {'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'}}
E {'data': {'branch': 'branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1'}} != {'data': {'branch': 'user_forked_repo/codecov-cli:branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1'}}
E Full diff:
E {
E - 'data': {'branch': 'user_forked_repo/codecov-cli:branch',
E + 'data': {'branch': 'branch',
E 'commitid': 'commit_sha',
E 'parent_commit_id': 'parent_sha',
E 'pullid': '1'},
E + 'headers': None,
E - 'headers': {'X-Tokenless': 'user_forked_repo/codecov-cli',
E - 'X-Tokenless-PR': '1'},
E 'url': 'https://api.codecov..../upload/github/codecov::::codecov-cli/commits',
E }

.../services/commit/test_commit_service.py:190: AssertionError
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 May 22 '24 18:05 github-actions[bot]

:x: Failed Test Results:

Completed 693 tests with 2 failed, 691 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.services.commit.test_commit_service::test_commit_sender_with_forked_repo

Test name:
pytest
self = <MagicMock name='send_post_request' id='140473859483072'>, args = ()
kwargs = {'data': {'branch': 'user_forked_repo/codecov-cli:branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha',...epo/codecov-cli', 'X-Tokenless-PR': '1'}, 'url': 'https://api.codecov..../upload/github/codecov::::codecov-cli/commits'}
expected = call(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'paren...'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
actual = call(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7fc29e7a7370>
cause = None

def assert_called_with(self, /, *args, **kwargs):
"""assert that the last call was made with the specified arguments.

Raises an AssertionError if the args and keyword args passed in are
different to the last call to the mock."""
if self.call_args is None:
expected = self._format_mock_call_signature(args, kwargs)
actual = 'not called.'
error_message = ('expected call not found.\nExpected: %s\nActual: %s'
% (expected, actual))
raise AssertionError(error_message)

def _error_message():
msg = self._format_mock_failure_message(args, kwargs)
return msg
expected = self._call_matcher(_Call((args, kwargs), two=True))
actual = self._call_matcher(self.call_args)
if actual != expected:
cause = expected if isinstance(expected, Exception) else None
> raise AssertionError(_error_message()) from cause
E AssertionError: expected call not found.
E Expected: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
E Actual: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)

.../hostedtoolcache/Python/3.10.14.../x64/lib/python3.10/unittest/mock.py:929: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7fc29e72ec20>

def test_commit_sender_with_forked_repo(mocker):
mocked_response = mocker.patch(
"codecov_cli.services.commit.send_post_request",
return_value=mocker.MagicMock(status_code=200, text="success"),
)

def mock_request(*args, headers={}, **kwargs):
assert headers["X-GitHub-Api-Version"] == "2022-11-28"
res = {
"url": "https://api.github..../codecov-cli/pulls/1",
"head": {
"sha": "123",
"label": "codecov-cli:branch",
"ref": "branch",
"repo": {"full_name": "user_forked_repo/codecov-cli"},
},
"base": {
"sha": "123",
"label": "codecov-cli:main",
"ref": "main",
"repo": {"full_name": "codecov/codecov-cli"},
},
}
response = Response()
response.status_code = 200
response._content = json.dumps(res).encode("utf-8")
return response

mocker.patch.object(
requests,
"get",
side_effect=mock_request,
)
res = send_commit_data(
"commit_sha",
"parent_sha",
"1",
"branch",
"codecov::::codecov-cli",
None,
"github",
None,
)
> mocked_response.assert_called_with(
url="https://api.codecov..../upload/github/codecov::::codecov-cli/commits",
data={
"commitid": "commit_sha",
"parent_commit_id": "parent_sha",
"pullid": "1",
"branch": "user_forked_repo/codecov-cli:branch",
},
headers={"X-Tokenless": "user_forked_repo/codecov-cli", "X-Tokenless-PR": "1"},
)
E AssertionError: expected call not found.
E Expected: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'user_forked_repo/codecov-cli:branch'}, headers={'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'})
E Actual: send_post_request(url='https://api.codecov..../upload/github/codecov::::codecov-cli/commits', data={'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1', 'branch': 'branch'}, headers=None)
E
E pytest introspection follows:
E
E Kwargs:
E assert {'data': {'br...-cli/commits'} == {'data': {'br...-cli/commits'}
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'headers': None} != {'headers': {'X-Tokenless': 'user_forked_repo/codecov-cli', 'X-Tokenless-PR': '1'}}
E {'data': {'branch': 'branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1'}} != {'data': {'branch': 'user_forked_repo/codecov-cli:branch', 'commitid': 'commit_sha', 'parent_commit_id': 'parent_sha', 'pullid': '1'}}
E Full diff:
E {
E - 'data': {'branch': 'user_forked_repo/codecov-cli:branch',
E + 'data': {'branch': 'branch',
E 'commitid': 'commit_sha',
E 'parent_commit_id': 'parent_sha',
E 'pullid': '1'},
E + 'headers': None,
E - 'headers': {'X-Tokenless': 'user_forked_repo/codecov-cli',
E - 'X-Tokenless-PR': '1'},
E 'url': 'https://api.codecov..../upload/github/codecov::::codecov-cli/commits',
E }

.../services/commit/test_commit_service.py:190: AssertionError

github-actions[bot] avatar May 22 '24 18:05 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 May 22 '24 18:05 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 May 22 '24 18:05 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 May 22 '24 18:05 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 May 22 '24 18:05 github-actions[bot]

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

:x: Failed Test Results:

Completed 3455 tests with 5 failed, 3450 passed and 0 skipped.

View the full list of failed tests
Test Description Failure message
Testsuite:
pytest

Test name:
api.temp.calculator.test_calculator::test_divide

Envs:
- python3.8
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:
pytest

Test name:
api.temp.calculator.test_calculator::test_divide

Envs:
- python3.9
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:
pytest

Test name:
api.temp.calculator.test_calculator::test_divide

Envs:
- python3.12
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:
pytest

Test name:
api.temp.calculator.test_calculator::test_divide

Envs:
- python3.10
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:
pytest

Test name:
api.temp.calculator.test_calculator::test_divide

Envs:
- python3.11
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

codecov[bot] avatar May 22 '24 18:05 codecov[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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 03 '24 15:06 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 03 '24 15:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 04 '24 14:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 04 '24 14:06 github-actions[bot]

fixes https://github.com/codecov/codecov-action/issues/1416

thomasrockhu-codecov avatar Jun 05 '24 11:06 thomasrockhu-codecov

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 06 '24 20:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 06 '24 20:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 10:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 10:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 13:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 13:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 13:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 20:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 20:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 20:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 21:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 21:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 21:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 21:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 17 '24 21:06 github-actions[bot]

:x: Failed Test Results:

Completed 691 tests with 1 failed, 690 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():
&gt; assert Calculator.divide(1, 2) == 0.5
E assert 1.0 == 0.5
E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)
E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide
.../temp/calculator/test_calculator.py:30: AssertionError

github-actions[bot] avatar Jun 18 '24 14:06 github-actions[bot]