Skip to content

[junit] Add a file attribute to xunit2Β #7537

Open
@webknjaz

Description

@webknjaz

Currently linked schema https://github.com/jenkinsci/xunit-plugin/blob/xunit-2.3.2/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd#L127 allows a file attribute in <testsuite> nodes. It's currently missing but would be very useful.

AFAICS junitxml plugin dumps everything under a single testsuite node. It was probably fine with xunit1 that allowed per-testcase file attribute to be set. Now that xunit2 is going to be a default, it needs a similar feature too.

But since this attribute is per-suite in xunit2, the plugin will have to separate <testcase>s into multiple <testsuite>s.

Why is this important to me personally? I usually set up test reporting in CIs that support it (AppVeyor and Circle CI, for example). And it's nice to see where the test is coming from.

I wanted to turn the test report into GitHub Actions annotations from XML using a simple action that requires almost zero effort to set up (shyim/junit-report-annotations-action#3). But I hit a roadblock when I realized that for putting annotations on lines in files, it has to know what those files are.

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: junitxmlrelated to the junitxml builtin plugintype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions