Skip to content

Commit 635fc38

Browse files
committed
Modifying the UX according to the requirement of V1 version of build and execute.
1 parent be6d072 commit 635fc38

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

packages/core/src/amazonqTest/models/constants.ts

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@ const checkIcons = {
9090
done: '<span style="color: green;">&#10004;</span>',
9191
error: '&#10060;',
9292
}
93-
93+
// TODO: Commenting out this code to do a better UX in the V2 version after science support
94+
/*
9495
interface StepStatus {
9596
step: TestGenerationBuildStep
9697
status: 'wait' | 'current' | 'done' | 'error'
9798
}
9899
99100
const stepStatuses: StepStatus[] = []
100-
101+
*/
101102
export const testGenBuildProgressMessage = (currentStep: TestGenerationBuildStep, status?: string) => {
102103
const session = ChatSessionManager.Instance.getSession()
103104
let message = `Sure. This may take a few minutes and I'll update the progress here.\n
@@ -107,6 +108,21 @@ export const testGenBuildProgressMessage = (currentStep: TestGenerationBuildStep
107108
return message.trim()
108109
}
109110

111+
if (currentStep === TestGenerationBuildStep.RUN_BUILD) {
112+
message += `${checkIcons['wait']} Project compiling\n\n`
113+
}
114+
if (currentStep === TestGenerationBuildStep.FIXING_TEST_CASES && session.buildStatus === BuildStatus.FAILURE) {
115+
message += `${checkIcons['wait']} Fixing test failures\n\n`
116+
} else if (
117+
currentStep >= TestGenerationBuildStep.FIXING_TEST_CASES &&
118+
session.buildStatus === BuildStatus.FAILURE
119+
) {
120+
message += `${checkIcons['done']} Fixed test failures\n\n`
121+
}
122+
if (currentStep > TestGenerationBuildStep.RUN_BUILD && session.buildStatus === BuildStatus.SUCCESS) {
123+
message += `${checkIcons['done']} Project compiled\n${checkIcons['done']} All tests passed\n\n`
124+
}
125+
/*
110126
updateStepStatuses(currentStep, status)
111127
112128
if (currentStep >= TestGenerationBuildStep.RUN_BUILD) {
@@ -135,15 +151,15 @@ export const testGenBuildProgressMessage = (currentStep: TestGenerationBuildStep
135151
) {
136152
message += `${checkIcons['done']} Fixed test failures\n\n`
137153
}
138-
154+
*/
139155
if (currentStep > TestGenerationBuildStep.PROCESS_TEST_RESULTS && session.buildStatus === BuildStatus.FAILURE) {
140156
message += `**Results**\n
141157
Amazon Q executed the tests and identified at least one failure. Below are the suggested fixes.\n\n`
142158
}
143159

144160
return message.trim()
145161
}
146-
162+
/*
147163
const updateStepStatuses = (currentStep: TestGenerationBuildStep, status?: string) => {
148164
const session = ChatSessionManager.Instance.getSession()
149165
for (let step = TestGenerationBuildStep.INSTALL_DEPENDENCIES; step <= currentStep; step++) {
@@ -176,3 +192,4 @@ const getIconForStep = (step: TestGenerationBuildStep) => {
176192
const stepStatus = stepStatuses.find((s) => s.step === step)
177193
return stepStatus ? checkIcons[stepStatus.status] : checkIcons.wait
178194
}
195+
*/

0 commit comments

Comments
 (0)