diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/CodeWhispererUTGChatManager.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/CodeWhispererUTGChatManager.kt index 8b02c019c21..37cb29a65bf 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/CodeWhispererUTGChatManager.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/CodeWhispererUTGChatManager.kt @@ -55,6 +55,7 @@ import software.aws.toolkits.jetbrains.utils.isQConnected import software.aws.toolkits.resources.message import software.aws.toolkits.telemetry.AmazonqTelemetry import software.aws.toolkits.telemetry.MetricResult +import software.aws.toolkits.telemetry.Status import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream import java.io.File @@ -583,7 +584,8 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin artifactsUploadDuration = session.artifactUploadDuration, buildPayloadBytes = session.srcPayloadSize, buildZipFileBytes = session.srcZipFileSize, - requestId = session.startTestGenerationRequestId + requestId = session.startTestGenerationRequestId, + status = if (e.message == message("testgen.message.cancelled")) Status.CANCELLED else Status.FAILED, ) session.isGeneratingTests = false } finally { diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt index 2807e2cf9c2..d380bbc368c 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt @@ -98,6 +98,7 @@ import software.aws.toolkits.telemetry.AmazonqTelemetry import software.aws.toolkits.telemetry.FeatureId import software.aws.toolkits.telemetry.InteractionType import software.aws.toolkits.telemetry.MetricResult +import software.aws.toolkits.telemetry.Status import software.aws.toolkits.telemetry.UiTelemetry import java.io.File import java.nio.file.Files @@ -310,7 +311,8 @@ class CodeTestChatController( credentialStartUrl = getStartUrl(project), result = MetricResult.Succeeded, perfClientLatency = (Instant.now().toEpochMilli() - session.startTimeOfTestGeneration), - requestId = id + requestId = id, + status = Status.ACCEPTED, ) } session.isGeneratingTests = false @@ -682,7 +684,8 @@ class CodeTestChatController( artifactsUploadDuration = session.artifactUploadDuration, buildPayloadBytes = session.srcPayloadSize, buildZipFileBytes = session.srcZipFileSize, - requestId = session.startTestGenerationRequestId + requestId = session.startTestGenerationRequestId, + status = Status.ACCEPTED, ) codeTestChatHelper.addAnswer( CodeTestChatMessageContent( @@ -878,7 +881,8 @@ class CodeTestChatController( artifactsUploadDuration = session.artifactUploadDuration, buildPayloadBytes = session.srcPayloadSize, buildZipFileBytes = session.srcZipFileSize, - requestId = session.startTestGenerationRequestId + requestId = session.startTestGenerationRequestId, + status = Status.REJECTED, ) sessionCleanUp(message.tabId) }