From 731a5c17e71ff3edb7264308a4b5479c82eac439 Mon Sep 17 00:00:00 2001 From: pawelpasterz <32893017+pawelpasterz@users.noreply.github.com> Date: Mon, 2 Aug 2021 09:32:55 +0200 Subject: [PATCH] Get apk details with retry (#2113) --- test_runner/src/main/kotlin/ftl/client/google/AppDetails.kt | 3 ++- test_runner/src/test/kotlin/ftl/run/TestRunnerTest.kt | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test_runner/src/main/kotlin/ftl/client/google/AppDetails.kt b/test_runner/src/main/kotlin/ftl/client/google/AppDetails.kt index bc5af5d6fe..18df37007d 100644 --- a/test_runner/src/main/kotlin/ftl/client/google/AppDetails.kt +++ b/test_runner/src/main/kotlin/ftl/client/google/AppDetails.kt @@ -1,7 +1,8 @@ package ftl.client.google import com.google.testing.model.FileReference +import ftl.http.executeWithRetry fun getAndroidAppDetails(gcsAppPath: String): String = GcTesting.get.ApplicationDetailService().getApkDetails(FileReference().apply { gcsPath = gcsAppPath }) - .execute()?.apkDetail?.apkManifest?.packageName?.toString().orEmpty() + .executeWithRetry()?.apkDetail?.apkManifest?.packageName?.toString().orEmpty() diff --git a/test_runner/src/test/kotlin/ftl/run/TestRunnerTest.kt b/test_runner/src/test/kotlin/ftl/run/TestRunnerTest.kt index 7e45286065..4ac1bce5ca 100644 --- a/test_runner/src/test/kotlin/ftl/run/TestRunnerTest.kt +++ b/test_runner/src/test/kotlin/ftl/run/TestRunnerTest.kt @@ -11,6 +11,7 @@ import ftl.adapter.google.getFilePathToDownload import ftl.api.Artifacts.DownloadPath import ftl.args.AndroidArgs import ftl.args.IosArgs +import ftl.client.google.getAndroidAppDetails import ftl.http.executeWithRetry import ftl.test.util.FlankTestRunner import ftl.test.util.LocalGcs @@ -162,6 +163,11 @@ class TestRunnerTest { getMockedTestMatrix().apply { state = "RUNNING" }, getMockedTestMatrix() ) + mockkStatic("ftl.client.google.AppDetailsKt") + every { + getAndroidAppDetails(any()) + } returns "" + runBlocking { localConfig.newTestRun() }