Search code examples
mavenmaven-surefire-pluginmaven-failsafe-plugin

Maven surefire plugin output test summary xml?


I am in a project that uses the Surefire and Failsafe maven plugins to run unit and integration tests respectively. The output of failsafe produces a summary of the test run in target/failsafe/failsafe-summary.xml. I would like to get a similar .xml summary report from surefire, however I can only seem to get an xml file per test suite there.

enter image description here

Is it possible to configure surefire to do this?


Solution

  • Is it possible to configure surefire to do this?

    (create 1 report file/run instead of 1/test suite)

    No, not without customizing surefire/surefire-report plugin.

    Since the only (up-to-date) "output related" configuration options (of surefire-plugin:test) are:

    • encoding
    • redirectTestOutputToFile
    • reportFormat (default - "brief", alternatively - "plain" (*.txt files))
    • reportNameSuffix
    • reportsDirectory

    And surefire-report plugin's only purpose is maven report (html!) generation.


    For this special need, I'd recommend a custom script or (maven) plugin (basing on one of the above - they are open source). You can also try "to tackle the problem from source" by combining all of your test classes/suits into one!? :)