How to clean cucumber report.json before rerun failed test with using maven-failsafe-plugin?
I use jenkins + maven + cucumber-jvm-parallel-plugin + maven-failsafe-plugin. In case of using retry of maven-failsafe-plugin:
<rerunFailingTestsCount>${rerunFailingTestsCount}</rerunFailingTestsCount>
It works pretty well, but in case of rerunFailingTestsCount > 0 the generated report.json(1.json, 2.json, 3.json) is empty, because rerunning cucumber test only cleans report without population.
The empty cucumber report(report.json) is the reason of failing generation report by Cucumber Reports Plugin [https://wiki.jenkins.io/display/JENKINS/Cucumber+Reports+Plugin] with the following exception:
net.masterthought.cucumber.ValidationException: File '<real_path>\1.json' is not proper Cucumber report!
at net.masterthought.cucumber.ReportParser.parseForFeature(ReportParser.java:90)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
at [Source: (InputStreamReader); line: 1, column: 0]