larrymyers / jasmine-reporters

Reporter classes for the jasmine test framework. Includes JUnitXmlReporter for generating junit xml output for running in CI environments like Jenkins.
MIT License
394 stars 180 forks source link

Time value being returned as NaN for testcases #193

Open mtweisenbarger opened 6 years ago

mtweisenbarger commented 6 years ago

Hello! I really hope someone can help me out with this. So I work for jbHunt and we have a suite of tests that run using protractor, jasmine2, typescript, and angular through TFS/VSTS Continuous Integration. We are using the Jasmine Reporter JUnit to print the results in TFS for graphs and other types of reporting. The issue we are having is sometimes (its very random) we are getting a "NaN" value returned on the "time" property from the reports. I have uploaded an example of the error. junitresults-RegressiontestSearchRoutesEditRouteFinalize.txt

As you can see the reporter does work (as evidenced by the many steps showing a proper time) but still there are others (regardless of pass or fail) that show NaN. The real issue we are having is the built in TFS module that parses the results has no way to deal with NaN values. That powershell script is out of our control (all in Microsoft's hands) so there isn't anything I can do about it. They return this result when there is a NaN value: ##[warning]Failed to publish test results: TimeSpan does not accept floating point Not-a-Number values.

Is there any fix that can be made on the reporter side that will handle for NaN values? Thank you for your assistance.

mtweisenbarger commented 6 years ago

Just wanted to update this, Microsoft has developed a fix for our issue. Here is the upcoming push: https://github.com/Microsoft/vsts-agent/commit/980268dc33a405184b10f61c10eb1c0fee163e6a

Just letting everyone know. Thanks.

mtweisenbarger commented 6 years ago

This was never fixed on the jasmine reporter side; Microsoft provided a solution for us. But the issue can still occur.

mtweisenbarger commented 6 years ago

The solution provided by Microsoft did not work, can someone please fix the reporter to ensure no "NaN" values are passed for the "time" in the xml? Even if they are simply converted to a 0 that would be fine. Thank you.