Skip to content

Commit 9550003

Browse files
committed
integ
1 parent 7643c1f commit 9550003

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,10 @@ switch (stackSet) {
993993
case 'stage-with-no-stacks':
994994
break;
995995

996+
case 'stage-only':
997+
new SomeStage(app, `${stackPrefix}-stage`);
998+
break;
999+
9961000
default:
9971001
throw new Error(`Unrecognized INTEG_STACK_SET: '${stackSet}'`);
9981002
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { DescribeStacksCommand } from '@aws-sdk/client-cloudformation';
2+
import { integTest, withDefaultFixture } from '../../../lib';
3+
4+
integTest('cdk destroy can destroy stacks in stage-only configuration with --all option', withDefaultFixture(async (fixture) => {
5+
const integStackSet = 'stage-only';
6+
7+
await fixture.cdkDeploy([], {
8+
options: ['--all'],
9+
modEnv: {
10+
INTEG_STACK_SET: integStackSet,
11+
},
12+
});
13+
14+
const stackName = `${fixture.fullStackName('stage')}-StackInStage`;
15+
const stack = await fixture.aws.cloudFormation.send(new DescribeStacksCommand({ StackName: stackName }));
16+
expect(stack.Stacks?.length ?? 0).toEqual(1);
17+
18+
await fixture.cdkDestroy([], {
19+
options: ['--all'],
20+
modEnv: {
21+
INTEG_STACK_SET: integStackSet,
22+
},
23+
});
24+
25+
await expect(fixture.aws.cloudFormation.send(new DescribeStacksCommand({ StackName: stackName })))
26+
.rejects.toThrow(/does not exist/);
27+
}));

0 commit comments

Comments
 (0)