Open GitHubEddie opened 9 months ago
Thanks for the suggestion. Sounds like a good idea, as long as the implementation is compatible with Jenkins and other JUnit report readers. 👍
Based on what I've found it's expected to be local time without timezone information unlike NUnit3. See https://github.com/jest-community/jest-junit/issues/43
Would you like to submit a PR for this?
Checklist
What is the issue?
The junit_schema_4.xsd contains an optional attribute called timestamp under the testsuite element.
The issue is during a junit result object conversion to XML the timestamp is not included. For example,
<testsuite name="<ScriptBlock>:1" tests="136" errors="0" failures="2" hostname="COMPUTER1" id="0" skipped="0" disabled="0" package="<ScriptBlock>:1" time="2.644" >
The testsuite timestamp attribute is useful for tools like Allure Reports. Without the timestamp attribute the Allure dashboard looks like this ('UNKNOWN' in report title)
Expected Behavior
The expectation would be for the timestamp attribute to be present on the junit XML.
<testsuite name="<ScriptBlock>:1" tests="136" errors="0" failures="2" hostname="COMPUTER1" id="0" skipped="0" disabled="0" package="<ScriptBlock>:1" time="2.644" timestamp="2023-12-05T21:04:41.4970014Z">
With the timestamp attribute available the Allure Reports Overview returns a title with detail from the test
Steps To Reproduce
or
Describe your environment
Possible Solution?
This should be resolved by adding something like this
to the
Pester.psm1
functionWrite-JUnitTestSuiteAttributes