1

我们正在使用 protractor-flake 重新运行任何失败的测试。我们正在从 Jenkins 迁移到 TeamCity,并且在重新运行期间测试通过时,测试报告无法按预期工作。

在 Jenkins 中,我们使用了 jasmineReporters.JUnitXmlReporter,它显示了正确的结果,因为失败的测试 xml 将被成功的测试 xml 覆盖。当 Jenkins 处理要报告的 xml 文件时,它使用的是最新的。

在 TeamCity 中,我们正在尝试 jasmineReporters.TeamCityReporter,它似乎一发生就报告测试失败,并且如果重新运行测试通过,它不会更新。我假设这也意味着如果重新运行测试失败,TeamCity 将报告两次失败。查看 teamcity_reporter.js,这似乎是由于 TeamCity 的要求而设计的。

// TeamCity specifies there should only be a single `testFailed`
// message, so we'll only grab the first failedExpectation
if (isFailed(spec) && spec.failedExpectations.length) {
    var failure = spec.failedExpectations[0];
    tclog("testFailed", {
        name: spec.description,
        message: failure.message,
        details: failure.stack
    });
}

有没有人提出解决方案?

4

0 回答 0