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

feat: print the matrices web link at the end of a run #1097

Merged
merged 5 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 0 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 @@ -8,7 +8,6 @@ import ftl.args.ShardChunks
import ftl.gc.GcStorage
import ftl.json.MatrixMap
import ftl.json.isAllSuccessful
import ftl.json.validate
import ftl.reports.CostReport
import ftl.reports.FullJUnitReport
import ftl.reports.HtmlErrorReport
Expand Down Expand Up @@ -117,7 +116,6 @@ object ReportManager {
args.useLegacyJUnitResult -> processJunitXml(testSuite, args, testShardChunks)
else -> processJunitXml(testSuite, args, testShardChunks)
}
matrices.validate(args.ignoreFailedTests)
}

private fun IgnoredTestCases.toJunitTestsResults() = getSkippedJUnitTestSuite(map {
Expand Down
7 changes: 7 additions & 0 deletions test_runner/src/main/kotlin/ftl/run/NewTestRun.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import ftl.args.IArgs
import ftl.args.IosArgs
import ftl.json.SavedMatrix
import ftl.json.updateMatrixMap
import ftl.json.validate
import ftl.reports.util.ReportManager
import ftl.run.common.fetchArtifacts
import ftl.run.common.pollMatrices
import ftl.run.exception.FlankGeneralError
import ftl.run.exception.FlankTimeoutError
import ftl.run.model.TestResult
import ftl.run.platform.common.printMatricesWebLinks
import ftl.run.platform.runAndroidTests
import ftl.run.platform.runIosTests
import kotlinx.coroutines.TimeoutCancellationException
Expand All @@ -25,6 +27,11 @@ suspend fun newTestRun(args: IArgs) = withTimeoutOrNull(args.parsedTimeout) {
cancelTestsOnTimeout(args.project, matrixMap.map) { fetchArtifacts(matrixMap, args) }

ReportManager.generate(matrixMap, args, testShardChunks, ignoredTests)

println()
matrixMap.printMatricesWebLinks(args.project)

matrixMap.validate(args.ignoreFailedTests)
}
}

Expand Down
3 changes: 3 additions & 0 deletions test_runner/src/main/kotlin/ftl/run/RefreshLastRun.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ftl.run.common.updateMatrixFile
import ftl.args.ShardChunks
import ftl.json.needsUpdate
import ftl.json.updateWithMatrix
import ftl.json.validate
import ftl.util.MatrixState
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Dispatchers
Expand All @@ -33,6 +34,8 @@ suspend fun refreshLastRun(currentArgs: IArgs, testShardChunks: ShardChunks) {

// Must generate reports *after* fetching xml artifacts since reports require xml
ReportManager.generate(matrixMap, lastArgs, testShardChunks)

matrixMap.validate(lastArgs.ignoreFailedTests)
}

/** Refresh all in progress matrices in parallel **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private fun saveConfigFile(matrixMap: MatrixMap, args: IArgs) {
Files.write(configFilePath, args.data.toByteArray())
}

private suspend inline fun MatrixMap.printMatricesWebLinks(project: String) = coroutineScope {
internal suspend inline fun MatrixMap.printMatricesWebLinks(project: String) = coroutineScope {
println("Matrices webLink")
map.values.map {
launch(Dispatchers.IO) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ftl.reports.utils
import com.google.common.truth.Truth.assertThat
import ftl.args.AndroidArgs
import ftl.gc.GcStorage
import ftl.json.validate
import ftl.reports.CostReport
import ftl.reports.FullJUnitReport
import ftl.reports.JUnitReport
Expand Down Expand Up @@ -52,6 +53,7 @@ class ReportManagerTest {
every { mockArgs.smartFlankGcsPath } returns ""
every { mockArgs.useLegacyJUnitResult } returns true
ReportManager.generate(matrix, mockArgs, emptyList())
matrix.validate()
}

@Test
Expand Down