Skip to content

Commit e451f5b

Browse files
author
David Hasani
committed
add debug logs temporarily
1 parent 1d1fa50 commit e451f5b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

packages/core/src/codewhisperer/commands/startTransformByQ.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,13 @@ export async function startTransformByQ() {
235235
// step 1: CreateUploadUrl and upload code
236236
const uploadId = await preTransformationUploadCode()
237237

238+
console.log('upload ID = ' + uploadId)
239+
238240
// step 2: StartJob and store the returned jobId in TransformByQState
239241
const jobId = await startTransformationJob(uploadId, transformStartTime)
240242

243+
console.log('jobId =' + jobId)
244+
241245
// step 3 (intermediate step): show transformation-plan.md file
242246
await pollTransformationStatusUntilPlanReady(jobId)
243247

@@ -246,6 +250,7 @@ export async function startTransformByQ() {
246250
} catch (error: any) {
247251
await transformationJobErrorHandler(error)
248252
} finally {
253+
console.log('QCT: in finally block')
249254
await postTransformationJob()
250255
await cleanupTransformationJob()
251256
}
@@ -341,12 +346,14 @@ export async function preTransformationUploadCode() {
341346
const transformZipManifest = new ZipManifest()
342347
// if the user chose to skip unit tests, add the custom build command here
343348
transformZipManifest.customBuildCommand = transformByQState.getCustomBuildCommand()
349+
console.log('QCT: about to zipCode')
344350
const zipCodeResult = await zipCode({
345351
// dependenciesFolder will be undefined for SQL conversions since we don't compileProject
346352
dependenciesFolder: transformByQState.getDependencyFolderInfo(),
347353
projectPath: transformByQState.getProjectPath(),
348354
zipManifest: transformZipManifest,
349355
})
356+
console.log('QCT: done zipping')
350357

351358
const payloadFilePath = zipCodeResult.tempFilePath
352359
const zipSize = zipCodeResult.fileSize

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ export async function zipCode(
381381
}
382382
} catch (e: any) {
383383
getLogger().error(`CodeTransformation: zipCode error = ${e}`)
384+
console.log('QCT: error zipping: ' + e)
384385
throw Error('Failed to zip project')
385386
} finally {
386387
if (logFilePath) {
@@ -409,6 +410,7 @@ export async function startJob(uploadId: string) {
409410
const sourceLanguageVersion = `JAVA_${transformByQState.getSourceJDKVersion()}`
410411
const targetLanguageVersion = `JAVA_${transformByQState.getTargetJDKVersion()}`
411412
try {
413+
console.log('QCT: about to start Job')
412414
const response = await codeWhisperer.codeWhispererClient.codeModernizerStartCodeTransformation({
413415
workspaceState: {
414416
uploadId: uploadId,
@@ -427,6 +429,7 @@ export async function startJob(uploadId: string) {
427429
} catch (e: any) {
428430
const errorMessage = `Starting the job failed due to: ${(e as Error).message}`
429431
getLogger().error(`CodeTransformation: StartTransformation error = ${errorMessage}`)
432+
console.log('QCT: startJob failed: ' + e)
430433
throw new Error(errorMessage)
431434
}
432435
}
@@ -624,6 +627,7 @@ export async function pollTransformationJob(jobId: string, validStates: string[]
624627
transformationJobId: jobId,
625628
})
626629
status = response.transformationJob.status!
630+
console.log('QCT: status = ' + status)
627631
if (CodeWhispererConstants.validStatesForBuildSucceeded.includes(status)) {
628632
jobPlanProgress['buildCode'] = StepProgress.Succeeded
629633
}

packages/core/src/testInteg/globalSetup.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { globals } from '../shared'
2020
// ASSUMPTION: Tests are not run concurrently
2121

2222
let windowPatch: vscode.Disposable
23-
const maxTestDuration = 420_000 // 7 minutes
23+
const maxTestDuration = 300_000
2424
const globalSandbox = sinon.createSandbox()
2525

2626
export async function mochaGlobalSetup(extensionId: string) {

0 commit comments

Comments
 (0)