Skip to content

Commit 7eb362f

Browse files
committed
address comment
1 parent 937e251 commit 7eb362f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/CodeWhispererUTGChatManager.kt

+4-8
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
169169
session.testGenerationJob = job.testGenerationJobId()
170170
throwIfCancelled(session)
171171

172-
// 3rd API call: Step 3: Polling mechanism on test job status with getTestGenStatus getTestGeneration
172+
// 3rd API call: Step 3: Polling mechanism on test job status with getTestGenStatus getTestGeneration
173173
var finished = false
174174
var testGenerationResponse: GetTestGenerationResponse? = null
175175

176-
var packageInfoList = PackageInfoList()
176+
var packageInfoList: List<software.amazon.awssdk.services.codewhispererruntime.model.PackageInfo> = emptyList()
177177
LOG.debug {
178178
"Q TestGen session: ${codeTestChatHelper.getActiveCodeTestTabId()}: " +
179179
"polling result for id: ${job.testGenerationJobId()}, group name: ${job.testGenerationJobGroupName()}, " +
@@ -191,7 +191,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
191191
"Test generation completed, package info: ${testGenerationResponse.testGenerationJob().packageInfoList()}"
192192
}
193193
finished = true
194-
var packageInfoList = testGenerationResponse.testGenerationJob().packageInfoList()
194+
packageInfoList = testGenerationResponse.testGenerationJob().packageInfoList()
195195
val packageInfo = packageInfoList.firstOrNull()
196196
val targetFileInfo = packageInfo?.targetFileInfoList()?.firstOrNull()
197197
if (packageInfo != null && targetFileInfo != null) {
@@ -247,7 +247,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
247247
"Test generation failed, package info: ${testGenerationResponse.testGenerationJob().packageInfoList()}"
248248
}
249249

250-
val packageInfoList = testGenerationResponse.testGenerationJob().packageInfoList()
250+
packageInfoList = testGenerationResponse.testGenerationJob().packageInfoList()
251251
val packageInfo = packageInfoList.firstOrNull()
252252
val targetFileInfo = packageInfo?.targetFileInfoList()?.firstOrNull()
253253

@@ -263,10 +263,6 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
263263
)
264264
}
265265

266-
// TO DO
267-
// add TestGenerationJobStatus.STOPPED status
268-
269-
// If job status is Failed and has no ShortAnswer then there might be some issue in the backend.
270266
throw CodeTestException(
271267
"TestGenFailedError: " + message("testgen.message.failed"),
272268
"TestGenFailedError",

0 commit comments

Comments
 (0)