Interface TestOptions

  • All Superinterfaces:
    software.amazon.jsii.JsiiSerializable
    All Known Subinterfaces:
    TestCase
    All Known Implementing Classes:
    TestCase.Jsii$Proxy, TestOptions.Jsii$Proxy

    @Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)",
               date="2026-07-30T08:06:26.724Z")
    @Stability(Stable)
    public interface TestOptions
    extends software.amazon.jsii.JsiiSerializable
    The set of options to control the workflow of the test runner.

    Example:

     // The code below shows an example of how to instantiate this type.
     // The values are placeholders you should change.
     import software.amazon.awscdk.cloudassembly.schema.*;
     TestOptions testOptions = TestOptions.builder()
             .allowDeleteFailures(false)
             .allowDestroy(List.of("allowDestroy"))
             .cdkCommandOptions(CdkCommands.builder()
                     .deploy(DeployCommand.builder()
                             .args(DeployOptions.builder()
                                     .all(false)
                                     .app("app")
                                     .assetMetadata(false)
                                     .caBundlePath("caBundlePath")
                                     .changeSetName("changeSetName")
                                     .ci(false)
                                     .color(false)
                                     .concurrency(123)
                                     .context(Map.of(
                                             "contextKey", "context"))
                                     .debug(false)
                                     .ec2Creds(false)
                                     .exclusively(false)
                                     .execute(false)
                                     .force(false)
                                     .ignoreErrors(false)
                                     .json(false)
                                     .lookups(false)
                                     .notices(false)
                                     .notificationArns(List.of("notificationArns"))
                                     .output("output")
                                     .outputsFile("outputsFile")
                                     .parameters(Map.of(
                                             "parametersKey", "parameters"))
                                     .pathMetadata(false)
                                     .profile("profile")
                                     .proxy("proxy")
                                     .requireApproval(RequireApproval.NEVER)
                                     .reuseAssets(List.of("reuseAssets"))
                                     .roleArn("roleArn")
                                     .rollback(false)
                                     .stacks(List.of("stacks"))
                                     .staging(false)
                                     .strict(false)
                                     .toolkitStackName("toolkitStackName")
                                     .trace(false)
                                     .usePreviousParameters(false)
                                     .verbose(false)
                                     .versionReporting(false)
                                     .build())
                             .enabled(false)
                             .expectedMessage("expectedMessage")
                             .expectError(false)
                             .build())
                     .destroy(DestroyCommand.builder()
                             .args(DestroyOptions.builder()
                                     .all(false)
                                     .app("app")
                                     .assetMetadata(false)
                                     .caBundlePath("caBundlePath")
                                     .color(false)
                                     .context(Map.of(
                                             "contextKey", "context"))
                                     .debug(false)
                                     .ec2Creds(false)
                                     .exclusively(false)
                                     .force(false)
                                     .ignoreErrors(false)
                                     .json(false)
                                     .lookups(false)
                                     .notices(false)
                                     .output("output")
                                     .pathMetadata(false)
                                     .profile("profile")
                                     .proxy("proxy")
                                     .roleArn("roleArn")
                                     .stacks(List.of("stacks"))
                                     .staging(false)
                                     .strict(false)
                                     .trace(false)
                                     .verbose(false)
                                     .versionReporting(false)
                                     .build())
                             .enabled(false)
                             .expectedMessage("expectedMessage")
                             .expectError(false)
                             .build())
                     .build())
             .diffAssets(false)
             .hooks(Hooks.builder()
                     .postDeploy(List.of("postDeploy"))
                     .postDestroy(List.of("postDestroy"))
                     .preDeploy(List.of("preDeploy"))
                     .preDestroy(List.of("preDestroy"))
                     .build())
             .regions(List.of("regions"))
             .stackUpdateWorkflow(false)
             .build();
     
    • Method Detail

      • getAllowDeleteFailures

        @Stability(Stable)
        @Nullable
        default Boolean getAllowDeleteFailures()
        Whether to allow resources that fail to delete during a stack update.

        When false, the test will fail if CloudFormation skips deleting a resource during a stack update. When true, only a warning is printed.

        Default: false

      • getAllowDestroy

        @Stability(Stable)
        @Nullable
        default List<String> getAllowDestroy()
        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

      • getCdkCommandOptions

        @Stability(Stable)
        @Nullable
        default CdkCommands getCdkCommandOptions()
        Additional options to use for each CDK command.

        Default: - runner default options

      • getDiffAssets

        @Stability(Stable)
        @Nullable
        default Boolean getDiffAssets()
        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

      • getHooks

        @Stability(Stable)
        @Nullable
        default Hooks getHooks()
        Additional commands to run at predefined points in the test workflow.

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

        Default: - no hooks

      • getRegions

        @Stability(Stable)
        @Nullable
        default List<String> getRegions()
        Limit deployment to these regions.

        Default: - can run in any region

      • getStackUpdateWorkflow

        @Stability(Stable)
        @Nullable
        default Boolean getStackUpdateWorkflow()
        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