Commit e3b73c4
authored
test(lambda): fix integration test failure in appBuilder (#6733)
## Problem
There is a side effect from `sandbox.spy(AppBuilderRootNode.instance)`
between two integration tests for AppBuilder causing test failure due to
**_`TypeError: Attempted to wrap onDidChangeChildren which is already
wrapped`_**`
```
1) "before each" hook for "creates an AppBuilderRootNode with correct label":
TypeError: Attempted to wrap onDidChangeChildren which is already wrapped
at checkWrappedMethod (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/wrap-method.js:64:21)
at wrapMethod (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/wrap-method.js:135:13)
at spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/spy.js:180:16)
at /Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk-object.js:33:17
at /Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:27:22
at Array.forEach (<anonymous>)
at walkInternal (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:19:5)
at walk (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:48:12)
at walkObject (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk-object.js:18:5)
at Function.spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/spy.js:170:16)
at Sandbox.spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/sandbox.js:383:35)
at Context.<anonymous> (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/packages/core/src/testInteg/appBuilder/serverlessLand/main.test.ts:34:28)
--------------
Error: Stack Trace for original
at extendObjectWithWrappedMethods (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/wrap-method.js:169:34)
at wrapMethod (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/wrap-method.js:157:5)
at spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/spy.js:180:16)
at /Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk-object.js:33:17
at /Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:27:22
at Array.forEach (<anonymous>)
at walkInternal (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:19:5)
at walk (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:48:12)
at walkObject (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk-object.js:18:5)
at Function.spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/spy.js:170:16)
at Sandbox.spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/sandbox.js:383:35)
at Context.<anonymous> (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/packages/core/src/testInteg/appBuilder/sidebar/appBuilderNode.test.ts:35:28)
at Context.fn (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/packages/core/src/test/setupUtil.ts:34:24)
at processImmediate (node:internal/timers:483:21)
at process.topLevelDomainCallback (node:domain:161:15)
at process.callbackTrampoline (node:internal/async_hooks:128:24)
```
## Solution
Add additional layer of `describe()`.
Test result:
```
Walkthrough pattern URL exists
✔ Walkthrough pattern URL exists for APIdotnet (623ms)
✔ Walkthrough pattern URL exists for APInode (510ms)
✔ Walkthrough pattern URL exists for APIpython (473ms)
✔ Walkthrough pattern URL exists for APIjava (559ms)
✔ Walkthrough pattern URL exists for S3dotnet (584ms)
✔ Walkthrough pattern URL exists for S3node (525ms)
✔ Walkthrough pattern URL exists for S3python (566ms)
✔ Walkthrough pattern URL exists for S3java (560ms)
Application Builder
root node
✔ creates an AppBuilderRootNode with correct label
✔ generates correct number of children nodes: walkthrough node + project nodes
application nodes in workspace (Test in order)
✔ 1: contains application node for appbuilder-test-app
✔ 2: contains correct application node properties
✔ 3: contains correct resource node properties (4266ms)
✔ 4: has registered refresh command successfully
✔ 5: triggers auto refresh when there a file getting updated (509ms)
Happy Path
✔ creates project from Serverless Land integration (1083ms)
16 passing (10s)
globalSetup: after()
deleteTestTempDirs: deleted 2 test temp dirs
```
---
- 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.1 parent 975f0d0 commit e3b73c4
File tree
1 file changed
+101
-95
lines changed- packages/core/src/testInteg/appBuilder/serverlessLand
1 file changed
+101
-95
lines changedLines changed: 101 additions & 95 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | 28 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
36 | 34 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
59 | 65 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
86 | 98 | | |
87 | | - | |
88 | 99 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 100 | + | |
95 | 101 | | |
96 | | - | |
| 102 | + | |
97 | 103 | | |
98 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
99 | 114 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 115 | + | |
109 | 116 | | |
110 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
111 | 121 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
116 | 140 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 141 | + | |
134 | 142 | | |
135 | | - | |
136 | | - | |
137 | 143 | | |
138 | 144 | | |
0 commit comments