You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "slawekjaranowski (via GitHub)" <gi...@apache.org> on 2023/05/25 19:17:25 UTC

[GitHub] [maven-surefire] slawekjaranowski commented on a diff in pull request #645: Simplify serialization/deserialization of elapsed time (SUREFIRE-2164 + SUREFIRE-2167)

slawekjaranowski commented on code in PR #645:
URL: https://github.com/apache/maven-surefire/pull/645#discussion_r1205911407


##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java:
##########
@@ -387,7 +390,9 @@ private void startTestElement(XMLWriter ppw, WrappedReportEntry report) throws I
             ppw.addAttribute("classname", extraEscapeAttribute(className));
         }
 
-        ppw.addAttribute("time", report.elapsedTimeAsString());
+        if (report.getElapsed() != null) {
+            ppw.addAttribute("time", String.valueOf(report.getElapsed() / ONE_SECOND));

Review Comment:
   This can depend on user locales like use dot or comma as separator - should we take care about it?



##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java:
##########
@@ -387,7 +390,9 @@ private void startTestElement(XMLWriter ppw, WrappedReportEntry report) throws I
             ppw.addAttribute("classname", extraEscapeAttribute(className));
         }
 
-        ppw.addAttribute("time", report.elapsedTimeAsString());

Review Comment:
   Can we remove method `elapsedTimeAsString` and used `org.apache.maven.plugin.surefire.report.ReporterUtils`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org