Class IntegTestProps
(experimental) Integration test properties.
Inheritance
Namespace: Amazon.CDK.IntegTests.Alpha
Assembly: Amazon.CDK.IntegTests.Alpha.dll
Syntax (csharp)
public class IntegTestProps : Object, IIntegTestProps, ITestOptions
Syntax (vb)
Public Class IntegTestProps
Inherits Object
Implements IIntegTestProps, ITestOptions
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
IFunction lambdaFunction;
App app;
var stack = new Stack(app, "cdk-integ-lambda-bundling");
var integ = new IntegTest(app, "IntegTest", new IntegTestProps {
TestCases = new [] { stack }
});
var invoke = integ.Assertions.InvokeFunction(new LambdaInvokeFunctionProps {
FunctionName = lambdaFunction.FunctionName
});
invoke.Expect(ExpectedResult.ObjectLike(new Dictionary<string, object> {
{ "Payload", "200" }
}));
Synopsis
Constructors
IntegTestProps() |
Properties
AllowDestroy | List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test. |
AssertionStack | (experimental) Specify a stack to use for assertions. |
CdkCommandOptions | Additional options to use for each CDK command. |
DiffAssets | 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. |
EnableLookups | (experimental) Enable lookups for this test. |
Hooks | Additional commands to run at predefined points in the test workflow. |
Regions | Limit deployment to these regions. |
StackUpdateWorkflow | 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 | (experimental) List of test cases that make up this test. |
Constructors
IntegTestProps()
public IntegTestProps()
Properties
AllowDestroy
List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.
public string[] AllowDestroy { get; set; }
Property Value
System.String[]
Remarks
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']
Default: - do not allow destruction of any resources on update
AssertionStack
(experimental) Specify a stack to use for assertions.
public Stack AssertionStack { get; set; }
Property Value
Remarks
Default: - a stack is created for you
Stability: Experimental
CdkCommandOptions
Additional options to use for each CDK command.
public ICdkCommands CdkCommandOptions { get; set; }
Property Value
Remarks
Default: - runner default options
DiffAssets
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.
public Nullable<bool> DiffAssets { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
For example any tests involving custom resources or bundling
Default: false
EnableLookups
(experimental) Enable lookups for this test.
public Nullable<bool> EnableLookups { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If lookups are enabled
then stackUpdateWorkflow
must be set to false.
Lookups should only be enabled when you are explicitly testing
lookups.
Default: false
Stability: Experimental
Hooks
Additional commands to run at predefined points in the test workflow.
public IHooks Hooks { get; set; }
Property Value
Remarks
e.g. { postDeploy: ['yarn', 'test'] }
Default: - no hooks
Regions
Limit deployment to these regions.
public string[] Regions { get; set; }
Property Value
System.String[]
Remarks
Default: - can run in any region
StackUpdateWorkflow
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.
public Nullable<bool> StackUpdateWorkflow { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
TestCases
(experimental) List of test cases that make up this test.
public Stack[] TestCases { get; set; }
Property Value
Stack[]
Remarks
Stability: Experimental