1
1
import * as fs from 'fs' ;
2
2
import * as path from 'path' ;
3
- import { integTest , randomString , withDefaultFixture } from '../../lib' ;
3
+ import { integTest , randomString , withoutBootstrap } from '../../lib' ;
4
4
5
5
jest . setTimeout ( 2 * 60 * 60_000 ) ; // Includes the time to acquire locks, worst-case single-threaded runtime
6
6
7
- integTest ( 'can bootstrap without execution' , withDefaultFixture ( async ( fixture ) => {
7
+ integTest ( 'can bootstrap without execution' , withoutBootstrap ( async ( fixture ) => {
8
8
const bootstrapStackName = fixture . bootstrapStackName ;
9
9
10
10
await fixture . cdkBootstrapLegacy ( {
@@ -19,7 +19,7 @@ integTest('can bootstrap without execution', withDefaultFixture(async (fixture)
19
19
expect ( resp . Stacks ?. [ 0 ] . StackStatus ) . toEqual ( 'REVIEW_IN_PROGRESS' ) ;
20
20
} ) ) ;
21
21
22
- integTest ( 'upgrade legacy bootstrap stack to new bootstrap stack while in use' , withDefaultFixture ( async ( fixture ) => {
22
+ integTest ( 'upgrade legacy bootstrap stack to new bootstrap stack while in use' , withoutBootstrap ( async ( fixture ) => {
23
23
const bootstrapStackName = fixture . bootstrapStackName ;
24
24
25
25
const legacyBootstrapBucketName = `aws-cdk-bootstrap-integ-test-legacy-bckt-${ randomString ( ) } ` ;
@@ -35,7 +35,12 @@ integTest('upgrade legacy bootstrap stack to new bootstrap stack while in use',
35
35
36
36
// Deploy stack that uses file assets
37
37
await fixture . cdkDeploy ( 'lambda' , {
38
- options : [ '--toolkit-stack-name' , bootstrapStackName ] ,
38
+ options : [
39
+ '--context' , `bootstrapBucket=${ legacyBootstrapBucketName } ` ,
40
+ '--context' , 'legacySynth=true' ,
41
+ '--context' , `@aws-cdk/core:bootstrapQualifier=${ fixture . qualifier } ` ,
42
+ '--toolkit-stack-name' , bootstrapStackName ,
43
+ ] ,
39
44
} ) ;
40
45
41
46
// Upgrade bootstrap stack to "new" style
@@ -49,13 +54,15 @@ integTest('upgrade legacy bootstrap stack to new bootstrap stack while in use',
49
54
// --force to bypass the check which says that the template hasn't changed.
50
55
await fixture . cdkDeploy ( 'lambda' , {
51
56
options : [
57
+ '--context' , `bootstrapBucket=${ newBootstrapBucketName } ` ,
58
+ '--context' , `@aws-cdk/core:bootstrapQualifier=${ fixture . qualifier } ` ,
52
59
'--toolkit-stack-name' , bootstrapStackName ,
53
60
'--force' ,
54
61
] ,
55
62
} ) ;
56
63
} ) ) ;
57
64
58
- integTest ( 'can and deploy if omitting execution policies' , withDefaultFixture ( async ( fixture ) => {
65
+ integTest ( 'can and deploy if omitting execution policies' , withoutBootstrap ( async ( fixture ) => {
59
66
const bootstrapStackName = fixture . bootstrapStackName ;
60
67
61
68
await fixture . cdkBootstrapModern ( {
@@ -72,7 +79,7 @@ integTest('can and deploy if omitting execution policies', withDefaultFixture(as
72
79
} ) ;
73
80
} ) ) ;
74
81
75
- integTest ( 'deploy new style synthesis to new style bootstrap' , withDefaultFixture ( async ( fixture ) => {
82
+ integTest ( 'deploy new style synthesis to new style bootstrap' , withoutBootstrap ( async ( fixture ) => {
76
83
const bootstrapStackName = fixture . bootstrapStackName ;
77
84
78
85
await fixture . cdkBootstrapModern ( {
@@ -90,7 +97,7 @@ integTest('deploy new style synthesis to new style bootstrap', withDefaultFixtur
90
97
} ) ;
91
98
} ) ) ;
92
99
93
- integTest ( 'deploy new style synthesis to new style bootstrap (with docker image)' , withDefaultFixture ( async ( fixture ) => {
100
+ integTest ( 'deploy new style synthesis to new style bootstrap (with docker image)' , withoutBootstrap ( async ( fixture ) => {
94
101
const bootstrapStackName = fixture . bootstrapStackName ;
95
102
96
103
await fixture . cdkBootstrapModern ( {
@@ -108,7 +115,7 @@ integTest('deploy new style synthesis to new style bootstrap (with docker image)
108
115
} ) ;
109
116
} ) ) ;
110
117
111
- integTest ( 'deploy old style synthesis to new style bootstrap' , withDefaultFixture ( async ( fixture ) => {
118
+ integTest ( 'deploy old style synthesis to new style bootstrap' , withoutBootstrap ( async ( fixture ) => {
112
119
const bootstrapStackName = fixture . bootstrapStackName ;
113
120
114
121
await fixture . cdkBootstrapModern ( {
@@ -119,12 +126,13 @@ integTest('deploy old style synthesis to new style bootstrap', withDefaultFixtur
119
126
// Deploy stack that uses file assets
120
127
await fixture . cdkDeploy ( 'lambda' , {
121
128
options : [
129
+ '--context' , `@aws-cdk/core:bootstrapQualifier=${ fixture . qualifier } ` ,
122
130
'--toolkit-stack-name' , bootstrapStackName ,
123
131
] ,
124
132
} ) ;
125
133
} ) ) ;
126
134
127
- integTest ( 'can create a legacy bootstrap stack with --public-access-block-configuration=false' , withDefaultFixture ( async ( fixture ) => {
135
+ integTest ( 'can create a legacy bootstrap stack with --public-access-block-configuration=false' , withoutBootstrap ( async ( fixture ) => {
128
136
const bootstrapStackName = fixture . bootstrapStackName ;
129
137
130
138
await fixture . cdkBootstrapLegacy ( {
@@ -140,7 +148,7 @@ integTest('can create a legacy bootstrap stack with --public-access-block-config
140
148
] ) ;
141
149
} ) ) ;
142
150
143
- integTest ( 'can create multiple legacy bootstrap stacks' , withDefaultFixture ( async ( fixture ) => {
151
+ integTest ( 'can create multiple legacy bootstrap stacks' , withoutBootstrap ( async ( fixture ) => {
144
152
const bootstrapStackName1 = `${ fixture . bootstrapStackName } -1` ;
145
153
const bootstrapStackName2 = `${ fixture . bootstrapStackName } -2` ;
146
154
@@ -162,7 +170,7 @@ integTest('can create multiple legacy bootstrap stacks', withDefaultFixture(asyn
162
170
] ) ;
163
171
} ) ) ;
164
172
165
- integTest ( 'can dump the template, modify and use it to deploy a custom bootstrap stack' , withDefaultFixture ( async ( fixture ) => {
173
+ integTest ( 'can dump the template, modify and use it to deploy a custom bootstrap stack' , withoutBootstrap ( async ( fixture ) => {
166
174
let template = await fixture . cdkBootstrapModern ( {
167
175
// toolkitStackName doesn't matter for this particular invocation
168
176
toolkitStackName : fixture . bootstrapStackName ,
@@ -188,7 +196,7 @@ integTest('can dump the template, modify and use it to deploy a custom bootstrap
188
196
} ) ;
189
197
} ) ) ;
190
198
191
- integTest ( 'can use the default permissions boundary to bootstrap' , withDefaultFixture ( async ( fixture ) => {
199
+ integTest ( 'can use the default permissions boundary to bootstrap' , withoutBootstrap ( async ( fixture ) => {
192
200
let template = await fixture . cdkBootstrapModern ( {
193
201
// toolkitStackName doesn't matter for this particular invocation
194
202
toolkitStackName : fixture . bootstrapStackName ,
@@ -199,7 +207,7 @@ integTest('can use the default permissions boundary to bootstrap', withDefaultFi
199
207
expect ( template ) . toContain ( 'PermissionsBoundary' ) ;
200
208
} ) ) ;
201
209
202
- integTest ( 'can use the custom permissions boundary to bootstrap' , withDefaultFixture ( async ( fixture ) => {
210
+ integTest ( 'can use the custom permissions boundary to bootstrap' , withoutBootstrap ( async ( fixture ) => {
203
211
let template = await fixture . cdkBootstrapModern ( {
204
212
// toolkitStackName doesn't matter for this particular invocation
205
213
toolkitStackName : fixture . bootstrapStackName ,
@@ -210,7 +218,7 @@ integTest('can use the custom permissions boundary to bootstrap', withDefaultFix
210
218
expect ( template ) . toContain ( 'permission-boundary-name' ) ;
211
219
} ) ) ;
212
220
213
- integTest ( 'switch on termination protection, switch is left alone on re-bootstrap' , withDefaultFixture ( async ( fixture ) => {
221
+ integTest ( 'switch on termination protection, switch is left alone on re-bootstrap' , withoutBootstrap ( async ( fixture ) => {
214
222
const bootstrapStackName = fixture . bootstrapStackName ;
215
223
216
224
await fixture . cdkBootstrapModern ( {
@@ -229,7 +237,7 @@ integTest('switch on termination protection, switch is left alone on re-bootstra
229
237
expect ( response . Stacks ?. [ 0 ] . EnableTerminationProtection ) . toEqual ( true ) ;
230
238
} ) ) ;
231
239
232
- integTest ( 'add tags, left alone on re-bootstrap' , withDefaultFixture ( async ( fixture ) => {
240
+ integTest ( 'add tags, left alone on re-bootstrap' , withoutBootstrap ( async ( fixture ) => {
233
241
const bootstrapStackName = fixture . bootstrapStackName ;
234
242
235
243
await fixture . cdkBootstrapModern ( {
@@ -250,7 +258,7 @@ integTest('add tags, left alone on re-bootstrap', withDefaultFixture(async (fixt
250
258
] ) ;
251
259
} ) ) ;
252
260
253
- integTest ( 'can add tags then update tags during re-bootstrap' , withDefaultFixture ( async ( fixture ) => {
261
+ integTest ( 'can add tags then update tags during re-bootstrap' , withoutBootstrap ( async ( fixture ) => {
254
262
const bootstrapStackName = fixture . bootstrapStackName ;
255
263
256
264
await fixture . cdkBootstrapModern ( {
@@ -273,7 +281,7 @@ integTest('can add tags then update tags during re-bootstrap', withDefaultFixtur
273
281
] ) ;
274
282
} ) ) ;
275
283
276
- integTest ( 'can deploy modern-synthesized stack even if bootstrap stack name is unknown' , withDefaultFixture ( async ( fixture ) => {
284
+ integTest ( 'can deploy modern-synthesized stack even if bootstrap stack name is unknown' , withoutBootstrap ( async ( fixture ) => {
277
285
const bootstrapStackName = fixture . bootstrapStackName ;
278
286
279
287
await fixture . cdkBootstrapModern ( {
@@ -293,7 +301,7 @@ integTest('can deploy modern-synthesized stack even if bootstrap stack name is u
293
301
} ) ;
294
302
} ) ) ;
295
303
296
- integTest ( 'create ECR with tag IMMUTABILITY to set on' , withDefaultFixture ( async ( fixture ) => {
304
+ integTest ( 'create ECR with tag IMMUTABILITY to set on' , withoutBootstrap ( async ( fixture ) => {
297
305
const bootstrapStackName = fixture . bootstrapStackName ;
298
306
299
307
await fixture . cdkBootstrapModern ( {
0 commit comments