diff --git a/packages/core/src/amazonqGumby/chat/controller/controller.ts b/packages/core/src/amazonqGumby/chat/controller/controller.ts index 65deea82b5..36965e7c3e 100644 --- a/packages/core/src/amazonqGumby/chat/controller/controller.ts +++ b/packages/core/src/amazonqGumby/chat/controller/controller.ts @@ -342,12 +342,11 @@ export class GumbyController { private async handleSkipTestsSelection(message: any) { const skipTestsSelection = message.formSelectedValues['GumbyTransformSkipTestsForm'] - if (skipTestsSelection === CodeWhispererConstants.skipIntegrationTestsMessage) { - transformByQState.setCustomBuildCommand(CodeWhispererConstants.skipIntegrationTestsBuildCommand) - } else if (skipTestsSelection === CodeWhispererConstants.skipAllTestsMessage) { - transformByQState.setCustomBuildCommand(CodeWhispererConstants.skipAllTestsBuildCommand) - } else { - transformByQState.setCustomBuildCommand(CodeWhispererConstants.doNotSkipTestsBuildCommand) + // one of these must be true + if (skipTestsSelection === CodeWhispererConstants.skipUnitTestsMessage) { + transformByQState.setCustomBuildCommand(CodeWhispererConstants.skipUnitTestsBuildCommand) + } else if (skipTestsSelection === CodeWhispererConstants.doNotSkipUnitTestsMessage) { + transformByQState.setCustomBuildCommand(CodeWhispererConstants.doNotSkipUnitTestsBuildCommand) } telemetry.codeTransform_submitSelection.emit({ codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId(), diff --git a/packages/core/src/amazonqGumby/chat/controller/messenger/messenger.ts b/packages/core/src/amazonqGumby/chat/controller/messenger/messenger.ts index 595c5fdb56..53bf9e5e49 100644 --- a/packages/core/src/amazonqGumby/chat/controller/messenger/messenger.ts +++ b/packages/core/src/amazonqGumby/chat/controller/messenger/messenger.ts @@ -114,20 +114,16 @@ export class Messenger { formItems.push({ id: 'GumbyTransformSkipTestsForm', type: 'select', - title: CodeWhispererConstants.skipTestsFormTitle, + title: CodeWhispererConstants.skipUnitTestsFormTitle, mandatory: true, options: [ { - value: CodeWhispererConstants.doNotSkipTestsMessage, - label: CodeWhispererConstants.doNotSkipTestsMessage, + value: CodeWhispererConstants.doNotSkipUnitTestsMessage, + label: CodeWhispererConstants.doNotSkipUnitTestsMessage, }, { - value: CodeWhispererConstants.skipIntegrationTestsMessage, - label: CodeWhispererConstants.skipIntegrationTestsMessage, - }, - { - value: CodeWhispererConstants.skipAllTestsMessage, - label: CodeWhispererConstants.skipAllTestsMessage, + value: CodeWhispererConstants.skipUnitTestsMessage, + label: CodeWhispererConstants.skipUnitTestsMessage, }, ], }) @@ -135,7 +131,7 @@ export class Messenger { this.dispatcher.sendAsyncEventProgress( new AsyncEventProgressMessage(tabID, { inProgress: true, - message: CodeWhispererConstants.skipTestsFormMessage, + message: CodeWhispererConstants.skipUnitTestsFormMessage, }) ) @@ -467,8 +463,8 @@ export class Messenger { public sendSkipTestsSelectionMessage(skipTestsSelection: string, tabID: string) { // just for correct grammar let skipTestsText = skipTestsSelection - if (skipTestsText === CodeWhispererConstants.doNotSkipTestsMessage) { - skipTestsText = 'not skip tests' + if (skipTestsText === CodeWhispererConstants.doNotSkipUnitTestsMessage) { + skipTestsText = 'not skip unit tests' } const message = `Ok, I will ${skipTestsText.toLowerCase()} when building your project.` this.dispatcher.sendChatMessage(new ChatMessage({ message, messageType: 'prompt' }, tabID)) diff --git a/packages/core/src/codewhisperer/commands/startTransformByQ.ts b/packages/core/src/codewhisperer/commands/startTransformByQ.ts index d0c232317c..4d3c667f23 100644 --- a/packages/core/src/codewhisperer/commands/startTransformByQ.ts +++ b/packages/core/src/codewhisperer/commands/startTransformByQ.ts @@ -275,7 +275,7 @@ export async function preTransformationUploadCode() { telemetry.record({ codeTransformSessionId: CodeTransformTelemetryState.instance.getSessionId() }) const transformZipManifest = new ZipManifest() - // if the user chose to skip tests, add the flag here + // if the user chose to skip unit tests, add the custom build command here transformZipManifest.customBuildCommand = transformByQState.getCustomBuildCommand() const zipCodeResult = await zipCode({ dependenciesFolder: transformByQState.getDependencyFolderInfo()!, diff --git a/packages/core/src/codewhisperer/models/constants.ts b/packages/core/src/codewhisperer/models/constants.ts index 22bc6149c1..fa6195a2d4 100644 --- a/packages/core/src/codewhisperer/models/constants.ts +++ b/packages/core/src/codewhisperer/models/constants.ts @@ -632,22 +632,18 @@ export const chooseSourceVersionFormTitle = 'Choose the source code version' export const chooseTargetVersionFormTitle = 'Choose the target code version' -export const skipTestsFormTitle = 'Choose to skip tests' +export const skipUnitTestsFormTitle = 'Choose to skip unit tests' -export const skipTestsFormMessage = - "Amazon Q uses 'mvn verify' to build your project. You can skip running tests to reduce the build time." +export const skipUnitTestsFormMessage = + 'I will build your app using `mvn test` by default. If you would like to skip running unit tests to reduce build time, I will use `mvn test-compile`.' -export const doNotSkipTestsMessage = 'Do not skip tests' +export const doNotSkipUnitTestsMessage = 'Do not skip unit tests' -export const doNotSkipTestsBuildCommand = 'verify' +export const doNotSkipUnitTestsBuildCommand = 'test' -export const skipIntegrationTestsMessage = 'Skip integration tests' +export const skipUnitTestsMessage = 'Skip unit tests' -export const skipIntegrationTestsBuildCommand = 'test' - -export const skipAllTestsMessage = 'Skip all tests' - -export const skipAllTestsBuildCommand = 'test-compile' +export const skipUnitTestsBuildCommand = 'test-compile' export const planTitle = 'Code Transformation plan by Amazon Q' diff --git a/packages/core/src/test/codewhisperer/commands/transformByQ.test.ts b/packages/core/src/test/codewhisperer/commands/transformByQ.test.ts index 84b75c7717..dfbbf89aa2 100644 --- a/packages/core/src/test/codewhisperer/commands/transformByQ.test.ts +++ b/packages/core/src/test/codewhisperer/commands/transformByQ.test.ts @@ -203,7 +203,7 @@ describe('transformByQ', function () { assert.deepStrictEqual(actual, expected) }) - it(`WHEN zip created THEN manifest.json contains -DskipTests flag`, async function () { + it(`WHEN zip created THEN manifest.json contains test-compile custom build command`, async function () { const tempFileName = `testfile-${globals.clock.Date.now()}.zip` transformByQState.setProjectPath(tempDir) const transformManifest = new ZipManifest()