IntegTestProps

class aws_cdk.integ_tests_alpha.IntegTestProps(*, allow_destroy=None, cdk_command_options=None, diff_assets=None, hooks=None, regions=None, stack_update_workflow=None, test_cases, assertion_stack=None, enable_lookups=None)

Bases: TestOptions

(experimental) Integration test properties.

Parameters:
  • allow_destroy (Optional[Sequence[str]]) – 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’] Default: - do not allow destruction of any resources on update

  • cdk_command_options (Union[CdkCommands, Dict[str, Any], None]) – Additional options to use for each CDK command. Default: - runner default options

  • diff_assets (Optional[bool]) – 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 Default: false

  • hooks (Union[Hooks, Dict[str, Any], None]) – Additional commands to run at predefined points in the test workflow. e.g. { postDeploy: [‘yarn’, ‘test’] } Default: - no hooks

  • regions (Optional[Sequence[str]]) – Limit deployment to these regions. Default: - can run in any region

  • stack_update_workflow (Optional[bool]) – 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. Default: true

  • test_cases (Sequence[Stack]) – (experimental) List of test cases that make up this test.

  • assertion_stack (Optional[Stack]) – (experimental) Specify a stack to use for assertions. Default: - a stack is created for you

  • enable_lookups (Optional[bool]) – (experimental) Enable lookups for this test. 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

ExampleMetadata:

infused

Example:

# lambda_function: lambda.IFunction
# app: App


stack = Stack(app, "cdk-integ-lambda-bundling")

integ = IntegTest(app, "IntegTest",
    test_cases=[stack]
)

invoke = integ.assertions.invoke_function(
    function_name=lambda_function.function_name
)
invoke.expect(ExpectedResult.object_like({
    "Payload": "200"
}))

Attributes

allow_destroy

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’]

Default:
  • do not allow destruction of any resources on update

assertion_stack

(experimental) Specify a stack to use for assertions.

Default:
  • a stack is created for you

Stability:

experimental

cdk_command_options

Additional options to use for each CDK command.

Default:
  • runner default options

diff_assets

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

Default:

false

enable_lookups

(experimental) Enable lookups for this test.

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.

e.g. { postDeploy: [‘yarn’, ‘test’] }

Default:
  • no hooks

regions

Limit deployment to these regions.

Default:
  • can run in any region

stack_update_workflow

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.

Default:

true

test_cases

(experimental) List of test cases that make up this test.

Stability:

experimental