From 0b47f6549aa39d487a561245d6ca6f77dc05607f Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Fri, 28 Jun 2019 12:49:59 -0400 Subject: [PATCH] Revert "Update exit code reporting (#536)" This reverts commit bd6e444bb95f9b05a6a28755948acec459a81f70. --- .../main/kotlin/ftl/reports/util/ReportManager.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test_runner/src/main/kotlin/ftl/reports/util/ReportManager.kt b/test_runner/src/main/kotlin/ftl/reports/util/ReportManager.kt index 0f3746bf03..115be5fa2f 100644 --- a/test_runner/src/main/kotlin/ftl/reports/util/ReportManager.kt +++ b/test_runner/src/main/kotlin/ftl/reports/util/ReportManager.kt @@ -97,6 +97,8 @@ object ReportManager { val useFlakyTests = args.flakyTestAttempts > 0 if (useFlakyTests) JUnitDedupe.modify(testSuite) + val testSuccessful = if (useFlakyTests) testSuite?.successful() ?: false else matrices.allSuccessful() + listOf( CostReport, MatrixResultsReport @@ -104,7 +106,7 @@ object ReportManager { it.run(matrices, testSuite, printToStdout = true, args = args) } - if (matrices.allSuccessful().not()) { + if (!testSuccessful) { listOf( HtmlErrorReport ).map { it.run(matrices, testSuite, printToStdout = false, args = args) } @@ -113,7 +115,14 @@ object ReportManager { JUnitReport.run(matrices, testSuite, printToStdout = false, args = args) processJunitXml(testSuite, args, testShardChunks) - return matrices.exitCode() + // FTL has a bug with matrix roll-up when using flakyTestAttempts + // as a work around, we calculate the success based on JUnit XML results. + val exitCode = if (useFlakyTests) { + if (testSuccessful) 0 else 1 + } else { + matrices.exitCode() + } + return exitCode } data class ShardEfficiency(