Skip to content

Times in xUnit outputs should be floats not integers #2397

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

Closed
mverma-va opened this issue Jun 10, 2016 · 1 comment
Closed

Times in xUnit outputs should be floats not integers #2397

mverma-va opened this issue Jun 10, 2016 · 1 comment

Comments

@mverma-va
Copy link

mverma-va commented Jun 10, 2016

I noticed that the current xunit xml report file only shows time in seconds and does not have milliseconds component to it. So for some of the testcase which just finishes in say 330ms it shows 0; 660ms shows 1 (not sure about the rounding off), but it just shows seconds.
example:

It would be useful if we shows the time in milliseconds or in seconds with fractions ms, like time="1.182"
See attached report.xml file generated using --xunit flag (i have to change the file to .txt for attaching)
report_xml.txt

@pekkaklarck
Copy link
Member

This definitely sounds reasonable. I guess the reason we have used integers earlier is that the files we used as examples when designing out xunit format used integers. As discussed in #2292, it is highly annoying that there is no official xunit/junit format specification available. Based on your knowledge, do other tools write times as integers or as floats?

The main problem with changing the time format is backwards compatibility. It is possible that some external tools or custom utilities parse times as integers and changing them to floats causes problems. If other tools already produce xunit files with floats, the problem with external tools ought to be pretty small, and fixing custom tools to parse times as floats isn't a big problem either.

My current thinking is that the behavior should be changed, but because of the backwards compatibility concerns we cannot do that in RF 3.0.x releases but need to wait for RF 3.1. We allow backwards incompatible changes in major releases, and doing this early in the RF 3.1 development cycle allows getting feedback from users during alpha and beta period.

@pekkaklarck pekkaklarck changed the title Add support for TC time to show milliseconds component in -x --xunit generated xml report file Times in xUnit outputs should be floats not integers Jun 17, 2016
@pekkaklarck pekkaklarck added this to the 3.1 milestone Jun 17, 2016
@pekkaklarck pekkaklarck added the good first issue Good for newcomers label Apr 23, 2018
juusoi pushed a commit to juusoi/robotframework that referenced this issue Jul 2, 2018
@pekkaklarck pekkaklarck added acknowledge To be acknowledged in release notes alpha 2 labels Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants