TOPdesk / dart-junitreport

An application to generate JUnit XML reports from dart test runs.
https://pub.dartlang.org/packages/junitreport
MIT License
31 stars 45 forks source link

Add `file` parameter to output XML from input test `url` #35

Open CelticMajora opened 3 years ago

CelticMajora commented 3 years ago

Currently, the json input to this tool includes a url with the filepath of a ran test, something like this:

{"test":{"id":3,"name":"package test","suiteID":0,"groupIDs":[2],"metadata":{"skip":false,"skipReason":null},"line":4,"column":3,"url":"file:///root/project/flutter/package/test/package_test.dart"},"type":"testStart","time":8218}

However the output XML will only include the classname currently. Something like this:

<testcase classname="flutter.package.test.package" name="package test" time="0.042">
  <failure message="1 failure, see stacktrace for details">Failure:\n\nExpected: false Actual: <true> </failure>
</testcase>

I'd expect the output XML to look something like this instead:

<testcase file="/root/project/flutter/package/test/package_test.dart" classname="flutter.package.test.package" name="package test" time="0.042">
  <failure message="1 failure, see stacktrace for details">Failure:\n\nExpected: false Actual: <true> </failure>
</testcase>

I'm happy to throw up a PR to work on this as well.

rspilker commented 2 years ago

Can you point to a JUnit xml specification where the file attribute is defined?