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

fix duration_ms to be correct #38

Merged
merged 2 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions tap2junit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def extract_test_info_from_description(description):

def map_yaml_to_junit(test):
yaml = test.yaml or {}
# Even though the name is `duration_ms` the value is in seconds.
elapsed_sec = yaml.get("duration_ms", None)
elapsed_sec = yaml.get("duration_ms", 0) / 1000 or None
(test_class, test_name) = extract_test_info_from_description(test.description)
t = TestCase(test_name, classname=test_class, elapsed_sec=elapsed_sec)
if test.result == "ok":
Expand Down
18 changes: 9 additions & 9 deletions test/output/test-nested.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<testsuites disabled="0" errors="0" failures="2" tests="7" time="10.541631082">
<testsuite disabled="0" errors="0" failures="2" name="test/fixtures/test-nested" skipped="0" tests="7" time="10.541631082" hostname="{HOSTNAME}">
<testcase name="- top level 1" time="0.340575"/>
<testcase name="- top level 2" time="0.303039"/>
<testcase name="- nested 1" time="2.367745"/>
<testcase name="- nested 2" time="2.332324">
<testsuites disabled="0" errors="0" failures="2" tests="7" time="0.010541631081999998">
<testsuite disabled="0" errors="0" failures="2" name="test/fixtures/test-nested" skipped="0" tests="7" time="0.010541631081999998" hostname="{HOSTNAME}">
<testcase name="- top level 1" time="0.000341"/>
<testcase name="- top level 2" time="0.000303"/>
<testcase name="- nested 1" time="0.002368"/>
<testcase name="- nested 2" time="0.002332">
<failure type="failure" message=" (0)">
---
code: ERR_TEST_FAILURE
Expand All @@ -14,7 +14,7 @@ failureType: cancelledByParent
...
</failure>
</testcase>
<testcase name="- nested" time="2.367871">
<testcase name="- nested" time="0.002368">
<failure type="failure" message=" (0)">
---
code: ERR_TEST_FAILURE
Expand All @@ -25,7 +25,7 @@ failureType: fail
</failure>
<system-err>['# Subtest: top level 4']</system-err>
</testcase>
<testcase name="- top level 4" time="0.340575"/>
<testcase name="- parent" time="2.489501"/>
<testcase name="- top level 4" time="0.000341"/>
<testcase name="- parent" time="0.002490"/>
</testsuite>
</testsuites>
Loading