首页 > 解决方案 > 黄瓜重新运行失败的测试 java jenkins

问题描述

如何在使用 maven-failsafe-plugin 重新运行失败测试之前清理黄瓜 report.json?

我使用 jenkins + maven + cucumber-jvm-parallel-plugin + maven-failsafe-plugin。如果使用 maven-failsafe-plugin 重试:

<rerunFailingTestsCount>${rerunFailingTestsCount}</rerunFailingTestsCount>

它工作得很好,但如果 rerunFailingTestsCount > 0 生成的 report.json(1.json, 2.json, 3.json) 是空的,因为重新运行黄瓜测试只会清除没有人口的报告。

空的黄瓜报告(report.json)是黄瓜报告插件[ https://wiki.jenkins.io/display/JENKINS/Cucumber+Reports+Plugin]生成报告失败的原因,但以下例外:

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]

标签: cucumbercucumber-jvmcucumber-javamaven-failsafe-plugin

解决方案


推荐阅读