@aws-cdk-testing/cli-integ 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/lib/with-cdk-app.d.ts +10 -2
- package/lib/with-cdk-app.js +12 -41
- package/lib/with-cdk-app.ts +22 -51
- package/lib/with-cli-lib.d.ts +2 -2
- package/lib/with-cli-lib.js +7 -1
- package/lib/with-cli-lib.ts +11 -3
- package/package.json +4 -4
- package/resources/cdk-apps/sam_cdk_integ_app/src/docker/DockerImageFunctionConstruct/Dockerfile +2 -0
- package/tests/cli-integ-tests/bootstrapping.integtest.js +20 -1
- package/tests/cli-integ-tests/bootstrapping.integtest.ts +25 -0
- package/tests/cli-integ-tests/cli.integtest.js +57 -2
- package/tests/cli-integ-tests/cli.integtest.ts +64 -2
- package/tests/uberpackage/uberpackage.integtest.js +2 -2
- package/tests/uberpackage/uberpackage.integtest.ts +2 -2
|
@@ -363,7 +363,8 @@ integTest('doubly nested stack',
|
|
|
363
363
|
await fixture.cdkDeploy('with-doubly-nested-stack', {
|
|
364
364
|
captureStderr: false,
|
|
365
365
|
});
|
|
366
|
-
})
|
|
366
|
+
}),
|
|
367
|
+
);
|
|
367
368
|
|
|
368
369
|
integTest(
|
|
369
370
|
'nested stack with parameters',
|
|
@@ -406,7 +407,7 @@ integTest(
|
|
|
406
407
|
);
|
|
407
408
|
expect(response.Stacks?.[0].StackStatus).toEqual('REVIEW_IN_PROGRESS');
|
|
408
409
|
|
|
409
|
-
//verify a change set was created with the provided name
|
|
410
|
+
// verify a change set was created with the provided name
|
|
410
411
|
const changeSetResponse = await fixture.aws.cloudFormation.send(
|
|
411
412
|
new ListChangeSetsCommand({
|
|
412
413
|
StackName: stackArn,
|
|
@@ -487,6 +488,65 @@ integTest(
|
|
|
487
488
|
}),
|
|
488
489
|
);
|
|
489
490
|
|
|
491
|
+
integTest('deploy with import-existing-resources true', withDefaultFixture(async (fixture) => {
|
|
492
|
+
const stackArn = await fixture.cdkDeploy('test-2', {
|
|
493
|
+
options: ['--no-execute', '--import-existing-resources'],
|
|
494
|
+
captureStderr: false,
|
|
495
|
+
});
|
|
496
|
+
// verify that we only deployed a single stack (there's a single ARN in the output)
|
|
497
|
+
expect(stackArn.split('\n').length).toEqual(1);
|
|
498
|
+
|
|
499
|
+
const response = await fixture.aws.cloudFormation.send(new DescribeStacksCommand({
|
|
500
|
+
StackName: stackArn,
|
|
501
|
+
}));
|
|
502
|
+
expect(response.Stacks?.[0].StackStatus).toEqual('REVIEW_IN_PROGRESS');
|
|
503
|
+
|
|
504
|
+
// verify a change set was successfully created
|
|
505
|
+
// Here, we do not test whether a resource is actually imported, because that is a CloudFormation feature, not a CDK feature.
|
|
506
|
+
const changeSetResponse = await fixture.aws.cloudFormation.send(new ListChangeSetsCommand({
|
|
507
|
+
StackName: stackArn,
|
|
508
|
+
}));
|
|
509
|
+
const changeSets = changeSetResponse.Summaries || [];
|
|
510
|
+
expect(changeSets.length).toEqual(1);
|
|
511
|
+
expect(changeSets[0].Status).toEqual('CREATE_COMPLETE');
|
|
512
|
+
expect(changeSets[0].ImportExistingResources).toEqual(true);
|
|
513
|
+
}));
|
|
514
|
+
|
|
515
|
+
integTest('deploy without import-existing-resources', withDefaultFixture(async (fixture) => {
|
|
516
|
+
const stackArn = await fixture.cdkDeploy('test-2', {
|
|
517
|
+
options: ['--no-execute'],
|
|
518
|
+
captureStderr: false,
|
|
519
|
+
});
|
|
520
|
+
// verify that we only deployed a single stack (there's a single ARN in the output)
|
|
521
|
+
expect(stackArn.split('\n').length).toEqual(1);
|
|
522
|
+
|
|
523
|
+
const response = await fixture.aws.cloudFormation.send(new DescribeStacksCommand({
|
|
524
|
+
StackName: stackArn,
|
|
525
|
+
}));
|
|
526
|
+
expect(response.Stacks?.[0].StackStatus).toEqual('REVIEW_IN_PROGRESS');
|
|
527
|
+
|
|
528
|
+
// verify a change set was successfully created and ImportExistingResources = false
|
|
529
|
+
const changeSetResponse = await fixture.aws.cloudFormation.send(new ListChangeSetsCommand({
|
|
530
|
+
StackName: stackArn,
|
|
531
|
+
}));
|
|
532
|
+
const changeSets = changeSetResponse.Summaries || [];
|
|
533
|
+
expect(changeSets.length).toEqual(1);
|
|
534
|
+
expect(changeSets[0].Status).toEqual('CREATE_COMPLETE');
|
|
535
|
+
expect(changeSets[0].ImportExistingResources).toEqual(false);
|
|
536
|
+
}));
|
|
537
|
+
|
|
538
|
+
integTest('deploy with method=direct and import-existing-resources fails', withDefaultFixture(async (fixture) => {
|
|
539
|
+
const stackName = 'iam-test';
|
|
540
|
+
await expect(fixture.cdkDeploy(stackName, {
|
|
541
|
+
options: ['--import-existing-resources', '--method=direct'],
|
|
542
|
+
})).rejects.toThrow('exited with error');
|
|
543
|
+
|
|
544
|
+
// Ensure stack was not deployed
|
|
545
|
+
await expect(fixture.aws.cloudFormation.send(new DescribeStacksCommand({
|
|
546
|
+
StackName: fixture.fullStackName(stackName),
|
|
547
|
+
}))).rejects.toThrow('does not exist');
|
|
548
|
+
}));
|
|
549
|
+
|
|
490
550
|
integTest(
|
|
491
551
|
'update to stack in ROLLBACK_COMPLETE state will delete stack and create a new one',
|
|
492
552
|
withDefaultFixture(async (fixture) => {
|
|
@@ -2488,6 +2548,8 @@ integTest(
|
|
|
2488
2548
|
// THEN
|
|
2489
2549
|
const expectedSubstring = 'Resource is not in the expected state due to waiter status: TIMEOUT';
|
|
2490
2550
|
expect(deployOutput).toContain(expectedSubstring);
|
|
2551
|
+
expect(deployOutput).toContain('Observed responses:');
|
|
2552
|
+
expect(deployOutput).toContain('200: OK');
|
|
2491
2553
|
expect(deployOutput).not.toContain('hotswapped!');
|
|
2492
2554
|
}),
|
|
2493
2555
|
);
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const lib_1 = require("../../lib");
|
|
4
4
|
jest.setTimeout(600000);
|
|
5
5
|
describe('uberpackage', () => {
|
|
6
|
-
(0, lib_1.integTest)('works with cloudformation-include', (0, lib_1.
|
|
6
|
+
(0, lib_1.integTest)('works with cloudformation-include', (0, lib_1.withSpecificFixture)('cfn-include-app', async (fixture) => {
|
|
7
7
|
fixture.log('Starting test of cfn-include with monolithic CDK');
|
|
8
8
|
await fixture.cdkSynth();
|
|
9
9
|
}));
|
|
10
10
|
});
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidWJlcnBhY2thZ2UuaW50ZWd0ZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidWJlcnBhY2thZ2UuaW50ZWd0ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsbUNBQTJEO0FBRTNELElBQUksQ0FBQyxVQUFVLENBQUMsTUFBTyxDQUFDLENBQUM7QUFFekIsUUFBUSxDQUFDLGFBQWEsRUFBRSxHQUFHLEVBQUU7SUFDM0IsSUFBQSxlQUFTLEVBQUMsbUNBQW1DLEVBQUUsSUFBQSx5QkFBbUIsRUFBQyxpQkFBaUIsRUFBRSxLQUFLLEVBQUUsT0FBTyxFQUFFLEVBQUU7UUFDdEcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxrREFBa0QsQ0FBQyxDQUFDO1FBRWhFLE1BQU0sT0FBTyxDQUFDLFFBQVEsRUFBRSxDQUFDO0lBQzNCLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDTixDQUFDLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGludGVnVGVzdCwgd2l0aFNwZWNpZmljRml4dHVyZSB9IGZyb20gJy4uLy4uL2xpYic7XG5cbmplc3Quc2V0VGltZW91dCg2MDBfMDAwKTtcblxuZGVzY3JpYmUoJ3ViZXJwYWNrYWdlJywgKCkgPT4ge1xuICBpbnRlZ1Rlc3QoJ3dvcmtzIHdpdGggY2xvdWRmb3JtYXRpb24taW5jbHVkZScsIHdpdGhTcGVjaWZpY0ZpeHR1cmUoJ2Nmbi1pbmNsdWRlLWFwcCcsIGFzeW5jIChmaXh0dXJlKSA9PiB7XG4gICAgZml4dHVyZS5sb2coJ1N0YXJ0aW5nIHRlc3Qgb2YgY2ZuLWluY2x1ZGUgd2l0aCBtb25vbGl0aGljIENESycpO1xuXG4gICAgYXdhaXQgZml4dHVyZS5jZGtTeW50aCgpO1xuICB9KSk7XG59KTtcbiJdfQ==
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { integTest,
|
|
1
|
+
import { integTest, withSpecificFixture } from '../../lib';
|
|
2
2
|
|
|
3
3
|
jest.setTimeout(600_000);
|
|
4
4
|
|
|
5
5
|
describe('uberpackage', () => {
|
|
6
|
-
integTest('works with cloudformation-include',
|
|
6
|
+
integTest('works with cloudformation-include', withSpecificFixture('cfn-include-app', async (fixture) => {
|
|
7
7
|
fixture.log('Starting test of cfn-include with monolithic CDK');
|
|
8
8
|
|
|
9
9
|
await fixture.cdkSynth();
|