Skip to content

Commit 99f5cfc

Browse files
committed
display test plan summary
1 parent 6f21d06 commit 99f5cfc

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "/test: display test plan summary in chat after generating tests"
4+
}

packages/core/src/amazonqTest/chat/controller/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ export class TestController {
653653
tabID: data.tabID,
654654
messageType: 'answer',
655655
codeGenerationId: '',
656-
message: `Please see the unit tests generated below. Click View diff to review the changes in the code editor.`,
656+
message: `${session.jobSummary}\n\n Please see the unit tests generated below. Click "View diff" to review the changes in the code editor.`,
657657
canBeVoted: true,
658658
messageId: '',
659659
followUps,

packages/core/src/amazonqTest/chat/session/session.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export class Session {
4343
public fileLanguage: string | undefined = 'plaintext'
4444
public stopIteration: boolean = false
4545
public targetFileInfo: TargetFileInfo | undefined
46+
public jobSummary: string = ''
4647

4748
// Telemetry
4849
public testGenerationStartTime: number = 0

packages/core/src/codewhisperer/service/testGenHandler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ export async function pollTestJobStatus(
155155
status: 'InProgress',
156156
progressRate,
157157
})
158+
const jobSummary = resp.testGenerationJob?.jobSummary ?? ''
159+
const jobSummaryNoBackticks = jobSummary.replace(/^`+|`+$/g, '')
160+
ChatSessionManager.Instance.getSession().jobSummary = jobSummaryNoBackticks
158161
const packageInfoList = resp.testGenerationJob?.packageInfoList ?? []
159162
const packageInfo = packageInfoList[0]
160163
const targetFileInfo = packageInfo?.targetFileInfoList?.[0]

0 commit comments

Comments
 (0)