Skip to content

Commit 485b96a

Browse files
author
David Hasani
committed
fix e2e test and prettier
1 parent 4d5230e commit 485b96a

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

packages/amazonq/test/e2e/amazonq/transformByQ.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ describe('Amazon Q Code Transformation', function () {
150150
waitIntervalInMs: 1000,
151151
})
152152

153+
// Add this back when custom 1P upgrades support is ready
154+
/*
153155
const customDependencyVersionPrompt = tab.getChatItems().pop()
154156
assert.strictEqual(
155157
customDependencyVersionPrompt?.body?.includes('You can optionally upload a YAML file'),
@@ -162,13 +164,15 @@ describe('Amazon Q Code Transformation', function () {
162164
waitTimeoutInMs: 5000,
163165
waitIntervalInMs: 1000,
164166
})
167+
*/
165168

166169
const sourceJdkPathPrompt = tab.getChatItems().pop()
167170
assert.strictEqual(sourceJdkPathPrompt?.body?.includes('Enter the path to JDK 8'), true)
168171

169172
tab.addChatMessage({ prompt: '/dummy/path/to/jdk8' })
173+
170174
// 2 additional chat messages get sent after JDK path submitted; wait for both of them
171-
await tab.waitForEvent(() => tab.getChatItems().length > 15, {
175+
await tab.waitForEvent(() => tab.getChatItems().length > 13, {
172176
waitTimeoutInMs: 5000,
173177
waitIntervalInMs: 1000,
174178
})
@@ -190,7 +194,7 @@ describe('Amazon Q Code Transformation', function () {
190194
text: 'View summary',
191195
})
192196

193-
await tab.waitForEvent(() => tab.getChatItems().length > 16, {
197+
await tab.waitForEvent(() => tab.getChatItems().length > 14, {
194198
waitTimeoutInMs: 5000,
195199
waitIntervalInMs: 1000,
196200
})

packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,7 @@ export async function getTransformationPlan(jobId: string, profile: RegionProfil
645645
}
646646
}
647647

648-
export async function getTransformationSteps(
649-
jobId: string,
650-
profile: RegionProfile | undefined
651-
) {
648+
export async function getTransformationSteps(jobId: string, profile: RegionProfile | undefined) {
652649
try {
653650
const response = await codeWhisperer.codeWhispererClient.codeModernizerGetCodeTransformationPlan({
654651
transformationJobId: jobId,
@@ -901,7 +898,12 @@ export async function downloadResultArchive(jobId: string, pathToArchive: string
901898
exportId: jobId,
902899
exportIntent: ExportIntent.TRANSFORMATION,
903900
}
904-
await downloadExportResultArchive(cwStreamingClient, args, pathToArchive, AuthUtil.instance.regionProfileManager.activeRegionProfile)
901+
await downloadExportResultArchive(
902+
cwStreamingClient,
903+
args,
904+
pathToArchive,
905+
AuthUtil.instance.regionProfileManager.activeRegionProfile
906+
)
905907
} catch (e: any) {
906908
getLogger().error(`CodeTransformation: ExportResultArchive error = %O`, e)
907909
throw e

packages/core/src/codewhisperer/service/transformByQ/transformationHubViewProvider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
329329
transformByQState.isRunning()
330330
) {
331331
try {
332-
planSteps = await getTransformationSteps(transformByQState.getJobId(), AuthUtil.instance.regionProfileManager.activeRegionProfile)
332+
planSteps = await getTransformationSteps(
333+
transformByQState.getJobId(),
334+
AuthUtil.instance.regionProfileManager.activeRegionProfile
335+
)
333336
transformByQState.setPlanSteps(planSteps)
334337
} catch (e: any) {
335338
// no-op; re-use current plan steps and try again in next polling cycle

0 commit comments

Comments
 (0)