diff --git a/test_runner/src/main/kotlin/ftl/run/platform/RunAndroidTests.kt b/test_runner/src/main/kotlin/ftl/run/platform/RunAndroidTests.kt index dd01d4e5b3..3770c37779 100644 --- a/test_runner/src/main/kotlin/ftl/run/platform/RunAndroidTests.kt +++ b/test_runner/src/main/kotlin/ftl/run/platform/RunAndroidTests.kt @@ -2,10 +2,12 @@ package ftl.run.platform import com.google.testing.Testing import com.google.testing.model.TestMatrix +import flank.common.join import flank.common.logLn import ftl.args.AndroidArgs import ftl.args.isInstrumentationTest import ftl.args.shardsFilePath +import ftl.config.FtlConstants import ftl.gc.GcAndroidDevice import ftl.gc.GcAndroidTestMatrix import ftl.gc.GcStorage @@ -29,6 +31,7 @@ import ftl.run.platform.common.beforeRunTests import ftl.run.saveShardChunks import ftl.shard.Chunk import ftl.shard.testCases +import ftl.util.saveToFlankLinks import kotlinx.coroutines.Deferred import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async @@ -85,6 +88,13 @@ private fun String.createGcsPath(contextIndex: Int, runIndex: Int) = else "$this/matrix_${contextIndex}_$runIndex/" private fun List.dumpShards(config: AndroidArgs) = takeIf { config.isInstrumentationTest }?.apply { + saveToFlankLinks( + config.shardsFilePath, + FtlConstants.GCS_STORAGE_LINK + join( + config.resultsBucket, + config.resultsDir + ) + ) if (config.testTargetsForShard.isEmpty()) filterIsInstance() .asMatrixTestShards() diff --git a/test_runner/src/main/kotlin/ftl/run/platform/RunIosTests.kt b/test_runner/src/main/kotlin/ftl/run/platform/RunIosTests.kt index ec2404cbb5..c82e12a039 100644 --- a/test_runner/src/main/kotlin/ftl/run/platform/RunIosTests.kt +++ b/test_runner/src/main/kotlin/ftl/run/platform/RunIosTests.kt @@ -1,9 +1,11 @@ package ftl.run.platform +import flank.common.join import flank.common.logLn import ftl.args.IosArgs import ftl.args.isXcTest import ftl.args.shardsFilePath +import ftl.config.FtlConstants import ftl.gc.GcIosMatrix import ftl.gc.GcIosTestMatrix import ftl.gc.GcStorage @@ -20,6 +22,7 @@ import ftl.run.platform.common.beforeRunTests import ftl.run.platform.ios.createIosTestContexts import ftl.shard.testCases import ftl.util.repeat +import ftl.util.saveToFlankLinks import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll @@ -42,7 +45,10 @@ internal suspend fun IosArgs.runIosTests(): TestResult = val additionalIpasGcsFiles = uploadAdditionalIpas() dumpShardsIfXcTest() - + saveToFlankLinks( + shardsFilePath, + FtlConstants.GCS_STORAGE_LINK + join(resultsBucket, resultsDir) + ) val testShardChunks = xcTestRunData.flattenShardChunks() logLn(beforeRunMessage(testShardChunks)) diff --git a/test_runner/src/main/kotlin/ftl/util/Utils.kt b/test_runner/src/main/kotlin/ftl/util/Utils.kt index 6bd3a2d13d..3a6c8455f2 100644 --- a/test_runner/src/main/kotlin/ftl/util/Utils.kt +++ b/test_runner/src/main/kotlin/ftl/util/Utils.kt @@ -5,6 +5,7 @@ package ftl.util import com.fasterxml.jackson.annotation.JsonProperty import flank.common.logLn import ftl.run.exception.FlankGeneralError +import java.io.File import java.io.InputStream import java.time.Instant import java.time.ZoneOffset @@ -114,3 +115,5 @@ fun KMutableProperty.require() = ) fun getGACPathOrEmpty(): String = System.getenv("GOOGLE_APPLICATION_CREDENTIALS").orEmpty() + +fun saveToFlankLinks(vararg links: String) = File("flank-links.log").writeText(links.joinToString(System.lineSeparator()))