-
Notifications
You must be signed in to change notification settings - Fork 749
test(amazonq): Add E2E tests for Q Chat's /review command #6696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/runIntegrationTests |
| }) | ||
|
|
||
| describe('Quick action availability', () => { | ||
| console.log('running this test') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can remove this
| assert.deepStrictEqual(noFileMessage.type, 'answer') | ||
| assert.deepStrictEqual( | ||
| noFileMessage.body, | ||
| 'Sorry, your current active window is not a source code file. Make sure you select a source file as your primary context.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to see if you can extract text like this out and share it between your src and test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix
| import path from 'path' | ||
|
|
||
| function getWorkspaceFolder(): string { | ||
| return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen a couple teams do the same thing, do we not have a util? Also, we can expect the first workspace folder to load, otherwise the test setup didn't complete successfully
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not able to find the util for this, so I used vscode.workspace.workspaceFolders. You are right that we can expect the workspace to load, I will make a change to reflect that.
| const scanResultBody = await waitForReviewResults(tab) | ||
|
|
||
| const issues = extractAndValidateIssues(scanResultBody) | ||
| assert.deepStrictEqual( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these in some way slightly deterministic? i.e. will we be introducing accidental flake if the backend changes and doesn't emit the right amount of criticals, high, medium, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. Are re-discussing with team, we will change this to only having the critical, rule-based findings that we will not alter. I will make a change for that.
| hasExactlyMatchingSecurityDiagnostic( | ||
| securityDiagnostics, | ||
| 'multilanguage-password', | ||
| 'CWE-798 - Hardcoded credentials', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likewise, will these always be deterministic and return the same responses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will make a change to reflect that.
|
/runIntegrationTests |
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "type": "Test", | |||
| "description": "add Q Chat /review command test coverage" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changelog is not necessary for adding tests.
Problem
/review command functionality lacks end-to-end test coverage.
Solution
Add basic E2E tests for file review, project review, and ignore lines features.
feature/xbranches will not be squash-merged at release time.