Added a xunit directive
ClosedPublic

Authored by lbrabec on May 2 2016, 12:56 PM.

Details

Summary

This diff adds a xunit directive that parses XML xUnit file. Such
file can be output of pytest if run with --junitxml=output.xml.
Unfortuntely xunitparser, python module that does all the parsing,
is not in repos and has to be installed via pip install xunitparser.

Test Plan

run with slightly modified example from D833
tests will follow

Diff Detail

Repository
rLTRN libtaskotron
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
lbrabec retitled this revision from to Added a xunit directive.May 2 2016, 12:56 PM
lbrabec updated this object.
lbrabec edited the test plan for this revision. (Show Details)
lbrabec added reviewers: kparal, tflink, mkrizek, jskladan.
lbrabec updated this revision to Diff 2133.May 2 2016, 1:11 PM
  • cleaning testing leftovers, docker image type added
tflink added a comment.May 3 2016, 1:43 PM

It looks good to me as a first pass, assuming that tests will be added.

I'd prefer to avoid having deps from pip only. python-xunit will need to be packaged in Fedora before this code lands since we're going to be packaging libtaskotron for Fedora shortly.

libtaskotron/directives/xunit_directive.py
23

i think it'd be good to note where this path is relative to even if it may seem obvious

70

I'm wondering if a default to allpass here might be better than requiring the arg

lbrabec updated this revision to Diff 2146.May 4 2016, 11:30 AM
  • tests and polishing
lbrabec updated this revision to Diff 2147.May 4 2016, 11:44 AM
  • one more test, typo
jskladan requested changes to this revision.May 12 2016, 8:45 AM
jskladan added inline comments.
libtaskotron/directives/xunit_directive.py
86

With namespacing in mind, I suggest switching to this:

checkname = "%s.%s" % (arg_data['checkname'], tc.methodname)

this will make sure that these are semantically really subresults, and we'll be able to easily implement searches/filters, that would be at least clumsy with the need to know when to parse note to get the additional data.

This revision now requires changes to proceed.May 12 2016, 8:45 AM
lbrabec updated this revision to Diff 2179.May 12 2016, 1:27 PM
  • checkname polishing
jskladan accepted this revision.May 18 2016, 10:55 AM
This revision is now accepted and ready to land.May 18 2016, 10:55 AM
tflink accepted this revision.May 30 2016, 2:57 PM

The only reason I hadn't accepted this yet is that the required python-xunitparser wasn't packaged yet. As soon as that goes stable, please get this merged into develop

Closed by commit rLTRN818c3c2fc015: Added a xunit directive (authored by Lukas Brabec <lbrabec@redhat.com>). · Explain WhyJun 2 2016, 10:05 AM
This revision was automatically updated to reflect the committed changes.