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

Add support for TRX files #287

Merged
merged 32 commits into from
Jun 21, 2022
Merged

Add support for TRX files #287

merged 32 commits into from
Jun 21, 2022

Conversation

EnricoMi
Copy link
Owner

@EnricoMi EnricoMi commented May 23, 2022

Fixes #279.

from typing import Iterable, Tuple, Union

from junitparser import JUnitXml
from lxml import etree
Copy link

Choose a reason for hiding this comment

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

blacklist: Using etree to parse untrusted XML data is known to be vulnerable to XML attacks. Replace etree with the equivalent defusedxml package.

(at-me in a reply with help or ignore)


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

return Exception(f'File is empty.')

try:
trx = etree.parse(path)
Copy link

Choose a reason for hiding this comment

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

blacklist: Using lxml.etree.parse to parse untrusted XML data is known to be vulnerable to XML attacks. Replace lxml.etree.parse with its defusedxml equivalent function.

(at-me in a reply with help or ignore)


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

from typing import Iterable, Tuple, Union

from junitparser import JUnitXml
from lxml import etree
Copy link

Choose a reason for hiding this comment

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

opt.semgrep.python.lang.security.use-defused-xml.use-defused-xml: Found use of the native Python XML libraries, which is vulnerable to XML external entity (XXE)
attacks. The Python documentation recommends the 'defusedxml' library instead if the XML being
loaded is untrusted.

(at-me in a reply with help or ignore)


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (macOS python installed)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (macOS python 3.6)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (Dockerfile)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (Docker Image)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (Test Files)

     35 files  +    9         4 errors  32 suites  +9   39m 52s ⏱️ +31s
1 214 tests +935  1 112 ✔️ +884  57 💤 +37  39 +14  6 🔥 ±0 
1 397 runs  +947  1 246 ✔️ +888  96 💤 +39  48 +20  7 🔥 ±0 

For more details on these parsing errors, failures and errors, see this check.

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (Linux python 3.6)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (Linux python installed)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (macOS 12 python installed)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (Linux 22.04 python installed)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (Windows python installed)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 23, 2022

Test Results (reference)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

This pull request removes 15 and adds 7 tests. Note that renamed tests count towards both.
test_junit.TestJunit ‑ test_parse_junit_xml_file_with_disabled_tests
test_junit.TestJunit ‑ test_parse_junit_xml_files_with_corrupt_xml_file
test_junit.TestJunit ‑ test_parse_junit_xml_files_with_empty_file
test_junit.TestJunit ‑ test_parse_junit_xml_files_with_horovod_file
test_junit.TestJunit ‑ test_parse_junit_xml_files_with_minimal_attributes_file
test_junit.TestJunit ‑ test_parse_junit_xml_files_with_no_attributes_file
test_junit.TestJunit ‑ test_parse_junit_xml_files_with_no_files
test_junit.TestJunit ‑ test_parse_junit_xml_files_with_non_existing_file
test_junit.TestJunit ‑ test_parse_junit_xml_files_with_non_junit_file
test_junit.TestJunit ‑ test_parse_junit_xml_files_with_non_xml_file
…
test_action_script.Test ‑ test_get_settings_any_files
test_action_script.Test ‑ test_parse_files
test_action_script.Test ‑ test_parse_files_no_matches
test_junit.TestJunit ‑ test_parse_and_process_files
test_junit.TestJunit ‑ test_process_parse_junit_xml_files_with_no_files
test_junit.TestJunit ‑ test_process_parse_junit_xml_files_with_time_factor
test_trx.TestTrx ‑ test_parse_and_process_files

♻️ This comment has been updated with latest results.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@EnricoMi EnricoMi marked this pull request as ready for review May 23, 2022 20:09
@github-actions

This comment has been minimized.


def test_transform(self):
result_file = str(test_files_path / 'mstest.trx')
trx = etree.parse(str(result_file))
Copy link

Choose a reason for hiding this comment

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

blacklist: Using lxml.etree.parse to parse untrusted XML data is known to be vulnerable to XML attacks. Replace lxml.etree.parse with its defusedxml equivalent function.

(at-me in a reply with help or ignore)


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

import pathlib
import unittest

from lxml import etree
Copy link

Choose a reason for hiding this comment

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

blacklist: Using etree to parse untrusted XML data is known to be vulnerable to XML attacks. Replace etree with the equivalent defusedxml package.

(at-me in a reply with help or ignore)


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@github-actions
Copy link

Test Results (setup-python)

       69 files  ±    0         69 suites  ±0   24m 4s ⏱️ + 7m 39s
     300 tests  -     8       300 ✔️  -     8      0 💤 ±0  0 ±0 
20 700 runs   - 552  20 160 ✔️  - 552  540 💤 ±0  0 ±0 

Results for commit 7067fa3. ± Comparison against base commit b776d2f.

@EnricoMi EnricoMi merged commit e633876 into devel-2.0 Jun 21, 2022
@EnricoMi EnricoMi deleted the branch-add-trx branch June 21, 2022 10:55
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.

Add Support for the TRX Test Output Format
1 participant