trivago / cluecumber

Clear and concise reporting for the Cucumber BDD JSON format.
https://www.softwaretester.blog
Apache License 2.0
271 stars 88 forks source link

Display report after failed test #287

Closed Jtejero11 closed 2 years ago

Jtejero11 commented 2 years ago

Describe the bug Launching the report via pipeline using mvn verify, I have noticed that if any test fails, then the plugin does not run, which I think is due to

    "<execution>
        <id>report</id>
        <phase>post-integration-test</phase>
        <goals>
            <goal>reporting</goal>
        </goals>
    </execution>"

Is it the expected behavior or can I configure it in another way to be able to do it?

Expected behavior I would like the report to be displayed even if tests fail using mvn verify. (Launching the command: mvn cluecumber-report:reporting afterwards does work, but the problem is that if the tests pass, the command would be executed twice)

bischoffdev commented 2 years ago

This has been discussed multiple times already, e.g. here https://github.com/trivago/cluecumber-report-plugin/issues/251

It depends on your Maven setup. If you run with verify which verifies your build based on the test results. It will fail when the tests fail. This means everything after it is not executed anymore.

So you can

  • set up your Maven configuration so that it ignores the failed tests (this will run everything but pass the build everytime)
  • or invoke the reporting goal in a separate Maven command after running the tests
  • or ignore the failing tests but let a Maven enforcer rule check your build as the final step (we do that here based on the > failsafe result xml files)