interface IntegTestProps
Language | Type name |
---|---|
.NET | Amazon.CDK.IntegTests.IntegTestProps |
Java | software.amazon.awscdk.integtests.IntegTestProps |
Python | aws_cdk.integ_tests.IntegTestProps |
TypeScript (source) | @aws-cdk/integ-tests » IntegTestProps |
Integration test properties.
Example
declare const lambdaFunction: lambda.IFunction;
declare const app: App;
const stack = new Stack(app, 'cdk-integ-lambda-bundling');
const integ = new IntegTest(app, 'IntegTest', {
testCases: [stack],
});
const invoke = integ.assertions.invokeFunction({
functionName: lambdaFunction.functionName,
});
invoke.expect(ExpectedResult.objectLike({
Payload: '200',
}));
Properties
Name | Type | Description |
---|---|---|
test | Stack [] | List of test cases that make up this test. |
allow | string[] | List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test. |
cdk | Cdk | Additional options to use for each CDK command. |
diff | boolean | Whether or not to include asset hashes in the diff Asset hashes can introduces a lot of unneccessary noise into tests, but there are some cases where asset hashes should be included. |
hooks? | Hooks | Additional commands to run at predefined points in the test workflow. |
regions? | string[] | Limit deployment to these regions. |
stack | boolean | Run update workflow on this test case This should only be set to false to test scenarios that are not possible to test as part of the update workflow. |
testCases
Type:
Stack
[]
List of test cases that make up this test.
allowDestroy?
Type:
string[]
(optional, default: do not allow destruction of any resources on update)
List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.
This list should only include resources that for this specific integration test we are sure will not cause errors or an outage if destroyed. For example, maybe we know that a new resource will be created first before the old resource is destroyed which prevents any outage.
e.g. ['AWS::IAM::Role']
cdkCommandOptions?
Type:
Cdk
(optional, default: runner default options)
Additional options to use for each CDK command.
diffAssets?
Type:
boolean
(optional, default: false)
Whether or not to include asset hashes in the diff Asset hashes can introduces a lot of unneccessary noise into tests, but there are some cases where asset hashes should be included.
For example any tests involving custom resources or bundling
hooks?
Type:
Hooks
(optional, default: no hooks)
Additional commands to run at predefined points in the test workflow.
e.g. { postDeploy: ['yarn', 'test'] }
regions?
Type:
string[]
(optional, default: can run in any region)
Limit deployment to these regions.
stackUpdateWorkflow?
Type:
boolean
(optional, default: true)
Run update workflow on this test case This should only be set to false to test scenarios that are not possible to test as part of the update workflow.