@@ -118,8 +118,6 @@ describe('StageProcessor', () => {
118118 'cdk.out/SomeStage-test-stack.template.json' ,
119119 ) ,
120120 failOnDestructiveChanges : true ,
121- stackSelectorPatterns : [ ] ,
122- stackSelectionStrategy : 'all-stacks' ,
123121 noFailOnDestructiveChanges : [ ] ,
124122 } ) ;
125123 await processor . processStages ( ) ;
@@ -155,8 +153,6 @@ describe('StageProcessor', () => {
155153 'cdk.out/SomeStage-test-stack.template.json' ,
156154 ) ,
157155 failOnDestructiveChanges : true ,
158- stackSelectorPatterns : [ ] ,
159- stackSelectionStrategy : 'all-stacks' ,
160156 noFailOnDestructiveChanges : [ ] ,
161157 } ) ;
162158 await processor . processStages ( ) ;
@@ -192,11 +188,9 @@ describe('StageProcessor', () => {
192188 'cdk.out/SomeStage-test-stack.template.json' ,
193189 ) ,
194190 failOnDestructiveChanges : true ,
195- stackSelectorPatterns : [ ] ,
196- stackSelectionStrategy : 'all-stacks' ,
197191 noFailOnDestructiveChanges : [ ] ,
198192 } ) ;
199- await processor . processStages ( [ 'SomeStage' ] ) ;
193+ await processor . processStages ( ) ;
200194 const p = ( processor as any ) . stageComments ;
201195 expect ( p ) . toEqual ( {
202196 SomeStage : expect . any ( Object ) ,
@@ -230,11 +224,9 @@ describe('StageProcessor', () => {
230224 'cdk.out/SomeStage-test-stack.template.json' ,
231225 ) ,
232226 failOnDestructiveChanges : true ,
233- stackSelectorPatterns : [ ] ,
234- stackSelectionStrategy : 'all-stacks' ,
235227 noFailOnDestructiveChanges : [ ] ,
236228 } ) ;
237- await processor . processStages ( [ 'SomeStage' ] ) ;
229+ await processor . processStages ( ) ;
238230 await processor . commentStages ( new Comments ( { } as any , { } as any ) ) ;
239231 expect ( createCommentMock ) . toHaveBeenCalledTimes ( 1 ) ;
240232 expect ( findPreviousMock ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -264,132 +256,15 @@ describe('StageProcessor', () => {
264256 'cdk.out/SomeStage-test-stack.template.json' ,
265257 ) ,
266258 failOnDestructiveChanges : true ,
267- stackSelectorPatterns : [ ] ,
268- stackSelectionStrategy : 'all-stacks' ,
269259 noFailOnDestructiveChanges : [ ] ,
270260 } ) ;
271261 findPreviousMock . mockResolvedValue ( 1 ) ;
272- await processor . processStages ( [ 'SomeStage' ] ) ;
262+ await processor . processStages ( ) ;
273263 await processor . commentStages ( new Comments ( { } as any , { } as any ) ) ;
274264 expect ( findPreviousMock ) . toHaveBeenCalledTimes ( 1 ) ;
275265 expect ( createCommentMock ) . toHaveBeenCalledTimes ( 0 ) ;
276266 expect ( updateCommentMock ) . toHaveBeenCalledTimes ( 1 ) ;
277267 } ) ;
278-
279- test ( 'filter stages' , async ( ) => {
280- mockOutDir = {
281- 'SomeStage-test-stack.template.json' : JSON . stringify ( {
282- Resources : {
283- MyRole : {
284- Type : 'AWS::IAM::Role' ,
285- Properties : {
286- RoleName : 'MyCustomName2' ,
287- } ,
288- } ,
289- } ,
290- } ) ,
291- 'manifest.json' : JSON . stringify ( {
292- version : '36.0.0' ,
293- artifacts : {
294- 'assembly-SomeOtherStage' : {
295- type : 'cdk:cloud-assembly' ,
296- properties : {
297- directoryName : 'assembly-SomeOtherStage' ,
298- displayName : 'SomeOtherStage' ,
299- } ,
300- } ,
301- 'assembly-SomeStage' : {
302- type : 'cdk:cloud-assembly' ,
303- properties : {
304- directoryName : 'assembly-SomeStage' ,
305- displayName : 'SomeStage' ,
306- } ,
307- } ,
308- } ,
309- } ) ,
310- [ 'assembly-SomeOtherStage' ] : {
311- [ 'manifest.json' ] : JSON . stringify ( {
312- version : '36.0.0' ,
313- artifacts : {
314- 'SomeOtherStage-test-stack' : {
315- type : 'aws:cloudformation:stack' ,
316- environment : 'aws://unknown-account/unknown-region' ,
317- properties : {
318- templateFile : 'SomeOtherStage-test-stack.template.json' ,
319- validateOnSynth : false ,
320- stackName : 'SomeOtherStage-test-stack' ,
321- } ,
322- displayName : 'SomeOtherStage/test-stack' ,
323- } ,
324- } ,
325- } ) ,
326- [ 'SomeOtherStage-test-stack.template.json' ] : JSON . stringify ( {
327- Resources : {
328- MyRole : {
329- Type : 'AWS::IAM::Role' ,
330- Properties : {
331- RoleName : 'MyCustomName' ,
332- } ,
333- } ,
334- } ,
335- } ) ,
336- } ,
337- [ 'assembly-SomeStage' ] : {
338- [ 'manifest.json' ] : JSON . stringify ( {
339- version : '36.0.0' ,
340- artifacts : {
341- 'SomeStage-test-stack' : {
342- type : 'aws:cloudformation:stack' ,
343- environment : 'aws://unknown-account/unknown-region' ,
344- properties : {
345- templateFile : 'SomeStage-test-stack.template.json' ,
346- validateOnSynth : false ,
347- stackName : 'SomeStage-test-stack' ,
348- } ,
349- displayName : 'SomeStage/test-stack' ,
350- } ,
351- } ,
352- } ) ,
353- [ 'SomeStage-test-stack.template.json' ] : JSON . stringify ( {
354- Resources : {
355- MyRole : {
356- Type : 'AWS::IAM::Role' ,
357- Properties : {
358- RoleName : 'MyCustomName' ,
359- } ,
360- } ,
361- } ,
362- } ) ,
363- } ,
364- } ;
365- mock ( {
366- 'cdk.out' : mockOutDir ,
367- node_modules : mock . load ( path . join ( __dirname , '..' , 'node_modules' ) ) ,
368- } ) ;
369- const processor = new AssemblyProcessor ( {
370- toolkit,
371- allowedDestroyTypes : [ ] ,
372- cdkOutDir : 'cdk.out' ,
373- diffMethod : DiffMethod . LocalFile (
374- 'cdk.out/SomeStage-test-stack.template.json' ,
375- ) ,
376- failOnDestructiveChanges : true ,
377- stackSelectorPatterns : [ '!SomeOtherStage/*' ] ,
378- stackSelectionStrategy : 'pattern-must-match' ,
379- noFailOnDestructiveChanges : [ ] ,
380- } ) ;
381- await processor . processStages ( ) ;
382- const p = ( processor as any ) . stageComments ;
383- expect ( p ) . toEqual ( {
384- SomeStage : expect . any ( Object ) ,
385- } ) ;
386- expect (
387- p . SomeStage . stackComments [ 'SomeStage/test-stack' ] . length ,
388- ) . not . toEqual ( 0 ) ;
389- expect ( p . SomeStage . stackComments [ 'SomeOtherStage/test-stack' ] ) . toEqual (
390- undefined ,
391- ) ;
392- } ) ;
393268} ) ;
394269
395270describe ( 'default stage' , ( ) => {
@@ -447,8 +322,6 @@ describe('default stage', () => {
447322 'cdk.out/SomeStage-test-stack.template.json' ,
448323 ) ,
449324 failOnDestructiveChanges : true ,
450- stackSelectorPatterns : [ ] ,
451- stackSelectionStrategy : 'all-stacks' ,
452325 noFailOnDestructiveChanges : [ ] ,
453326 } ) ;
454327 await processor . processStages ( ) ;
@@ -504,8 +377,6 @@ function setupCommentTest(): AssemblyProcessor {
504377 cdkOutDir : 'cdk.out' ,
505378 diffMethod : DiffMethod . TemplateOnly ( ) ,
506379 failOnDestructiveChanges : true ,
507- stackSelectorPatterns : [ ] ,
508- stackSelectionStrategy : 'all-stacks' ,
509380 noFailOnDestructiveChanges : [ ] ,
510381 } ) ;
511382}
@@ -514,7 +385,7 @@ describe('stack comments', () => {
514385 findPreviousMock . mockResolvedValue ( 1 ) ;
515386 updateCommentMock . mockRejectedValueOnce ( requestError ( 422 ) ) ;
516387 const processor = setupCommentTest ( ) ;
517- await processor . processStages ( [ 'SomeStage' ] ) ;
388+ await processor . processStages ( ) ;
518389 await processor . commentStages ( new Comments ( { } as any , { } as any ) ) ;
519390 expect ( findPreviousMock ) . toHaveBeenCalledTimes ( 11 ) ;
520391 expect ( createCommentMock ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -527,7 +398,7 @@ describe('stack comments', () => {
527398 requestError ( 400 , 'Some other error failed' ) ,
528399 ) ;
529400 const processor = setupCommentTest ( ) ;
530- await processor . processStages ( [ 'SomeStage' ] ) ;
401+ await processor . processStages ( ) ;
531402 await expect (
532403 processor . commentStages ( new Comments ( { } as any , { } as any ) ) ,
533404 ) . rejects . toThrow ( / V a l i d a t i o n E r r o r / ) ;
@@ -543,7 +414,7 @@ describe('stack comments', () => {
543414 requestError ( 400 , 'Some other error failed' ) ,
544415 ) ;
545416 const processor = setupCommentTest ( ) ;
546- await processor . processStages ( [ 'SomeStage' ] ) ;
417+ await processor . processStages ( ) ;
547418 await expect (
548419 processor . commentStages ( new Comments ( { } as any , { } as any ) ) ,
549420 ) . rejects . toThrow ( / V a l i d a t i o n E r r o r / ) ;
@@ -558,7 +429,7 @@ describe('stack comments', () => {
558429 updateCommentMock . mockRejectedValueOnce ( requestError ( 422 ) ) ;
559430 updateCommentMock . mockRejectedValueOnce ( requestError ( 422 ) ) ;
560431 const processor = setupCommentTest ( ) ;
561- await processor . processStages ( [ 'SomeStage' ] ) ;
432+ await processor . processStages ( ) ;
562433 await expect (
563434 processor . commentStages ( new Comments ( { } as any , { } as any ) ) ,
564435 ) . rejects . toThrow ( / C o m m e n t f o r s t a c k S o m e S t a g e \/ m y - s t a c k 1 i s t o o l o n g / ) ;
0 commit comments