Skip to content

Commit

Permalink
fix(amazonq): skip tests locally (aws#6658)
Browse files Browse the repository at this point in the history
## Problem

When users choose to skip tests, we were skipping them on our server by
passing in their choice to our backend, but we weren't also skipping
them locally.


## Solution

Tell Maven to use `-DskipTests`

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

Co-authored-by: David Hasani <[email protected]>
  • Loading branch information
dhasani23 and David Hasani authored Feb 24, 2025
1 parent 91a54b0 commit 4421290
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "/transform: skip running tests locally when user chooses to do so"
}
1 change: 1 addition & 0 deletions packages/amazonq/test/e2e/amazonq/transformByQ.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ describe('Amazon Q Code Transformation', function () {
const tmpDir = (await TestFolder.create()).path

transformByQState.setSummaryFilePath(path.join(tmpDir, 'summary.md'))
transformByQState.setToPartiallySucceeded()

transformByQState
.getChatMessenger()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ export class Messenger {
title: CodeWhispererConstants.skipUnitTestsFormTitle,
mandatory: true,
options: [
{
value: CodeWhispererConstants.runUnitTestsMessage,
label: CodeWhispererConstants.runUnitTestsMessage,
},
{
value: CodeWhispererConstants.skipUnitTestsMessage,
label: CodeWhispererConstants.skipUnitTestsMessage,
},
{
value: CodeWhispererConstants.runUnitTestsMessage,
label: CodeWhispererConstants.runUnitTestsMessage,
},
],
})

Expand Down Expand Up @@ -533,7 +533,7 @@ export class Messenger {
})
}

if (transformByQState.getSummaryFilePath()) {
if (transformByQState.isPartiallySucceeded() || transformByQState.isSucceeded()) {
buttons.push({
keepCardAfterClick: true,
text: CodeWhispererConstants.viewSummaryButtonText,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ function installProjectDependencies(dependenciesFolder: FolderInfo, modulePath:

// Note: IntelliJ runs 'clean' separately from 'install'. Evaluate benefits (if any) of this.
const args = [`-Dmaven.repo.local=${dependenciesFolder.path}`, 'clean', 'install', '-q']

if (transformByQState.getCustomBuildCommand() === CodeWhispererConstants.skipUnitTestsBuildCommand) {
args.push('-DskipTests')
}

let environment = process.env

if (transformByQState.getJavaHome() !== undefined) {
Expand Down

0 comments on commit 4421290

Please sign in to comment.