@@ -169,11 +169,11 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
169
169
session.testGenerationJob = job.testGenerationJobId()
170
170
throwIfCancelled(session)
171
171
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
173
173
var finished = false
174
174
var testGenerationResponse: GetTestGenerationResponse ? = null
175
175
176
- var packageInfoList = PackageInfoList ()
176
+ var packageInfoList: List < software.amazon.awssdk.services.codewhispererruntime.model. PackageInfo > = emptyList ()
177
177
LOG .debug {
178
178
" Q TestGen session: ${codeTestChatHelper.getActiveCodeTestTabId()} : " +
179
179
" polling result for id: ${job.testGenerationJobId()} , group name: ${job.testGenerationJobGroupName()} , " +
@@ -191,7 +191,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
191
191
" Test generation completed, package info: ${testGenerationResponse.testGenerationJob().packageInfoList()} "
192
192
}
193
193
finished = true
194
- var packageInfoList = testGenerationResponse.testGenerationJob().packageInfoList()
194
+ packageInfoList = testGenerationResponse.testGenerationJob().packageInfoList()
195
195
val packageInfo = packageInfoList.firstOrNull()
196
196
val targetFileInfo = packageInfo?.targetFileInfoList()?.firstOrNull()
197
197
if (packageInfo != null && targetFileInfo != null ) {
@@ -247,7 +247,7 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
247
247
" Test generation failed, package info: ${testGenerationResponse.testGenerationJob().packageInfoList()} "
248
248
}
249
249
250
- val packageInfoList = testGenerationResponse.testGenerationJob().packageInfoList()
250
+ packageInfoList = testGenerationResponse.testGenerationJob().packageInfoList()
251
251
val packageInfo = packageInfoList.firstOrNull()
252
252
val targetFileInfo = packageInfo?.targetFileInfoList()?.firstOrNull()
253
253
@@ -263,10 +263,6 @@ class CodeWhispererUTGChatManager(val project: Project, private val cs: Coroutin
263
263
)
264
264
}
265
265
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.
270
266
throw CodeTestException (
271
267
" TestGenFailedError: " + message(" testgen.message.failed" ),
272
268
" TestGenFailedError" ,
0 commit comments