Discussion:
[tycho-user] aggregate reports or introduce a 'suite' on the fly?
Andreas Pakulat
2018-03-12 16:14:32 UTC
Permalink
Hi,

I'm running several junit plug-in tests via tycho-surefire and get a separate
junit xml file out of that for each test class that the surefire plugin
found. So each file has a testsuite named after the class and a testcase
named after the corresponding method.

I'm looking into a way to have these 'grouped' or 'aggregated' such that the
reports are all having a common 'root' testsuite that corresponds to the test
plug-in. It does not really matter if the report files are aggregated into a
single one or each xml report file just has another testsuite-element
wrapping the current content.

Does anybody here know a way to do this with tycho-surefire? Having a
dedicated testsuite-class per plug-in with a fixed list of all test classes
is not really an option, I've had that in the past and new classes where
always forgotten to be added there. I found some hints that it might be
possible to have the list of test-classes of a junit testsuite class
generated during runtime, but I'd like to avoid stepping into the reflection
api for this if possible.

Andreas
--
Andreas Pakulat ***@froglogic.com
froglogic GmbH - Automated UI and Web Testing
Andreas Pakulat
2018-03-13 21:17:02 UTC
Permalink
Hi,
Post by Andreas Pakulat
Hi,
I'm running several junit plug-in tests via tycho-surefire and get a
separate junit xml file out of that for each test class that the surefire
plugin found. So each file has a testsuite named after the class and a
testcase named after the corresponding method.
I'm looking into a way to have these 'grouped' or 'aggregated' such that the
reports are all having a common 'root' testsuite that corresponds
to the test plug-in. It does not really matter if the report files are
aggregated into a single one or each xml report file just has another
testsuite-element wrapping the current content.
Does anybody here know a way to do this with tycho-surefire? Having a
dedicated testsuite-class per plug-in with a fixed list of all test
classes is not really an option, I've had that in the past and new classes
where always forgotten to be added there. I found some hints that
it might be possible to have the list of test-classes of a junit testsuite
class generated during runtime, but I'd like to avoid stepping into
the reflection api for this if possible.
For the sake of archiving: I ended up using the xml-maven-plugin and an XSLT
stylesheet to adjust the 'name' attribute of the toplevel testsuite element
in the xml files to the 'group' name, such that all of the xml files in the
test-plugin have the same testsuite name. That turned out to be sufficient
for the application analyzing and rendering the results from the junit
reports.

Andreas
--
Andreas Pakulat ***@froglogic.com
froglogic GmbH - Automated UI and Web Testing
Loading...