Commit c76cded
test(lambda): fix multiple flaky tests (aws#8142)
## Problem
3 flaky appbuilder tests
```
2 failing
1) AppBuilder Walkthrough
Create project
start with an existing template
override existing template
download serverlessland proj:
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected
+ 'Encountered an unexpected error when processing the request, please try again'
- 'template.yaml already exist in the selected directory, overwrite?'
+ expected - actual
Error: Test length exceeded max duration: 30 seconds
[No Pending UI Elements Found]
-Encountered an unexpected error when processing the request, please try again
+template.yaml already exist in the selected directory, overwrite?
at /Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/test/awsService/appBuilder/walkthrough.test.ts:196:32
at s.value (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/test/shared/vscode/window.ts:502:35)
at Proxy.z (/private/tmp/.vscode-test/vscode-darwin-arm64-1.83.0/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:1902)
at Proxy.fire (/private/tmp/.vscode-test/vscode-darwin-arm64-1.83.0/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:80:2119)
at fireOnDidShowMessage (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/test/shared/vscode/window.ts:147:35)
at /Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/test/shared/vscode/message.ts:247:27
at new Promise (<anonymous>)
at Proxy.<anonymous> (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/test/shared/vscode/message.ts:244:20)
at errorPromptHelper (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/codewhisperer/commands/startSecurityScan.ts:485:28)
at startSecurityScan (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/codewhisperer/commands/startSecurityScan.ts:363:13)
2) SamDebugConfigurationProvider
makeConfig
failure modes:
AssertionError [ERR_ASSERTION]: Missing expected rejection.
at async Context.<anonymous> (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/test/shared/sam/debugger/samDebugConfigProvider.test.ts:320:13)
1) SAM runBuild
:) path
[entry: command palette] use samconfig should instantiate correct process in terminal:
AssertionError [ERR_ASSERTION]: RunInterminal
1 !== 2
+ expected - actual
-1
+2
at verifyCorrectDependencyCall (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/test/shared/sam/build.test.ts:344:20)
at Context.<anonymous> (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/test/shared/sam/build.test.ts:532:13)
https://d1ihu6zq92vp9p.cloudfront.net/b4a5497f-734f-491d-a40e-795359615103/report.html
```
https://d1ihu6zq92vp9p.cloudfront.net/2d3ec18e-1584-4a40-948c-18babdfee24e/report.html
3 integ test constantly failing, 2 due to node 18 deprecated, 1 due to
an uncaught change before
```
1) SAM Integration Tests
SAM runtime: nodejs18.x (ZIP)
Starting with a newly created nodejs18.x (ZIP) SAM Application...
"before all" hook for "produces an Add Debug Configuration codelens":
CodeExpectedError: cannot open file:///codebuild/output/src2664791430/src/github.com/aws/aws-toolkit-vscode/packages/core/dist/src/testFixtures/workspaceFolder/inttestco5XDH/nodejs18.x/samapp-WKxmw3/testProject/hello-world/app.mjs. Detail: Unable to read file '/codebuild/output/src2664791430/src/github.com/aws/aws-toolkit-vscode/packages/core/dist/src/testFixtures/workspaceFolder/inttestco5XDH/nodejs18.x/samapp-WKxmw3/testProject/hello-world/app.mjs' (Error: Unable to resolve nonexistent file '/codebuild/output/src2664791430/src/github.com/aws/aws-toolkit-vscode/packages/core/dist/src/testFixtures/workspaceFolder/inttestco5XDH/nodejs18.x/samapp-WKxmw3/testProject/hello-world/app.mjs')
at s.$tryOpenDocument (vscode-file://vscode-app/tmp/.vscode-test/vscode-linux-x64-1.83.0/resources/app/out/vs/workbench/workbench.desktop.main.js:2343:37719)
2) SAM Integration Tests
SAM runtime: nodejs18.x (Image)
Starting with a newly created nodejs18.x (Image) SAM Application...
"before all" hook for "produces an Add Debug Configuration codelens":
SamCliError: Please verify your location. The following types of location are supported: [SamCliFailed]
at makeUnexpectedExitCodeError (/codebuild/output/src2664791430/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/sam/cli/samCliInvokerUtils.ts:48:12)
at logAndThrowIfUnexpectedExitCode (/codebuild/output/src2664791430/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/sam/cli/samCliInvokerUtils.ts:67:11)
at runSamCliInit (/codebuild/output/src2664791430/src/github.com/aws/aws-toolkit-vscode/packages/core/src/shared/sam/cli/samCliInit.ts:65:36)
at async createSamApplication (/codebuild/output/src2664791430/src/github.com/aws/aws-toolkit-vscode/packages/core/src/testInteg/sam.test.ts:640:9)
at async Context.<anonymous> (/codebuild/output/src2664791430/src/github.com/aws/aws-toolkit-vscode/packages/core/src/testInteg/sam.test.ts:382:21)
3) Application Builder
application nodes in workspace (Test in order)
3: contains correct resource node properties:
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
1 !== 0
+ expected - actual
-1
+0
at Context.<anonymous> (/codebuild/output/src2664791430/src/github.com/aws/aws-toolkit-vscode/packages/core/src/testInteg/appBuilder/sidebar/appBuilderNode.test.ts:132:20)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
```
## Solution
- make sure codewhisper doesn't show error in unrelated test
- ensure clean state in sam tests
- remove deprecated node 18 test cases
---
- 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: Laxman Reddy <[email protected]>1 parent 9453746 commit c76cded
File tree
5 files changed
+16
-7
lines changed- packages/core/src
- codewhisperer/commands
- testInteg
- appBuilder/sidebar
5 files changed
+16
-7
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
486 | 489 | | |
487 | 490 | | |
488 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
515 | 518 | | |
516 | 519 | | |
517 | 520 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
| 321 | + | |
320 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
321 | 326 | | |
322 | 327 | | |
323 | 328 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
| |||
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
138 | | - | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
| |||
0 commit comments