michael-o commented on code in PR #702:
URL: https://github.com/apache/maven-surefire/pull/702#discussion_r1439670377


##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java:
##########
@@ -456,21 +456,13 @@ private static void getTestProblems(
             }
         }
 
-        boolean hasNestedElements = createOutErrElementsInside & stackTrace != 
null;
-
-        if (stackTrace != null) {
-            if (hasNestedElements) {
-                ppw.startElement("stackTrace");
+        if (enableNestedOutErrElements) {
+            ppw.startElement("stackTrace");
+            if (stackTrace != null) {
+                extraEscapeElementValue(stackTrace, outputStreamWriter, ppw, 
fw);
             }
+            ppw.endElement();
 
-            extraEscapeElementValue(stackTrace, outputStreamWriter, ppw, fw);

Review Comment:
   I think I understand what you mean. Let me rephrase and I guess you are 
right here, the schema is poorly designed. According to 
https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd
 both `failure` and `error` aren't complex elements, thus do *not* contain 
`stackTrace`. Their element body contains the strack trace? Is that the case, 
if so I will cancel the vote and work on a fix and let you know.



-- 
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-unsubscr...@maven.apache.org

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

Reply via email to