junitparser icon indicating copy to clipboard operation
junitparser copied to clipboard

Time parsing is incorrect

Open asaf-kali opened this issue 1 year ago • 5 comments

In my company, we run tests in parallel.

Pytest exports the test suite with a (correct) time tag:

<?xml version="1.0" encoding="utf-8"?>
<testsuites>
    <testsuite name="pytest" errors="0" failures="14" skipped="0" tests="76" time="4005.821" timestamp="...." hostname="....">
        <testcase classname="...." name="...." time="661.025"/>

Indeed, tests took about an hour.

The time provided by TestSuite.time was 23406 seconds, which is the accumeltated time of all the tests. It seems the logic in TestSuite.update_statistics does not take into account such cases, so I suggest the following logic change: If time tag already exists on the element, skip the sum logic, and use the tag value as value for time.

asaf-kali avatar Nov 21 '24 17:11 asaf-kali