Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: collect additional params from cli usage #506

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

thomasrockhu-codecov
Copy link
Contributor

@thomasrockhu-codecov thomasrockhu-codecov commented Sep 20, 2024

Copy link

❌ Failed Test Results:

Completed 697 tests with 6 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.commands.test_process_test_results::test_process_test_results

Test name:
pytest
self = <MagicMock name='send_post_request' id='140599844288528'>, args = ()
kwargs = {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<det...whatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'}
expected = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
actual = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7fdff3d574c0>
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.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<details><summary>View the full list of failed tests</summary>\n\n
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters

Test name:
pytest
self = <test_upload_sender.TestUploadSender object at 0x7fdff3e246d0>
mocked_responses = <responses.RequestsMock object at 0x7fdff3dc87d0>
mocked_legacy_upload_endpoint = <Response(url='https://api.codecov..../upload/github/org::::.../reports/report_code/uploads' status=200 content_type='application/json' headers='null')>
mocked_storage_server = <Response(url='https://puturl.com/' status=200 content_type='text/plain' headers='null')>

def test_upload_sender_post_called_with_right_parameters(
self, mocked_responses, mocked_legacy_upload_endpoint, mocked_storage_server
):
headers = {"Authorization": f"token {random_token}"}

mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

> sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, random_token, **named_upload_data
)

tests/helpers/test_upload_sender.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/upload_sender.py:76: in send_upload_data
resp_from_codecov = send_post_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ()
kwargs = {'data': {'ci_service': 'ci_service', 'ci_url': 'build_url', 'cli_args': None, 'env': {}, ...}, 'headers': {'Authoriza...api.codecov..../upload/github/org::::.../reports/report_code/uploads'}
retry = 3

def wrapper(*args, **kwargs):
retry = 0
while retry < MAX_RETRIES:
try:
response = func(*args, **kwargs)
if response.status_code >= 500:
logger.warning(
f"Response status code was {response.status_code}.",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
raise RetryException
return response
except (
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
RetryException,
) as exp:
logger.warning(
"Request failed. Retrying",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
sleep(backoff_time(retry))
retry += 1
> raise Exception("Request failed after too many retries")
E Exception: Request failed after too many retries

codecov_cli/helpers/request.py:83: Exception
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters

Test name:
pytest
No failure message available
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters_tokenless

Test name:
pytest
self = <test_upload_sender.TestUploadSender object at 0x7fdff3e24b50>
mocked_responses = <responses.RequestsMock object at 0x7fdff38d1ed0>
mocked_legacy_upload_endpoint = <Response(url='https://api.codecov..../upload/github/org::::.../reports/report_code/uploads' status=200 content_type='application/json' headers='null')>
mocked_storage_server = <Response(url='https://puturl.com/' status=200 content_type='text/plain' headers='null')>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fdff38d3a10>

def test_upload_sender_post_called_with_right_parameters_tokenless(
self,
mocked_responses,
mocked_legacy_upload_endpoint,
mocked_storage_server,
mocker,
):
headers = {}

mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

> sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, None, **named_upload_data
)

tests/helpers/test_upload_sender.py:241:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/upload_sender.py:76: in send_upload_data
resp_from_codecov = send_post_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ()
kwargs = {'data': {'ci_service': 'ci_service', 'ci_url': 'build_url', 'cli_args': None, 'env': {}, ...}, 'headers': None, 'url'...api.codecov..../upload/github/org::::.../reports/report_code/uploads'}
retry = 3

def wrapper(*args, **kwargs):
retry = 0
while retry < MAX_RETRIES:
try:
response = func(*args, **kwargs)
if response.status_code >= 500:
logger.warning(
f"Response status code was {response.status_code}.",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
raise RetryException
return response
except (
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
RetryException,
) as exp:
logger.warning(
"Request failed. Retrying",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
sleep(backoff_time(retry))
retry += 1
> raise Exception("Request failed after too many retries")
E Exception: Request failed after too many retries

codecov_cli/helpers/request.py:83: Exception
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters_tokenless

Test name:
pytest
No failure message available

Copy link

❌ Failed Test Results:

Completed 697 tests with 6 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.commands.test_process_test_results::test_process_test_results

Test name:
pytest
self = <MagicMock name='send_post_request' id='139990909607696'>, args = ()
kwargs = {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<det...whatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'}
expected = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
actual = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f522c810e50>
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.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<details><summary>View the full list of failed tests</summary>\n\n
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters

Test name:
pytest
self = <test_upload_sender.TestUploadSender object at 0x7f522ca8baf0>
mocked_responses = <responses.RequestsMock object at 0x7f522c38fac0>
mocked_legacy_upload_endpoint = <Response(url='https://api.codecov..../upload/github/org::::.../reports/report_code/uploads' status=200 content_type='application/json' headers='null')>
mocked_storage_server = <Response(url='https://puturl.com/' status=200 content_type='text/plain' headers='null')>

def test_upload_sender_post_called_with_right_parameters(
self, mocked_responses, mocked_legacy_upload_endpoint, mocked_storage_server
):
headers = {"Authorization": f"token {random_token}"}

mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

> sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, random_token, **named_upload_data
)

tests/helpers/test_upload_sender.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/upload_sender.py:76: in send_upload_data
resp_from_codecov = send_post_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ()
kwargs = {'data': {'ci_service': 'ci_service', 'ci_url': 'build_url', 'cli_args': None, 'env': {}, ...}, 'headers': {'Authoriza...api.codecov..../upload/github/org::::.../reports/report_code/uploads'}
retry = 3

def wrapper(*args, **kwargs):
retry = 0
while retry < MAX_RETRIES:
try:
response = func(*args, **kwargs)
if response.status_code >= 500:
logger.warning(
f"Response status code was {response.status_code}.",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
raise RetryException
return response
except (
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
RetryException,
) as exp:
logger.warning(
"Request failed. Retrying",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
sleep(backoff_time(retry))
retry += 1
> raise Exception("Request failed after too many retries")
E Exception: Request failed after too many retries

codecov_cli/helpers/request.py:83: Exception
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters

Test name:
pytest
No failure message available
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters_tokenless

Test name:
pytest
self = <test_upload_sender.TestUploadSender object at 0x7f522cc12fa0>
mocked_responses = <responses.RequestsMock object at 0x7f522c8ad6d0>
mocked_legacy_upload_endpoint = <Response(url='https://api.codecov..../upload/github/org::::.../reports/report_code/uploads' status=200 content_type='application/json' headers='null')>
mocked_storage_server = <Response(url='https://puturl.com/' status=200 content_type='text/plain' headers='null')>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f522c8ad700>

def test_upload_sender_post_called_with_right_parameters_tokenless(
self,
mocked_responses,
mocked_legacy_upload_endpoint,
mocked_storage_server,
mocker,
):
headers = {}

mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

> sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, None, **named_upload_data
)

tests/helpers/test_upload_sender.py:241:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/upload_sender.py:76: in send_upload_data
resp_from_codecov = send_post_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ()
kwargs = {'data': {'ci_service': 'ci_service', 'ci_url': 'build_url', 'cli_args': None, 'env': {}, ...}, 'headers': None, 'url'...api.codecov..../upload/github/org::::.../reports/report_code/uploads'}
retry = 3

def wrapper(*args, **kwargs):
retry = 0
while retry < MAX_RETRIES:
try:
response = func(*args, **kwargs)
if response.status_code >= 500:
logger.warning(
f"Response status code was {response.status_code}.",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
raise RetryException
return response
except (
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
RetryException,
) as exp:
logger.warning(
"Request failed. Retrying",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
sleep(backoff_time(retry))
retry += 1
> raise Exception("Request failed after too many retries")
E Exception: Request failed after too many retries

codecov_cli/helpers/request.py:83: Exception
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters_tokenless

Test name:
pytest
No failure message available

Copy link

❌ Failed Test Results:

Completed 697 tests with 6 failed, 691 passed and 0 skipped.

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

Test name:
pytest
self = <MagicMock name='send_post_request' id='139743548122016'>, args = ()
kwargs = {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<det...whatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'}
expected = ((), {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped....hatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'})
actual = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f1894839d30>
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.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<details><summary>View the full list of failed tests</summary>\n\n
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters

Test name:
pytest
self = <test_upload_sender.TestUploadSender object at 0x7f1894cf89a0>
mocked_responses = <responses.RequestsMock object at 0x7f189489fcd0>
mocked_legacy_upload_endpoint = <Response(url='https://api.codecov..../upload/github/org::::.../reports/report_code/uploads' status=200 content_type='application/json' headers='null')>
mocked_storage_server = <Response(url='https://puturl.com/' status=200 content_type='text/plain' headers='null')>

def test_upload_sender_post_called_with_right_parameters(
self, mocked_responses, mocked_legacy_upload_endpoint, mocked_storage_server
):
headers = {"Authorization": f"token {random_token}"}

mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

> sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, random_token, **named_upload_data
)

tests/helpers/test_upload_sender.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/upload_sender.py:76: in send_upload_data
resp_from_codecov = send_post_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ()
kwargs = {'data': {'ci_service': 'ci_service', 'ci_url': 'build_url', 'cli_args': None, 'env': {}, ...}, 'headers': {'Authoriza...api.codecov..../upload/github/org::::.../reports/report_code/uploads'}
retry = 3

def wrapper(*args, **kwargs):
retry = 0
while retry < MAX_RETRIES:
try:
response = func(*args, **kwargs)
if response.status_code >= 500:
logger.warning(
f"Response status code was {response.status_code}.",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
raise RetryException
return response
except (
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
RetryException,
) as exp:
logger.warning(
"Request failed. Retrying",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
sleep(backoff_time(retry))
retry += 1
> raise Exception("Request failed after too many retries")
E Exception: Request failed after too many retries

codecov_cli/helpers/request.py:83: Exception
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters

Test name:
pytest
No failure message available
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters_tokenless

Test name:
pytest
self = <test_upload_sender.TestUploadSender object at 0x7f1894bc3100>
mocked_responses = <responses.RequestsMock object at 0x7f1894a35eb0>
mocked_legacy_upload_endpoint = <Response(url='https://api.codecov..../upload/github/org::::.../reports/report_code/uploads' status=200 content_type='application/json' headers='null')>
mocked_storage_server = <Response(url='https://puturl.com/' status=200 content_type='text/plain' headers='null')>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f18949c38b0>

def test_upload_sender_post_called_with_right_parameters_tokenless(
self,
mocked_responses,
mocked_legacy_upload_endpoint,
mocked_storage_server,
mocker,
):
headers = {}

mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

> sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, None, **named_upload_data
)

tests/helpers/test_upload_sender.py:241:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/upload_sender.py:76: in send_upload_data
resp_from_codecov = send_post_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ()
kwargs = {'data': {'ci_service': 'ci_service', 'ci_url': 'build_url', 'cli_args': None, 'env': {}, ...}, 'headers': None, 'url'...api.codecov..../upload/github/org::::.../reports/report_code/uploads'}
retry = 3

def wrapper(*args, **kwargs):
retry = 0
while retry < MAX_RETRIES:
try:
response = func(*args, **kwargs)
if response.status_code >= 500:
logger.warning(
f"Response status code was {response.status_code}.",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
raise RetryException
return response
except (
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
RetryException,
) as exp:
logger.warning(
"Request failed. Retrying",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
sleep(backoff_time(retry))
retry += 1
> raise Exception("Request failed after too many retries")
E Exception: Request failed after too many retries

codecov_cli/helpers/request.py:83: Exception
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters_tokenless

Test name:
pytest
No failure message available
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

Copy link

❌ Failed Test Results:

Completed 697 tests with 6 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.commands.test_process_test_results::test_process_test_results

Test name:
pytest
self = <MagicMock name='send_post_request' id='139856935373936'>, args = ()
kwargs = {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<det...whatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'}
expected = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
actual = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f32fb1e76d0>
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.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<details><summary>View the full list of failed tests</summary>\n\n
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters

Test name:
pytest
self = <test_upload_sender.TestUploadSender object at 0x7f32fba249a0>
mocked_responses = <responses.RequestsMock object at 0x7f32fac72bc0>
mocked_legacy_upload_endpoint = <Response(url='https://api.codecov..../upload/github/org::::.../reports/report_code/uploads' status=200 content_type='application/json' headers='null')>
mocked_storage_server = <Response(url='https://puturl.com/' status=200 content_type='text/plain' headers='null')>

def test_upload_sender_post_called_with_right_parameters(
self, mocked_responses, mocked_legacy_upload_endpoint, mocked_storage_server
):
headers = {"Authorization": f"token {random_token}"}

mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

> sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, random_token, **named_upload_data
)

tests/helpers/test_upload_sender.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/upload_sender.py:76: in send_upload_data
resp_from_codecov = send_post_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ()
kwargs = {'data': {'ci_service': 'ci_service', 'ci_url': 'build_url', 'cli_args': None, 'env': {}, ...}, 'headers': {'Authoriza...api.codecov..../upload/github/org::::.../reports/report_code/uploads'}
retry = 3

def wrapper(*args, **kwargs):
retry = 0
while retry < MAX_RETRIES:
try:
response = func(*args, **kwargs)
if response.status_code >= 500:
logger.warning(
f"Response status code was {response.status_code}.",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
raise RetryException
return response
except (
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
RetryException,
) as exp:
logger.warning(
"Request failed. Retrying",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
sleep(backoff_time(retry))
retry += 1
> raise Exception("Request failed after too many retries")
E Exception: Request failed after too many retries

codecov_cli/helpers/request.py:83: Exception
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters

Test name:
pytest
No failure message available
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters_tokenless

Test name:
pytest
self = <test_upload_sender.TestUploadSender object at 0x7f32fba26e00>
mocked_responses = <responses.RequestsMock object at 0x7f32fac91210>
mocked_legacy_upload_endpoint = <Response(url='https://api.codecov..../upload/github/org::::.../reports/report_code/uploads' status=200 content_type='application/json' headers='null')>
mocked_storage_server = <Response(url='https://puturl.com/' status=200 content_type='text/plain' headers='null')>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7f32fac90fd0>

def test_upload_sender_post_called_with_right_parameters_tokenless(
self,
mocked_responses,
mocked_legacy_upload_endpoint,
mocked_storage_server,
mocker,
):
headers = {}

mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

> sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, None, **named_upload_data
)

tests/helpers/test_upload_sender.py:241:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/upload_sender.py:76: in send_upload_data
resp_from_codecov = send_post_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ()
kwargs = {'data': {'ci_service': 'ci_service', 'ci_url': 'build_url', 'cli_args': None, 'env': {}, ...}, 'headers': None, 'url'...api.codecov..../upload/github/org::::.../reports/report_code/uploads'}
retry = 3

def wrapper(*args, **kwargs):
retry = 0
while retry < MAX_RETRIES:
try:
response = func(*args, **kwargs)
if response.status_code >= 500:
logger.warning(
f"Response status code was {response.status_code}.",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
raise RetryException
return response
except (
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
RetryException,
) as exp:
logger.warning(
"Request failed. Retrying",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
sleep(backoff_time(retry))
retry += 1
> raise Exception("Request failed after too many retries")
E Exception: Request failed after too many retries

codecov_cli/helpers/request.py:83: Exception
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters_tokenless

Test name:
pytest
No failure message available

Copy link

❌ Failed Test Results:

Completed 697 tests with 6 failed, 691 passed and 0 skipped.

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

Test name:
pytest
self = <MagicMock name='send_post_request' id='140354670700896'>, args = ()
kwargs = {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<det...whatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'}
expected = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
actual = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7fa6de41e3e0>
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.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<details><summary>View the full list of failed tests</summary>\n\n
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters

Test name:
pytest
self = <test_upload_sender.TestUploadSender object at 0x7fa6de70b950>
mocked_responses = <responses.RequestsMock object at 0x7fa6de466930>
mocked_legacy_upload_endpoint = <Response(url='https://api.codecov..../upload/github/org::::.../reports/report_code/uploads' status=200 content_type='application/json' headers='null')>
mocked_storage_server = <Response(url='https://puturl.com/' status=200 content_type='text/plain' headers='null')>

def test_upload_sender_post_called_with_right_parameters(
self, mocked_responses, mocked_legacy_upload_endpoint, mocked_storage_server
):
headers = {"Authorization": f"token {random_token}"}

mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

> sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, random_token, **named_upload_data
)

tests/helpers/test_upload_sender.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/upload_sender.py:76: in send_upload_data
resp_from_codecov = send_post_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ()
kwargs = {'data': {'ci_service': 'ci_service', 'ci_url': 'build_url', 'cli_args': None, 'env': {}, ...}, 'headers': {'Authoriza...api.codecov..../upload/github/org::::.../reports/report_code/uploads'}
retry = 3

def wrapper(*args, **kwargs):
retry = 0
while retry < MAX_RETRIES:
try:
response = func(*args, **kwargs)
if response.status_code >= 500:
logger.warning(
f"Response status code was {response.status_code}.",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
raise RetryException
return response
except (
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
RetryException,
) as exp:
logger.warning(
"Request failed. Retrying",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
sleep(backoff_time(retry))
retry += 1
> raise Exception("Request failed after too many retries")
E Exception: Request failed after too many retries

codecov_cli/helpers/request.py:83: Exception
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters

Test name:
pytest
No failure message available
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters_tokenless

Test name:
pytest
self = <test_upload_sender.TestUploadSender object at 0x7fa6de70bb60>
mocked_responses = <responses.RequestsMock object at 0x7fa6de4c69f0>
mocked_legacy_upload_endpoint = <Response(url='https://api.codecov..../upload/github/org::::.../reports/report_code/uploads' status=200 content_type='application/json' headers='null')>
mocked_storage_server = <Response(url='https://puturl.com/' status=200 content_type='text/plain' headers='null')>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fa6de4c6960>

def test_upload_sender_post_called_with_right_parameters_tokenless(
self,
mocked_responses,
mocked_legacy_upload_endpoint,
mocked_storage_server,
mocker,
):
headers = {}

mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

> sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, None, **named_upload_data
)

tests/helpers/test_upload_sender.py:241:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.../services/upload/upload_sender.py:76: in send_upload_data
resp_from_codecov = send_post_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ()
kwargs = {'data': {'ci_service': 'ci_service', 'ci_url': 'build_url', 'cli_args': None, 'env': {}, ...}, 'headers': None, 'url'...api.codecov..../upload/github/org::::.../reports/report_code/uploads'}
retry = 3

def wrapper(*args, **kwargs):
retry = 0
while retry < MAX_RETRIES:
try:
response = func(*args, **kwargs)
if response.status_code >= 500:
logger.warning(
f"Response status code was {response.status_code}.",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
raise RetryException
return response
except (
requests.exceptions.ConnectionError,
requests.exceptions.Timeout,
RetryException,
) as exp:
logger.warning(
"Request failed. Retrying",
extra=dict(extra_log_attributes=dict(retry=retry)),
)
sleep(backoff_time(retry))
retry += 1
> raise Exception("Request failed after too many retries")
E Exception: Request failed after too many retries

codecov_cli/helpers/request.py:83: Exception
Testsuite:
tests.helpers.test_upload_sender.TestUploadSender::test_upload_sender_post_called_with_right_parameters_tokenless

Test name:
pytest
No failure message available
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

Copy link

❌ Failed Test Results:

Completed 695 tests with 2 failed, 693 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_process_test_results::test_process_test_results

Test name:
pytest
self = <MagicMock name='send_post_request' id='139870749523920'>, args = ()
kwargs = {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<det...whatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'}
expected = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
actual = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f3632663f60>
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.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<details><summary>View the full list of failed tests</summary>\n\n

Copy link

❌ Failed Test Results:

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

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

Test name:
pytest
self = <MagicMock name='send_post_request' id='139973061377040'>, args = ()
kwargs = {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<det...whatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'}
expected = ((), {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped....hatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'})
actual = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f4e04938d30>
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.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<details><summary>View the full list of failed tests</summary>\n\n
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

Copy link

❌ Failed Test Results:

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

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

Test name:
pytest
self = <MagicMock name='send_post_request' id='140006708031104'>, args = ()
kwargs = {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<det...whatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'}
expected = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
actual = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f55da294e50>
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.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<details><summary>View the full list of failed tests</summary>\n\n
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

Copy link

❌ Failed Test Results:

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

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

Test name:
pytest
self = <MagicMock name='send_post_request' id='139846597642128'>, args = ()
kwargs = {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<det...whatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'}
expected = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
actual = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f3092d136d0>
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.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<details><summary>View the full list of failed tests</summary>\n\n
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

Copy link

❌ Failed Test Results:

Completed 695 tests with 2 failed, 693 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_process_test_results::test_process_test_results

Test name:
pytest
self = <MagicMock name='send_post_request' id='139642197813168'>, args = ()
kwargs = {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<det...whatever', 'X-GitHub-Api-Version': '2022-11-28'}, 'url': 'https://api.github..../issues/pull/comments'}
expected = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
actual = call(url='https://api.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \n...rs={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f00fb906480>
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.github..../issues/pull/comments', data={'body': '### :x: Failed Test Results: \nCompleted 4 tests with 1 failed, 3 passed and 0 skipped.\n<details><summary>View the full list of failed tests</summary>\n\n

Copy link

❌ 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

4 similar comments
Copy link

❌ 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

Copy link

❌ 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

Copy link

❌ 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

Copy link

❌ 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

Copy link

codecov bot commented Sep 20, 2024

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
3485 5 3480 0
View the full list of 3 ❄️ flaky tests
api.temp.calculator.test_calculator test_divide

Flake rate in main: 100.00% (Passed 0 times, Failed 18 times)

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

Flake rate in main: 100.00% (Passed 0 times, Failed 20 times)

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

Flake rate in main: 100.00% (Passed 0 times, Failed 22 times)

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

Copy link

❌ Failed Test Results:

Completed 697 tests with 1 failed, 696 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

4 similar comments
Copy link

❌ Failed Test Results:

Completed 697 tests with 1 failed, 696 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

Copy link

❌ Failed Test Results:

Completed 697 tests with 1 failed, 696 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

Copy link

❌ Failed Test Results:

Completed 697 tests with 1 failed, 696 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

Copy link

❌ Failed Test Results:

Completed 697 tests with 1 failed, 696 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

Copy link
Contributor

@joseph-sentry joseph-sentry left a comment

Choose a reason for hiding this comment

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

seems ok to me, it feels bad that we have to edit each file 1 by 1 to add such a thing but i guess it makes sense since each one passes different data to its post request

i still think we should at least remove folders_to_ignore since we wouldn't ever have access to that information anyways, but i trust your judgement

@thomasrockhu-codecov thomasrockhu-codecov merged commit 6269e67 into main Sep 23, 2024
22 checks passed
@thomasrockhu-codecov thomasrockhu-codecov deleted the th/add-telemetry branch September 23, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants