@@ -813,11 +813,7 @@ class CodeTestChatController(
813813                        generatedLinesCount =  session.linesOfCodeGenerated?.toLong(),
814814                        acceptedCharactersCount =  session.charsOfCodeGenerated?.toLong(),
815815                        generatedCharactersCount =  session.charsOfCodeGenerated?.toLong(),
816-                         result =  if  (buildResult) {
817-                             MetricResult .Succeeded 
818-                         } else  {
819-                             MetricResult .Failed 
820-                         },
816+                         result =  MetricResult .Failed ,
821817                        perfClientLatency =  session.latencyOfTestGeneration,
822818                        isCodeBlockSelected =  session.isCodeBlockSelected,
823819                        artifactsUploadDuration =  session.artifactUploadDuration,
@@ -930,11 +926,7 @@ class CodeTestChatController(
930926                        generatedLinesCount =  session.linesOfCodeGenerated?.toLong(),
931927                        acceptedCharactersCount =  0 ,
932928                        generatedCharactersCount =  session.charsOfCodeGenerated?.toLong(),
933-                         result =  if  (buildResult) {
934-                             MetricResult .Succeeded 
935-                         } else  {
936-                             MetricResult .Failed 
937-                         },
929+                         result =  MetricResult .Succeeded ,
938930                        perfClientLatency =  session.latencyOfTestGeneration,
939931                        isCodeBlockSelected =  session.isCodeBlockSelected,
940932                        artifactsUploadDuration =  session.artifactUploadDuration,
@@ -968,11 +960,7 @@ class CodeTestChatController(
968960                    generatedLinesCount =  session.linesOfCodeGenerated?.toLong(),
969961                    acceptedCharactersCount =  session.charsOfCodeGenerated?.toLong(),
970962                    generatedCharactersCount =  session.charsOfCodeGenerated?.toLong(),
971-                     result =  if  (buildResult) {
972-                         MetricResult .Succeeded 
973-                     } else  {
974-                         MetricResult .Failed 
975-                     },
963+                     result =  MetricResult .Failed ,
976964                    perfClientLatency =  session.latencyOfTestGeneration,
977965                    isCodeBlockSelected =  session.isCodeBlockSelected,
978966                    artifactsUploadDuration =  session.artifactUploadDuration,
@@ -1030,7 +1018,6 @@ class CodeTestChatController(
10301018                            canBeVoted =  false 
10311019                        )
10321020                    )
1033-                     buildResult =  true 
10341021                    AmazonqTelemetry .unitTestGeneration(
10351022                        count =  session.iteration.toLong() -  1 ,
10361023                        cwsprChatProgrammingLanguage =  session.programmingLanguage.languageId,
@@ -1045,11 +1032,7 @@ class CodeTestChatController(
10451032                        generatedLinesCount =  session.linesOfCodeGenerated?.toLong(),
10461033                        acceptedCharactersCount =  session.charsOfCodeGenerated?.toLong(),
10471034                        generatedCharactersCount =  session.charsOfCodeGenerated?.toLong(),
1048-                         result =  if  (buildResult) {
1049-                             MetricResult .Succeeded 
1050-                         } else  {
1051-                             MetricResult .Failed 
1052-                         },
1035+                         result =  MetricResult .Succeeded ,
10531036                        perfClientLatency =  session.latencyOfTestGeneration,
10541037                        isCodeBlockSelected =  session.isCodeBlockSelected,
10551038                        artifactsUploadDuration =  session.artifactUploadDuration,
@@ -1091,60 +1074,7 @@ class CodeTestChatController(
10911074
10921075                    return 
10931076                }
1094- //                 taskContext.progressStatus = BuildAndExecuteProgressStatus.RUN_EXECUTION_TESTS
1095- //                 updateBuildAndExecuteProgressCard(taskContext.progressStatus, messageId, session.iteration)
1096- // 
1097- //                 val testLogsFile = VirtualFileManager.getInstance().findFileByNioPath(
1098- //                     withContext(currentCoroutineContext()) {
1099- //                         Files.createTempFile(null, null)
1100- //                     }
1101- //                 )
1102- //                 if (testLogsFile == null) {
1103- //                     // TODO: handle no log file case
1104- //                     return
1105- //                 }
1106- //                 LOG.debug {
1107- //                     "Q TestGen session: ${codeTestChatHelper.getActiveCodeTestTabId()}: " +
1108- //                         "tmpFile for test logs:\n ${buildLogsFile.path}"
1109- //                 }
1110- //                 delay(1000)
1111- //                 runBuildOrTestCommand(taskContext.executionCommand, testLogsFile, context.project, isBuildCommand = false, taskContext)
1112- //                 while (taskContext.testExitCode < 0) {
1113- //                     // wait until test command finished
1114- //                     delay(1000)
1115- //                 }
1116- // 
1117- //                 if (taskContext.testExitCode == 0) {
1118- //                     taskContext.progressStatus = BuildAndExecuteProgressStatus.TESTS_EXECUTED
1119- //                     updateBuildAndExecuteProgressCard(taskContext.progressStatus, messageId, session.iteration)
1120- //                     codeTestChatHelper.addAnswer(
1121- //                         CodeTestChatMessageContent(
1122- //                             message = message("testgen.message.success"),
1123- //                             type = ChatMessageType.Answer,
1124- //                             canBeVoted = false
1125- //                         )
1126- //                     )
1127- //                     // sessionCleanUp(message.tabId)
1128- //                     return
1129- //                 }
1130- // 
1131- //                 // has test failure, we will zip the latest project and invoke backend again
1132- //                 taskContext.progressStatus = BuildAndExecuteProgressStatus.FIXING_TEST_CASES
1133- //                 val buildAndExecuteMessageId = updateBuildAndExecuteProgressCard(taskContext.progressStatus, messageId, session.iteration)
1134- // 
1135- //                 val previousUTGIterationContext = PreviousUTGIterationContext(
1136- //                     buildLogFile = buildLogsFile,
1137- //                     testLogFile = testLogsFile,
1138- //                     selectedFile = session.selectedFile,
1139- //                     buildAndExecuteMessageId = buildAndExecuteMessageId
1140- //                 )
1141- // 
1142- //                 val job = CodeWhispererUTGChatManager.getInstance(context.project).generateTests("", codeTestChatHelper, previousUTGIterationContext, null)
1143- //                 job?.join()
1144- // 
1145- //                 taskContext.progressStatus = BuildAndExecuteProgressStatus.PROCESS_TEST_RESULTS
1146- //                 // session.iteration already updated in generateTests
1147- //                 updateBuildAndExecuteProgressCard(taskContext.progressStatus, messageId, session.iteration - 1)
1077+                 //  TO-DO ADD execute loop in the furture
11481078            }
11491079            " utg_modify_command"   ->  {
11501080                //  TODO allow user input to modify the command
0 commit comments