jstemmer / go-junit-report

Convert Go test output to JUnit XML
MIT License
776 stars 224 forks source link

Hostname and timestamp properties in generated JUnit XML reports #117

Closed acabarbaye closed 2 years ago

acabarbaye commented 3 years ago

this is a similar issue to https://github.com/pytest-dev/pytest/issues/5471 which used to be in pytest

The schema of Junit reports (http://windyroad.com.au/dl/Open%20Source/JUnit.xsd) defines some required fields such as timestamp or hostname in testsuite xml element which rendering tools such as Allure rely on. Current output of go-junit-report is, as follows:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
    <testsuite tests="2" failures="2" time="600.111" name="...">
        <properties>
            <property name="go.version" value="go1.14.2"></property>
        </properties>
        <testcase classname="..." name="..." time="0.000">
            <failure message="Failed" type=""></failure>
        </testcase>
        <testcase classname="..." name="..." time="0.000">
...................
        </testcase>
    </testsuite>
</testsuites>

Could such xml attributes be added?