Closed justinmk3 closed 1 week ago
Looks like there is a race with https://github.com/aws/aws-toolkit-vscode/blob/a124aa6f5349fa2421df4efe32473881a1e93613/packages/core/src/test/codewhisperer/commands/transformByQ.test.ts#L83
2 failing
1) submitFeedbackListener
submits Amazon Q feedback, disposes, and shows message on success:
AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
{
+ comment: 'comment\n\nQ CodeTransform jobId: abc-123',
- comment: 'comment',
sentiment: 'Positive'
}
+ expected - actual
{
- "comment": "comment\n\nQ CodeTransform jobId: abc-123"
+ "comment": "comment"
"sentiment": "Positive"
}
at Context.<anonymous> (src/test/feedback/commands/submitFeedbackListener.test.ts:40:20)
2) submitFeedbackListener
submits AWS Toolkit feedback, disposes, and shows message on success:
AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
{
+ comment: 'comment\n' +
+ '\n' +
+ 'Q CodeTransform jobId: abc-123\n' +
+ '\n' +
+ 'Q CodeTransform jobId: abc-123\n' +
+ '\n' +
+ 'Q CodeTransform jobId: abc-123',
- comment: 'comment',
sentiment: 'Positive'
}
+ expected - actual
{
- "comment": "comment\n\nQ CodeTransform jobId: abc-123\n\nQ CodeTransform jobId: abc-123\n\nQ CodeTransform jobId: abc-123"
+ "comment": "comment"
"sentiment": "Positive"
}
at Context.<anonymous> (src/test/feedback/commands/submitFeedbackListener.test.ts:40:20)
Problem:
unreliable test:
This is because of a race: CodeTransform sets a global "jobId", which may be used by the feedback form, which causes unexpected results in the feedback tests.
Solution:
Remove random CodeTransform special-case from
FeedbackWebview
.License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.