Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Update exit code reporting (#536)" #572

Merged
merged 1 commit into from
Jun 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions test_runner/src/main/kotlin/ftl/reports/util/ReportManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,16 @@ 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
).map {
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) }
Expand All @@ -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(
Expand Down