From b46708d0e558c474dfa0abc216f80287cd35cabc Mon Sep 17 00:00:00 2001 From: Rd Date: Fri, 19 Jul 2024 22:06:27 +0530 Subject: [PATCH] Moving the file test target list implementation into script bg coroutine dispatcher --- .../ci/RetrieveChangedFilesTestTargets.kt | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/src/java/org/oppia/android/scripts/ci/RetrieveChangedFilesTestTargets.kt b/scripts/src/java/org/oppia/android/scripts/ci/RetrieveChangedFilesTestTargets.kt index ab0e1b29b1b..c6de06476aa 100644 --- a/scripts/src/java/org/oppia/android/scripts/ci/RetrieveChangedFilesTestTargets.kt +++ b/scripts/src/java/org/oppia/android/scripts/ci/RetrieveChangedFilesTestTargets.kt @@ -52,20 +52,21 @@ fun main(args: Array) { CommandExecutorImpl( scriptBgDispatcher, processTimeout = 5, processTimeoutUnit = TimeUnit.MINUTES ) - } - val bazelClient = BazelClient(rootDirectory, commandExecutor) + val bazelClient = BazelClient(rootDirectory, commandExecutor) - val changedFilesBucket = - ChangedFilesBucket.getDefaultInstance().mergeFromCompressedBase64(protoBase64) - bucketNameOutputFile.printWriter().use { writer -> - writer.println(changedFilesBucket.cacheBucketName) - } + val changedFilesBucket = + ChangedFilesBucket.getDefaultInstance().mergeFromCompressedBase64(protoBase64) + bucketNameOutputFile.printWriter().use { writer -> + writer.println(changedFilesBucket.cacheBucketName) + } + + val changedFilesTestTargets = bazelClient.retrieveBazelTargets(changedFilesBucket.changedFilesList) + println("Changed Files Test Targets: $changedFilesTestTargets") - val changedFilesTestTargets = bazelClient.retrieveBazelTargets(changedFilesBucket.changedFilesList) - println("Changed Files Test Targets: $changedFilesTestTargets") + fileTestTargetsListOutputFile.printWriter().use { writer -> + writer.println(changedFilesTestTargets.joinToString(separator = " ")) + } - fileTestTargetsListOutputFile.printWriter().use { writer -> - writer.println(changedFilesTestTargets.joinToString(separator = " ")) } }