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

Update test-results-parser #524

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codecov_cli/commands/process_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def generate_message_payload(upload_collection_results):
try:
logger.info(f"Parsing {result.get_filename()}")
testruns = parse_junit_xml(result.get_content())
for testrun in testruns:
for testrun in testruns.testruns:
if (
testrun.outcome == Outcome.Failure
or testrun.outcome == Outcome.Error
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile setup.py
Expand Down Expand Up @@ -43,7 +43,7 @@ sniffio==1.3.0
# anyio
# httpcore
# httpx
test-results-parser==0.1.0
test-results-parser==0.5.1
# via codecov-cli (setup.py)
tree-sitter==0.20.2
# via codecov-cli (setup.py)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"pyyaml==6.*",
"responses==0.21.*",
"tree-sitter==0.20.*",
"test-results-parser==0.1.*",
"test-results-parser==0.5.*",
"regex",
],
entry_points={
Expand Down
24 changes: 1 addition & 23 deletions tests/commands/test_process_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,7 @@ def test_process_test_results(

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> &amp;gt; assert Calculator.divide(1, 2) == 0.5<br> E assert 1.0 == 0.5<br> E + where 1.0 = &amp;lt;function Calculator.divide at 0x104c9eb90&amp;gt;(1, 2)<br> E + where &amp;lt;function Calculator.divide at 0x104c9eb90&amp;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",
},
)
mocked_post.assert_called_once()


def test_process_test_results_non_existent_file(mocker, tmpdir):
Expand Down
Loading