You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "kevinnammour (via GitHub)" <gi...@apache.org> on 2026/01/29 06:23:42 UTC

[I] Add Test Start Timestamp to Surefire XML Reports [maven-surefire]

kevinnammour opened a new issue, #3249:
URL: https://github.com/apache/maven-surefire/issues/3249

   ### New feature, improvement proposal
   
   **Summary**
   
   Add an explicit start timestamp field to the Surefire XML reports at both:
   - testsuite level
   - testcase level
   
   The timestamp should represent the **exact start time of execution** for each test suite and each individual test case.
   
   **Problem Statement**
   
   Currently, Surefire XML reports provide:
   - test duration (time)
   - counts (tests, failures, skipped, etc.)
   
   
   However, they do not expose the start time of:
   - a test suite
   - an individual test case
   
   
   This makes it difficult to correlate test execution with time-based external signals, such as:
   
   - CPU usage
   - memory consumption
   - I/O pressure
   - JVM metrics
   - system-level monitoring data
   
   **Proposed Enhancement**
   ```
   testsuite
       name="com.example.MyTest"
       timestamp="2026-01-29T06:41:12.345Z"
       time="12.345">
   <testcase
       name="shouldProcessData"
       classname="com.example.MyTest"
       timestamp="2026-01-29T06:41:15.123Z"
       time="0.456">
   .......
   ```
   
   - Timestamp should represent test execution start time
   - ISO‑8601 format (UTC) is recommended for interoperability
   - Backward compatible: additive, optional field
   
   
   **Motivation & Use Cases**
   Fine‑Grained Performance & Resource Monitoring
   
   **Current Workaround**
   At the moment, we are using a custom JUnit listener to capture test start times and emit them separately.


-- 
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.apache.org

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


Re: [I] Add Test Start Timestamp to Surefire XML Reports [maven-surefire]

Posted by "kevinnammour (via GitHub)" <gi...@apache.org>.
kevinnammour commented on issue #3249:
URL: https://github.com/apache/maven-surefire/issues/3249#issuecomment-3919399944

   Thanks for your reply @olamy 
   
   I tried to play around with the custom reporting, but unfortunately it won't have access to the start time as the stateless reported takes the wrapper entry as input and the latter doesn't have yet the startTime field. It's only included in the TestSetStats.
   
   However, we opted for temporarily using our listeners and opened this PR for long-term use: https://github.com/apache/maven-surefire/pull/3261
   
   It would be great if you can help us integrate it for it to be included in the 3.5.5 milestone.


-- 
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


Re: [I] Add Test Start Timestamp to Surefire XML Reports [maven-surefire]

Posted by "olamy (via GitHub)" <gi...@apache.org>.
olamy closed issue #3249: Add Test Start Timestamp to Surefire XML Reports
URL: https://github.com/apache/maven-surefire/issues/3249


-- 
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


Re: [I] Add Test Start Timestamp to Surefire XML Reports [maven-surefire]

Posted by "aghoussaini (via GitHub)" <gi...@apache.org>.
aghoussaini commented on issue #3249:
URL: https://github.com/apache/maven-surefire/issues/3249#issuecomment-3859440699

   This would be useful for me as well. I'm considering exploring a possible implementation and would like input on the matter. 


-- 
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


Re: [I] Add Test Start Timestamp to Surefire XML Reports [maven-surefire]

Posted by "olamy (via GitHub)" <gi...@apache.org>.
olamy commented on issue #3249:
URL: https://github.com/apache/maven-surefire/issues/3249#issuecomment-3866498790

   There are some ways to already do it with the current plugin without any code modification.
   
   Have a look at this SurefireMojo parameter
   ```
       <statelessTestsetReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
         <disable>false</disable>
         <usePhrasedFileName>false</usePhrasedFileName>
         <usePhrasedTestSuiteClassName>true</usePhrasedTestSuiteClassName>
         <usePhrasedTestCaseClassName>true</usePhrasedTestCaseClassName>
         <usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
       </statelessTestsetReporter>
   ```
   
   `implementation` attribute can contain your own implementation (must added as a dependency of the plugin declaration though).
   If you want to provide a PR for this, due to heavy usage of surefire xml reports file in the community, those new fields should be be disabled per default.
   I hope this xml fragment above gave you an idea about how to do it ;) 
   


-- 
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