Closed michelletran-codecov closed 1 month ago
Tests completed | Failed | Passed | Skipped |
---|---|---|---|
3485 | 5 | 3480 | 0 |
api.temp.calculator.test_calculator test_divide
Stack Traces | 0.001s run time
> > ``` > def > test_divide(): > > assert Calculator.divide(1, 2) == 0.5 > E assert 1.0 == 0.5 > E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2) > E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide > .../temp/calculator/test_calculator.py:30: AssertionError > ```api.temp.calculator.test_calculator test_divide
Stack Traces | 0.001s run time
> > ``` > def > test_divide(): > > assert Calculator.divide(1, 2) == 0.5 > E assert 1.0 == 0.5 > E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2) > E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide > .../temp/calculator/test_calculator.py:30: AssertionError > ```
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard
Tests completed | Failed | Passed | Skipped |
---|---|---|---|
3465 | 5 | 3460 | 0 |
test_process_test_results
Stack Traces | 0.059s run time
> ``` > self = <MagicMock name='send_post_request' id='140277170110816'>, 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.com/repos/fake/repo/issues/pull/comments'} > expected = call(url='https://api.github.com/repos/fake/repo/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.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests su...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 0x7f94d2f46320> > 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.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > > /opt/hostedtoolcache/Python/3.10.15/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 0x7f94d2fcb910> > tmpdir = local('/tmp/pytest-of-runner/pytest-0/test_process_test_results0') > > def test_process_test_results( > mocker, > tmpdir, > ): > > tmp_file = tmpdir.mkdir("folder").join("summary.txt") > > mocker.patch.dict( > os.environ, > { > "GITHUB_REPOSITORY": "fake/repo", > "GITHUB_REF": "pull/fake/pull", > "GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename, > }, > ) > mocked_post = mocker.patch( > "codecov_cli.commands.process_test_results.send_post_request", > return_value=RequestResult( > status_code=200, error=None, warnings=[], text="yay it worked" > ), > ) > runner = CliRunner() > result = runner.invoke( > cli, > [ > "process-test-results", > "--provider-token", > "whatever", > "--file", > "samples/junit.xml", > "--disable-search", > ], > obj={}, > ) > > assert result.exit_code == 0 > > > mocked_post.assert_called_with( > url="https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |", > "cli_args": { > "auto_load_params_from": None, > "codecov_yml_path": None, > "enterprise_url": None, > "verbose": False, > "version": f"cli-{__version__}", > "command": "process-test-results", > "provider_token": "whatever", > "disable_search": True, > "dir": os.getcwd(), > "exclude_folders": (), > }, > }, > headers={ > "Accept": "application/vnd.github+json", > "Authorization": "Bearer whatever", > "X-GitHub-Api-Version": "2022-11-28", > }, > ) > E AssertionError: expected call not found. > E Expected: send_post_request(url='https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E > E pytest introspection follows: > E > E Kwargs: > E assert {'data': {'bo...ull/comments'} == {'data': {'bo...ull/comments'} > E Omitting 2 identical items, use -vv to show > E Differing items: > E {'data': {'body': ':white_check_mark: All tests successful. No failed tests were found.\n:mega: Thoughts on this repor...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} != {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n<det...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} > E Full diff: > E { > E + 'data': {'body': ':white_check_mark: All tests successful. No failed tests ' > E - 'data': {'body': '### :x: Failed Test Results: \n' > E - 'Completed 4 tests with **`1 failed`**, 3 passed and 0 ' > E - 'skipped.\n' > E - '<details><summary>View the full list of failed ' > E - 'tests</summary>\n' > E - '\n' > E + 'were found.\n' > E ? +++++++++++ > E + ':mega: Thoughts on this report? [Let Codecov ' > E + 'know!](https://github.com/codecov/feedback/issues/304) | ' > E + 'Powered by [Codecov](https://about.codecov.io/)', > E - '| **Test Description** | **Failure message** |\n' > E - '| :-- | :-- |\n' > E - '| ' > E - '<pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test ' > E - 'name:<br>pytest<br></pre> | <pre>def<br> ' > E - 'test_divide():<br> &gt; assert ' > E - 'Calculator.divide(1, 2) == 0.5<br> E assert ' > E - '1.0 == 0.5<br> E + where 1.0 = ' > E - '&lt;function Calculator.divide at ' > E - '0x104c9eb90&gt;(1, 2)<br> E + where ' > E - '&lt;function Calculator.divide at 0x104c9eb90&gt; = ' > E - 'Calculator.divide<br> ' > E - '.../temp/calculator/test_calculator.py:30: ' > E - 'AssertionError</pre> |', > E 'cli_args': {'auto_load_params_from': None, > E 'codecov_yml_path': None, > E 'command': 'process-test-results', > E 'dir': '/home/runner/work/codecov-cli/codecov-cli', > E 'disable_search': True, > E 'enterprise_url': None, > E 'exclude_folders': (), > E 'provider_token': 'whatever', > E 'verbose': False, > E 'version': 'cli-0.7.5'}}, > E 'headers': {'Accept': 'application/vnd.github+json', > E 'Authorization': 'Bearer whatever', > E 'X-GitHub-Api-Version': '2022-11-28'}, > E 'url': 'https://api.github.com/repos/fake/repo/issues/pull/comments', > E } > > tests/commands/test_process_test_results.py:48: AssertionError > ```test_process_test_results
Stack Traces | 0.067s run time
> ``` > self = <MagicMock name='send_post_request' id='140517840210240'>, 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.com/repos/fake/repo/issues/pull/comments'} > expected = call(url='https://api.github.com/repos/fake/repo/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.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests su...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 0x7fccdbfaa670> > 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.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > > /opt/hostedtoolcache/Python/3.9.20/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 0x7fccdbf34e20> > tmpdir = local('/tmp/pytest-of-runner/pytest-0/test_process_test_results0') > > def test_process_test_results( > mocker, > tmpdir, > ): > > tmp_file = tmpdir.mkdir("folder").join("summary.txt") > > mocker.patch.dict( > os.environ, > { > "GITHUB_REPOSITORY": "fake/repo", > "GITHUB_REF": "pull/fake/pull", > "GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename, > }, > ) > mocked_post = mocker.patch( > "codecov_cli.commands.process_test_results.send_post_request", > return_value=RequestResult( > status_code=200, error=None, warnings=[], text="yay it worked" > ), > ) > runner = CliRunner() > result = runner.invoke( > cli, > [ > "process-test-results", > "--provider-token", > "whatever", > "--file", > "samples/junit.xml", > "--disable-search", > ], > obj={}, > ) > > assert result.exit_code == 0 > > > mocked_post.assert_called_with( > url="https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |", > "cli_args": { > "auto_load_params_from": None, > "codecov_yml_path": None, > "enterprise_url": None, > "verbose": False, > "version": f"cli-{__version__}", > "command": "process-test-results", > "provider_token": "whatever", > "disable_search": True, > "dir": os.getcwd(), > "exclude_folders": (), > }, > }, > headers={ > "Accept": "application/vnd.github+json", > "Authorization": "Bearer whatever", > "X-GitHub-Api-Version": "2022-11-28", > }, > ) > E AssertionError: expected call not found. > E Expected: send_post_request(url='https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E > E pytest introspection follows: > E > E Kwargs: > E assert {'data': {'bo...ull/comments'} == {'data': {'bo...ull/comments'} > E Omitting 2 identical items, use -vv to show > E Differing items: > E {'data': {'body': ':white_check_mark: All tests successful. No failed tests were found.\n:mega: Thoughts on this repor...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} != {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n<det...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} > E Full diff: > E { > E + 'data': {'body': ':white_check_mark: All tests successful. No failed tests ' > E - 'data': {'body': '### :x: Failed Test Results: \n' > E - 'Completed 4 tests with **`1 failed`**, 3 passed and 0 ' > E - 'skipped.\n' > E - '<details><summary>View the full list of failed ' > E - 'tests</summary>\n' > E - '\n' > E + 'were found.\n' > E ? +++++++++++ > E + ':mega: Thoughts on this report? [Let Codecov ' > E + 'know!](https://github.com/codecov/feedback/issues/304) | ' > E + 'Powered by [Codecov](https://about.codecov.io/)', > E - '| **Test Description** | **Failure message** |\n' > E - '| :-- | :-- |\n' > E - '| ' > E - '<pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test ' > E - 'name:<br>pytest<br></pre> | <pre>def<br> ' > E - 'test_divide():<br> &gt; assert ' > E - 'Calculator.divide(1, 2) == 0.5<br> E assert ' > E - '1.0 == 0.5<br> E + where 1.0 = ' > E - '&lt;function Calculator.divide at ' > E - '0x104c9eb90&gt;(1, 2)<br> E + where ' > E - '&lt;function Calculator.divide at 0x104c9eb90&gt; = ' > E - 'Calculator.divide<br> ' > E - '.../temp/calculator/test_calculator.py:30: ' > E - 'AssertionError</pre> |', > E 'cli_args': {'auto_load_params_from': None, > E 'codecov_yml_path': None, > E 'command': 'process-test-results', > E 'dir': '/home/runner/work/codecov-cli/codecov-cli', > E 'disable_search': True, > E 'enterprise_url': None, > E 'exclude_folders': (), > E 'provider_token': 'whatever', > E 'verbose': False, > E 'version': 'cli-0.7.5'}}, > E 'headers': {'Accept': 'application/vnd.github+json', > E 'Authorization': 'Bearer whatever', > E 'X-GitHub-Api-Version': '2022-11-28'}, > E 'url': 'https://api.github.com/repos/fake/repo/issues/pull/comments', > E } > > tests/commands/test_process_test_results.py:48: AssertionError > ```
Tests completed | Failed | Passed | Skipped |
---|---|---|---|
2079 | 3 | 2076 | 0 |
test_process_test_results
Stack Traces | 0.063s run time
> ``` > self = <MagicMock name='send_post_request' id='139913984984928'>, 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.com/repos/fake/repo/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.com/repos/fake/repo/issues/pull/comments'}) > actual = call(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests su...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 0x7f4043633e50> > 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.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > > /opt/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 0x7f4043502b20> > tmpdir = local('/tmp/pytest-of-runner/pytest-0/test_process_test_results0') > > def test_process_test_results( > mocker, > tmpdir, > ): > > tmp_file = tmpdir.mkdir("folder").join("summary.txt") > > mocker.patch.dict( > os.environ, > { > "GITHUB_REPOSITORY": "fake/repo", > "GITHUB_REF": "pull/fake/pull", > "GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename, > }, > ) > mocked_post = mocker.patch( > "codecov_cli.commands.process_test_results.send_post_request", > return_value=RequestResult( > status_code=200, error=None, warnings=[], text="yay it worked" > ), > ) > runner = CliRunner() > result = runner.invoke( > cli, > [ > "process-test-results", > "--provider-token", > "whatever", > "--file", > "samples/junit.xml", > "--disable-search", > ], > obj={}, > ) > > assert result.exit_code == 0 > > > mocked_post.assert_called_with( > url="https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |", > "cli_args": { > "auto_load_params_from": None, > "codecov_yml_path": None, > "enterprise_url": None, > "verbose": False, > "version": f"cli-{__version__}", > "command": "process-test-results", > "provider_token": "whatever", > "disable_search": True, > "dir": os.getcwd(), > "exclude_folders": (), > }, > }, > headers={ > "Accept": "application/vnd.github+json", > "Authorization": "Bearer whatever", > "X-GitHub-Api-Version": "2022-11-28", > }, > ) > E AssertionError: expected call not found. > E Expected: send_post_request(url='https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E > E pytest introspection follows: > E > E Kwargs: > E assert {'data': {'bo...ull/comments'} == {'data': {'bo...ull/comments'} > E Omitting 2 identical items, use -vv to show > E Differing items: > E {'data': {'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this rep...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} != {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n<det...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} > E Full diff: > E { > E + 'data': {'body': ':white_check_mark: All tests successful. No failed tests ' > E - 'data': {'body': '### :x: Failed Test Results: \n' > E - 'Completed 4 tests with **`1 failed`**, 3 passed and 0 ' > E - 'skipped.\n' > E ? ^^^^^ > E + 'were found.\n' > E ? ^ +++++++ > E - '<details><summary>View the full list of failed ' > E - 'tests</summary>\n' > E '\n' > E + ':mega: Thoughts on this report? [Let Codecov ' > E + 'know!](https://github.com/codecov/feedback/issues/304) | ' > E + 'Powered by [Codecov](https://about.codecov.io/)', > E - '| **Test Description** | **Failure message** |\n' > E - '| :-- | :-- |\n' > E - '| ' > E - '<pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test ' > E - 'name:<br>pytest<br></pre> | <pre>def<br> ' > E - 'test_divide():<br> &gt; assert ' > E - 'Calculator.divide(1, 2) == 0.5<br> E assert ' > E - '1.0 == 0.5<br> E + where 1.0 = ' > E - '&lt;function Calculator.divide at ' > E - '0x104c9eb90&gt;(1, 2)<br> E + where ' > E - '&lt;function Calculator.divide at 0x104c9eb90&gt; = ' > E - 'Calculator.divide<br> ' > E - '.../temp/calculator/test_calculator.py:30: ' > E - 'AssertionError</pre> |', > E 'cli_args': {'auto_load_params_from': None, > E 'codecov_yml_path': None, > E 'command': 'process-test-results', > E 'dir': '/home/runner/work/codecov-cli/codecov-cli', > E 'disable_search': True, > E 'enterprise_url': None, > E 'exclude_folders': (), > E 'provider_token': 'whatever', > E 'verbose': False, > E 'version': 'cli-0.7.5'}}, > E 'headers': {'Accept': 'application/vnd.github+json', > E 'Authorization': 'Bearer whatever', > E 'X-GitHub-Api-Version': '2022-11-28'}, > E 'url': 'https://api.github.com/repos/fake/repo/issues/pull/comments', > E } > > tests/commands/test_process_test_results.py:48: AssertionError > ```test_process_test_results
Stack Traces | 0.065s run time
> ``` > self = <MagicMock name='send_post_request' id='140556807557280'>, 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.com/repos/fake/repo/issues/pull/comments'} > expected = call(url='https://api.github.com/repos/fake/repo/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.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests su...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 0x7fd5ee9e9430> > 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.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > > /opt/hostedtoolcache/Python/3.9.20/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 0x7fd5ee9445b0> > tmpdir = local('/tmp/pytest-of-runner/pytest-0/test_process_test_results0') > > def test_process_test_results( > mocker, > tmpdir, > ): > > tmp_file = tmpdir.mkdir("folder").join("summary.txt") > > mocker.patch.dict( > os.environ, > { > "GITHUB_REPOSITORY": "fake/repo", > "GITHUB_REF": "pull/fake/pull", > "GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename, > }, > ) > mocked_post = mocker.patch( > "codecov_cli.commands.process_test_results.send_post_request", > return_value=RequestResult( > status_code=200, error=None, warnings=[], text="yay it worked" > ), > ) > runner = CliRunner() > result = runner.invoke( > cli, > [ > "process-test-results", > "--provider-token", > "whatever", > "--file", > "samples/junit.xml", > "--disable-search", > ], > obj={}, > ) > > assert result.exit_code == 0 > > > mocked_post.assert_called_with( > url="https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |", > "cli_args": { > "auto_load_params_from": None, > "codecov_yml_path": None, > "enterprise_url": None, > "verbose": False, > "version": f"cli-{__version__}", > "command": "process-test-results", > "provider_token": "whatever", > "disable_search": True, > "dir": os.getcwd(), > "exclude_folders": (), > }, > }, > headers={ > "Accept": "application/vnd.github+json", > "Authorization": "Bearer whatever", > "X-GitHub-Api-Version": "2022-11-28", > }, > ) > E AssertionError: expected call not found. > E Expected: send_post_request(url='https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E > E pytest introspection follows: > E > E Kwargs: > E assert {'data': {'bo...ull/comments'} == {'data': {'bo...ull/comments'} > E Omitting 2 identical items, use -vv to show > E Differing items: > E {'data': {'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this rep...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} != {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n<det...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} > E Full diff: > E { > E + 'data': {'body': ':white_check_mark: All tests successful. No failed tests ' > E - 'data': {'body': '### :x: Failed Test Results: \n' > E - 'Completed 4 tests with **`1 failed`**, 3 passed and 0 ' > E - 'skipped.\n' > E ? ^^^^^ > E + 'were found.\n' > E ? ^ +++++++ > E - '<details><summary>View the full list of failed ' > E - 'tests</summary>\n' > E '\n' > E + ':mega: Thoughts on this report? [Let Codecov ' > E + 'know!](https://github.com/codecov/feedback/issues/304) | ' > E + 'Powered by [Codecov](https://about.codecov.io/)', > E - '| **Test Description** | **Failure message** |\n' > E - '| :-- | :-- |\n' > E - '| ' > E - '<pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test ' > E - 'name:<br>pytest<br></pre> | <pre>def<br> ' > E - 'test_divide():<br> &gt; assert ' > E - 'Calculator.divide(1, 2) == 0.5<br> E assert ' > E - '1.0 == 0.5<br> E + where 1.0 = ' > E - '&lt;function Calculator.divide at ' > E - '0x104c9eb90&gt;(1, 2)<br> E + where ' > E - '&lt;function Calculator.divide at 0x104c9eb90&gt; = ' > E - 'Calculator.divide<br> ' > E - '.../temp/calculator/test_calculator.py:30: ' > E - 'AssertionError</pre> |', > E 'cli_args': {'auto_load_params_from': None, > E 'codecov_yml_path': None, > E 'command': 'process-test-results', > E 'dir': '/home/runner/work/codecov-cli/codecov-cli', > E 'disable_search': True, > E 'enterprise_url': None, > E 'exclude_folders': (), > E 'provider_token': 'whatever', > E 'verbose': False, > E 'version': 'cli-0.7.5'}}, > E 'headers': {'Accept': 'application/vnd.github+json', > E 'Authorization': 'Bearer whatever', > E 'X-GitHub-Api-Version': '2022-11-28'}, > E 'url': 'https://api.github.com/repos/fake/repo/issues/pull/comments', > E } > > tests/commands/test_process_test_results.py:48: AssertionError > ```
:mega: Thoughts on this report? Let Codecov know! | Powered by Codecov
Tests completed | Failed | Passed | Skipped |
---|---|---|---|
3465 | 5 | 3460 | 0 |
test_process_test_results
Stack Traces | 0.063s run time
> ``` > self = <MagicMock name='send_post_request' id='140415355713856'>, 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.com/repos/fake/repo/issues/pull/comments'} > expected = call(url='https://api.github.com/repos/fake/repo/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.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests su...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 0x7fb4ff857be0> > 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.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > > /opt/hostedtoolcache/Python/3.10.15/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 0x7fb4ff604280> > tmpdir = local('/tmp/pytest-of-runner/pytest-0/test_process_test_results0') > > def test_process_test_results( > mocker, > tmpdir, > ): > > tmp_file = tmpdir.mkdir("folder").join("summary.txt") > > mocker.patch.dict( > os.environ, > { > "GITHUB_REPOSITORY": "fake/repo", > "GITHUB_REF": "pull/fake/pull", > "GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename, > }, > ) > mocked_post = mocker.patch( > "codecov_cli.commands.process_test_results.send_post_request", > return_value=RequestResult( > status_code=200, error=None, warnings=[], text="yay it worked" > ), > ) > runner = CliRunner() > result = runner.invoke( > cli, > [ > "process-test-results", > "--provider-token", > "whatever", > "--file", > "samples/junit.xml", > "--disable-search", > ], > obj={}, > ) > > assert result.exit_code == 0 > > > mocked_post.assert_called_with( > url="https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |", > "cli_args": { > "auto_load_params_from": None, > "codecov_yml_path": None, > "enterprise_url": None, > "verbose": False, > "version": f"cli-{__version__}", > "command": "process-test-results", > "provider_token": "whatever", > "disable_search": True, > "dir": os.getcwd(), > "exclude_folders": (), > }, > }, > headers={ > "Accept": "application/vnd.github+json", > "Authorization": "Bearer whatever", > "X-GitHub-Api-Version": "2022-11-28", > }, > ) > E AssertionError: expected call not found. > E Expected: send_post_request(url='https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E > E pytest introspection follows: > E > E Kwargs: > E assert {'data': {'bo...ull/comments'} == {'data': {'bo...ull/comments'} > E Omitting 2 identical items, use -vv to show > E Differing items: > E {'data': {'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this rep...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} != {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n<det...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} > E Full diff: > E { > E + 'data': {'body': ':white_check_mark: All tests successful. No failed tests ' > E - 'data': {'body': '### :x: Failed Test Results: \n' > E - 'Completed 4 tests with **`1 failed`**, 3 passed and 0 ' > E - 'skipped.\n' > E ? ^^^^^ > E + 'were found.\n' > E ? ^ +++++++ > E - '<details><summary>View the full list of failed ' > E - 'tests</summary>\n' > E '\n' > E + ':mega: Thoughts on this report? [Let Codecov ' > E + 'know!](https://github.com/codecov/feedback/issues/304) | ' > E + 'Powered by [Codecov](https://about.codecov.io/)', > E - '| **Test Description** | **Failure message** |\n' > E - '| :-- | :-- |\n' > E - '| ' > E - '<pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test ' > E - 'name:<br>pytest<br></pre> | <pre>def<br> ' > E - 'test_divide():<br> &gt; assert ' > E - 'Calculator.divide(1, 2) == 0.5<br> E assert ' > E - '1.0 == 0.5<br> E + where 1.0 = ' > E - '&lt;function Calculator.divide at ' > E - '0x104c9eb90&gt;(1, 2)<br> E + where ' > E - '&lt;function Calculator.divide at 0x104c9eb90&gt; = ' > E - 'Calculator.divide<br> ' > E - '.../temp/calculator/test_calculator.py:30: ' > E - 'AssertionError</pre> |', > E 'cli_args': {'auto_load_params_from': None, > E 'codecov_yml_path': None, > E 'command': 'process-test-results', > E 'dir': '/home/runner/work/codecov-cli/codecov-cli', > E 'disable_search': True, > E 'enterprise_url': None, > E 'exclude_folders': (), > E 'provider_token': 'whatever', > E 'verbose': False, > E 'version': 'cli-0.7.5'}}, > E 'headers': {'Accept': 'application/vnd.github+json', > E 'Authorization': 'Bearer whatever', > E 'X-GitHub-Api-Version': '2022-11-28'}, > E 'url': 'https://api.github.com/repos/fake/repo/issues/pull/comments', > E } > > tests/commands/test_process_test_results.py:48: AssertionError > ```test_process_test_results
Stack Traces | 0.066s run time
> ``` > self = <MagicMock name='send_post_request' id='140179124261360'>, 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.com/repos/fake/repo/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.com/repos/fake/repo/issues/pull/comments'}) > actual = call(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests su...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 0x7f7dfef2ee50> > 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.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > > /opt/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 0x7f7dfeed3850> > tmpdir = local('/tmp/pytest-of-runner/pytest-0/test_process_test_results0') > > def test_process_test_results( > mocker, > tmpdir, > ): > > tmp_file = tmpdir.mkdir("folder").join("summary.txt") > > mocker.patch.dict( > os.environ, > { > "GITHUB_REPOSITORY": "fake/repo", > "GITHUB_REF": "pull/fake/pull", > "GITHUB_STEP_SUMMARY": tmp_file.dirname + tmp_file.basename, > }, > ) > mocked_post = mocker.patch( > "codecov_cli.commands.process_test_results.send_post_request", > return_value=RequestResult( > status_code=200, error=None, warnings=[], text="yay it worked" > ), > ) > runner = CliRunner() > result = runner.invoke( > cli, > [ > "process-test-results", > "--provider-token", > "whatever", > "--file", > "samples/junit.xml", > "--disable-search", > ], > obj={}, > ) > > assert result.exit_code == 0 > > > mocked_post.assert_called_with( > url="https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |", > "cli_args": { > "auto_load_params_from": None, > "codecov_yml_path": None, > "enterprise_url": None, > "verbose": False, > "version": f"cli-{__version__}", > "command": "process-test-results", > "provider_token": "whatever", > "disable_search": True, > "dir": os.getcwd(), > "exclude_folders": (), > }, > }, > headers={ > "Accept": "application/vnd.github+json", > "Authorization": "Bearer whatever", > "X-GitHub-Api-Version": "2022-11-28", > }, > ) > E AssertionError: expected call not found. > E Expected: send_post_request(url='https://api.github.com/repos/fake/repo/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| **Test Description** | **Failure message** |\n| :-- | :-- |\n| <pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test name:<br>pytest<br></pre> | <pre>def<br> test_divide():<br> &gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &lt;function Calculator.divide at 0x104c9eb90&gt;(1, 2)<br> E + where &lt;function Calculator.divide at 0x104c9eb90&gt; = Calculator.divide<br> .../temp/calculator/test_calculator.py:30: AssertionError</pre> |', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E Actual: send_post_request(url='https://api.github.com/repos/fake/repo/issues/pull/comments', data={'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this report? [Let Codecov know!](https://github.com/codecov/feedback/issues/304) | Powered by [Codecov](https://about.codecov.io/)', 'cli_args': {'auto_load_params_from': None, 'codecov_yml_path': None, 'enterprise_url': None, 'verbose': False, 'version': 'cli-0.7.5', 'command': 'process-test-results', 'provider_token': 'whatever', 'disable_search': True, 'dir': '/home/runner/work/codecov-cli/codecov-cli', 'exclude_folders': ()}}, headers={'Accept': 'application/vnd.github+json', 'Authorization': 'Bearer whatever', 'X-GitHub-Api-Version': '2022-11-28'}) > E > E pytest introspection follows: > E > E Kwargs: > E assert {'data': {'bo...ull/comments'} == {'data': {'bo...ull/comments'} > E Omitting 2 identical items, use -vv to show > E Differing items: > E {'data': {'body': ':white_check_mark: All tests successful. No failed tests were found.\n\n:mega: Thoughts on this rep...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} != {'data': {'body': '### :x: Failed Test Results: \nCompleted 4 tests with **`1 failed`**, 3 passed and 0 skipped.\n<det...'codecov_yml_path': None, 'command': 'process-test-results', 'dir': '/home/runner/work/codecov-cli/codecov-cli', ...}}} > E Full diff: > E { > E + 'data': {'body': ':white_check_mark: All tests successful. No failed tests ' > E - 'data': {'body': '### :x: Failed Test Results: \n' > E - 'Completed 4 tests with **`1 failed`**, 3 passed and 0 ' > E - 'skipped.\n' > E ? ^^^^^ > E + 'were found.\n' > E ? ^ +++++++ > E - '<details><summary>View the full list of failed ' > E - 'tests</summary>\n' > E '\n' > E + ':mega: Thoughts on this report? [Let Codecov ' > E + 'know!](https://github.com/codecov/feedback/issues/304) | ' > E + 'Powered by [Codecov](https://about.codecov.io/)', > E - '| **Test Description** | **Failure message** |\n' > E - '| :-- | :-- |\n' > E - '| ' > E - '<pre>Testsuite:<br>api.temp.calculator.test_calculator::test_divide<br><br>Test ' > E - 'name:<br>pytest<br></pre> | <pre>def<br> ' > E - 'test_divide():<br> &gt; assert ' > E - 'Calculator.divide(1, 2) == 0.5<br> E assert ' > E - '1.0 == 0.5<br> E + where 1.0 = ' > E - '&lt;function Calculator.divide at ' > E - '0x104c9eb90&gt;(1, 2)<br> E + where ' > E - '&lt;function Calculator.divide at 0x104c9eb90&gt; = ' > E - 'Calculator.divide<br> ' > E - '.../temp/calculator/test_calculator.py:30: ' > E - 'AssertionError</pre> |', > E 'cli_args': {'auto_load_params_from': None, > E 'codecov_yml_path': None, > E 'command': 'process-test-results', > E 'dir': '/home/runner/work/codecov-cli/codecov-cli', > E 'disable_search': True, > E 'enterprise_url': None, > E 'exclude_folders': (), > E 'provider_token': 'whatever', > E 'verbose': False, > E 'version': 'cli-0.7.5'}}, > E 'headers': {'Accept': 'application/vnd.github+json', > E 'Authorization': 'Bearer whatever', > E 'X-GitHub-Api-Version': '2022-11-28'}, > E 'url': 'https://api.github.com/repos/fake/repo/issues/pull/comments', > E } > > tests/commands/test_process_test_results.py:48: AssertionError > ```
:mega: Thoughts on this report? Let Codecov know! | Powered by Codecov
This is ready for review, as it's only scoped to updating the format. It will also need https://github.com/codecov/codecov-cli/pull/522 to overwrite existing message.
:white_check_mark: All tests successful. No failed tests were found.
:mega: Thoughts on this report? Let Codecov know! | Powered by Codecov
:white_check_mark: All tests successful. No failed tests were found.
:mega: Thoughts on this report? Let Codecov know! | Powered by Codecov
This will format the message to the newest latest version for the CLI tooling.