Time handling should be centralized
vrchmvgx opened this issue · 4 comments
Currently, different methods of handling time data or lack thereof are spread across the different handlers (particularly JUnit). As a developer, I would like to see
- Support for either elapsed time or start/end time data for each keyword
- No handler-specific time manipulation or metadata modification in the handler, except for the previous bullet point
I'm using the library and found that the second bullet "No handler-specific time manipulation or metadata modification in the handler, except for the previous bullet point" is what I'm suffering while trying to use it.
There are some expectation on that fix?
The junit time info is not being considered while generating the robot.xml file.
this issue is about improving the current logic and where in codebase it should reside. It sounds to me you have found problem with JUnit handler, which would possibly be a separate bug.
Could you describe here the specific problem you are facing?
@Tattoo I got a JUnit result. It contained test cases and each testcase contained a time item, giving the elapsed time for a test.
Example bellow. Them I parse it with Oxygen, but the output start/finish date do not take into account the elapsed time for the test. I understand that my junit does not contain initial/finish time for tests, but at least it contain the time that each test took to run.
But this information end lost, and the xunit (robot xml) does not contain such time information for individual tests.
I would like that at least, this report start/end time could take into account the time field form the origin file to take into account.
Files below are just a snip of the original and final files. I change the test names and suite names.
Original file
<testsuites>
<testsuite tests="24" failures="0" time="316.525" name="test1">
<properties>
<property name="go.version" value="go1.16.15"/>
</properties>
<testcase classname="test1" name="test_suite1" time="19.330"/>
Parsed file by oxygen
<robot generator="Robot 4.1.2 (Python 3.9.13 on linux)" generated="20220808 11:06:06.878" rpa="false" schemaversion="2">
<suite id="s1" name="JUnit Execution">
<suite id="s1-s1" name="test_suite1">
<test id="s1-s1-t1" name="teste1">
<kw name="Pass Execution" library="BuiltIn">
<arg>Test passed :D</arg>
<doc>Skips rest of the current test, setup, or teardown with PASS status.</doc>
<msg timestamp="20220808 11:06:06.910" level="INFO">Execution passed with message: Test passed :D</msg>
<status status="PASS" starttime="20220808 11:06:06.910" endtime="20220808 11:06:06.911"/>
</kw>
<status status="PASS" starttime="20220808 11:06:06.909" endtime="20220808 11:06:06.911">Test passed :D</status>
</test>
I opened a new issue for this topic that I mentioned above.