Interface TestOptions

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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:11.026Z") @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.cloud_assembly_schema.*;
 TestOptions testOptions = TestOptions.builder()
         .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();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A builder for TestOptions
    static final class 
    An implementation for TestOptions
  • Method Summary

    Modifier and Type
    Method
    Description
     
    default List<String>
    List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.
    default CdkCommands
    Additional options to use for each CDK command.
    default 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.
    default Hooks
    Additional commands to run at predefined points in the test workflow.
    default List<String>
    Limit deployment to these regions.
    default 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.

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Method Details

    • 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

    • builder

      @Stability(Stable) static TestOptions.Builder builder()
      Returns:
      a TestOptions.Builder of TestOptions