Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(integ): node check breaks cli integ tests #16216

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 30 additions & 17 deletions packages/aws-cdk/test/integ/cli/cli.integtest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,36 @@ integTest('Termination protection', withDefaultFixture(async (fixture) => {
}));

integTest('cdk synth', withDefaultFixture(async (fixture) => {
await expect(fixture.cdk(['synth', fixture.fullStackName('test-1')], { verbose: false })).resolves.toEqual(
`Resources:
topic69831491:
Type: AWS::SNS::Topic
Metadata:
aws:cdk:path: ${fixture.stackNamePrefix}-test-1/topic/Resource`);

await expect(fixture.cdk(['synth', fixture.fullStackName('test-2')], { verbose: false })).resolves.toEqual(
`Resources:
topic152D84A37:
Type: AWS::SNS::Topic
Metadata:
aws:cdk:path: ${fixture.stackNamePrefix}-test-2/topic1/Resource
topic2A4FB547F:
Type: AWS::SNS::Topic
Metadata:
aws:cdk:path: ${fixture.stackNamePrefix}-test-2/topic2/Resource`);
await fixture.cdk(['synth', fixture.fullStackName('test-1')]);
expect(fixture.template('test-1')).toEqual({
Resources: {
topic69831491: {
Type: 'AWS::SNS::Topic',
Metadata: {
'aws:cdk:path': `${fixture.stackNamePrefix}-test-1/topic/Resource`,
},
},
},
});

await fixture.cdk(['synth', fixture.fullStackName('test-2')], { verbose: false });
expect(fixture.template('test-2')).toEqual({
Resources: {
topic152D84A37: {
Type: 'AWS::SNS::Topic',
Metadata: {
'aws:cdk:path': `${fixture.stackNamePrefix}-test-2/topic1/Resource`,
},
},
topic2A4FB547F: {
Type: 'AWS::SNS::Topic',
Metadata: {
'aws:cdk:path': `${fixture.stackNamePrefix}-test-2/topic2/Resource`,
},
},
},
});

}));

integTest('ssm parameter provider error', withDefaultFixture(async (fixture) => {
Expand Down
6 changes: 6 additions & 0 deletions packages/aws-cdk/test/integ/helpers/cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,12 @@ export class TestFixture {
});
}

public template(stackName: string): any {
const fullStackName = this.fullStackName(stackName);
const templatePath = path.join(this.integTestDir, 'cdk.out', `${fullStackName}.template.json`);
return JSON.parse(fs.readFileSync(templatePath, { encoding: 'utf-8' }).toString());
}

public get bootstrapStackName() {
return this.fullStackName('bootstrap-stack');
}
Expand Down