TestCase Struct
Represents an integration test case.
| Source | lib/integ-tests/test-case.ts |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';
const testCase: cloud_assembly_schema.TestCase = {
stacks: ['stacks'],
// the properties below are optional
allowDeleteFailures: false,
allowDestroy: ['allowDestroy'],
assertionStack: 'assertionStack',
assertionStackName: 'assertionStackName',
cdkCommandOptions: {
deploy: {
args: {
all: false,
app: 'app',
assetMetadata: false,
caBundlePath: 'caBundlePath',
changeSetName: 'changeSetName',
ci: false,
color: false,
concurrency: 123,
context: {
contextKey: 'context',
},
debug: false,
ec2Creds: false,
exclusively: false,
execute: false,
force: false,
ignoreErrors: false,
json: false,
lookups: false,
notices: false,
notificationArns: ['notificationArns'],
output: 'output',
outputsFile: 'outputsFile',
parameters: {
parametersKey: 'parameters',
},
pathMetadata: false,
profile: 'profile',
proxy: 'proxy',
requireApproval: cloud_assembly_schema.RequireApproval.NEVER,
reuseAssets: ['reuseAssets'],
roleArn: 'roleArn',
rollback: false,
stacks: ['stacks'],
staging: false,
strict: false,
toolkitStackName: 'toolkitStackName',
trace: false,
usePreviousParameters: false,
verbose: false,
versionReporting: false,
},
enabled: false,
expectedMessage: 'expectedMessage',
expectError: false,
},
destroy: {
args: {
all: false,
app: 'app',
assetMetadata: false,
caBundlePath: 'caBundlePath',
color: false,
context: {
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: ['stacks'],
staging: false,
strict: false,
trace: false,
verbose: false,
versionReporting: false,
},
enabled: false,
expectedMessage: 'expectedMessage',
expectError: false,
},
},
diffAssets: false,
hooks: {
postDeploy: ['postDeploy'],
postDestroy: ['postDestroy'],
preDeploy: ['preDeploy'],
preDestroy: ['preDestroy'],
},
regions: ['regions'],
stackUpdateWorkflow: false,
};
from aws_cdk.cloud_assembly_schema import TestCase, CdkCommands, DeployCommand, DeployOptions, DestroyCommand, DestroyOptions, Hooks
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cloud_assembly_schema
test_case = TestCase(
stacks=["stacks"],
# the properties below are optional
allow_delete_failures=False,
allow_destroy=["allowDestroy"],
assertion_stack="assertionStack",
assertion_stack_name="assertionStackName",
cdk_command_options=CdkCommands(
deploy=DeployCommand(
args=DeployOptions(
all=False,
app="app",
asset_metadata=False,
ca_bundle_path="caBundlePath",
change_set_name="changeSetName",
ci=False,
color=False,
concurrency=123,
context={
"context_key": "context"
},
debug=False,
ec2_creds=False,
exclusively=False,
execute=False,
force=False,
ignore_errors=False,
json=False,
lookups=False,
notices=False,
notification_arns=["notificationArns"],
output="output",
outputs_file="outputsFile",
parameters={
"parameters_key": "parameters"
},
path_metadata=False,
profile="profile",
proxy="proxy",
require_approval=cloud_assembly_schema.RequireApproval.NEVER,
reuse_assets=["reuseAssets"],
role_arn="roleArn",
rollback=False,
stacks=["stacks"],
staging=False,
strict=False,
toolkit_stack_name="toolkitStackName",
trace=False,
use_previous_parameters=False,
verbose=False,
version_reporting=False
),
enabled=False,
expected_message="expectedMessage",
expect_error=False
),
destroy=DestroyCommand(
args=DestroyOptions(
all=False,
app="app",
asset_metadata=False,
ca_bundle_path="caBundlePath",
color=False,
context={
"context_key": "context"
},
debug=False,
ec2_creds=False,
exclusively=False,
force=False,
ignore_errors=False,
json=False,
lookups=False,
notices=False,
output="output",
path_metadata=False,
profile="profile",
proxy="proxy",
role_arn="roleArn",
stacks=["stacks"],
staging=False,
strict=False,
trace=False,
verbose=False,
version_reporting=False
),
enabled=False,
expected_message="expectedMessage",
expect_error=False
)
),
diff_assets=False,
hooks=Hooks(
post_deploy=["postDeploy"],
post_destroy=["postDestroy"],
pre_deploy=["preDeploy"],
pre_destroy=["preDestroy"]
),
regions=["regions"],
stack_update_workflow=False
)
// 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.*;
TestCase testCase = TestCase.builder()
.stacks(List.of("stacks"))
// the properties below are optional
.allowDeleteFailures(false)
.allowDestroy(List.of("allowDestroy"))
.assertionStack("assertionStack")
.assertionStackName("assertionStackName")
.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();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Cloud_assembly_schema;
var testCase = new TestCase {
Stacks = new [] { "stacks" },
// the properties below are optional
AllowDeleteFailures = false,
AllowDestroy = new [] { "allowDestroy" },
AssertionStack = "assertionStack",
AssertionStackName = "assertionStackName",
CdkCommandOptions = new CdkCommands {
Deploy = new DeployCommand {
Args = new DeployOptions {
All = false,
App = "app",
AssetMetadata = false,
CaBundlePath = "caBundlePath",
ChangeSetName = "changeSetName",
Ci = false,
Color = false,
Concurrency = 123,
Context = new Dictionary<string, string> {
{ "contextKey", "context" }
},
Debug = false,
Ec2Creds = false,
Exclusively = false,
Execute = false,
Force = false,
IgnoreErrors = false,
Json = false,
Lookups = false,
Notices = false,
NotificationArns = new [] { "notificationArns" },
Output = "output",
OutputsFile = "outputsFile",
Parameters = new Dictionary<string, string> {
{ "parametersKey", "parameters" }
},
PathMetadata = false,
Profile = "profile",
Proxy = "proxy",
RequireApproval = RequireApproval.NEVER,
ReuseAssets = new [] { "reuseAssets" },
RoleArn = "roleArn",
Rollback = false,
Stacks = new [] { "stacks" },
Staging = false,
Strict = false,
ToolkitStackName = "toolkitStackName",
Trace = false,
UsePreviousParameters = false,
Verbose = false,
VersionReporting = false
},
Enabled = false,
ExpectedMessage = "expectedMessage",
ExpectError = false
},
Destroy = new DestroyCommand {
Args = new DestroyOptions {
All = false,
App = "app",
AssetMetadata = false,
CaBundlePath = "caBundlePath",
Color = false,
Context = new Dictionary<string, string> {
{ "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 = new [] { "stacks" },
Staging = false,
Strict = false,
Trace = false,
Verbose = false,
VersionReporting = false
},
Enabled = false,
ExpectedMessage = "expectedMessage",
ExpectError = false
}
},
DiffAssets = false,
Hooks = new Hooks {
PostDeploy = new [] { "postDeploy" },
PostDestroy = new [] { "postDestroy" },
PreDeploy = new [] { "preDeploy" },
PreDestroy = new [] { "preDestroy" }
},
Regions = new [] { "regions" },
StackUpdateWorkflow = false
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
testCase := &TestCase{
Stacks: []*string{
jsii.String("stacks"),
},
// the properties below are optional
AllowDeleteFailures: jsii.Boolean(false),
AllowDestroy: []*string{
jsii.String("allowDestroy"),
},
AssertionStack: jsii.String("assertionStack"),
AssertionStackName: jsii.String("assertionStackName"),
CdkCommandOptions: &CdkCommands{
Deploy: &DeployCommand{
Args: &DeployOptions{
All: jsii.Boolean(false),
App: jsii.String("app"),
AssetMetadata: jsii.Boolean(false),
CaBundlePath: jsii.String("caBundlePath"),
ChangeSetName: jsii.String("changeSetName"),
Ci: jsii.Boolean(false),
Color: jsii.Boolean(false),
Concurrency: jsii.Number(123),
Context: map[string]*string{
"contextKey": jsii.String("context"),
},
Debug: jsii.Boolean(false),
Ec2Creds: jsii.Boolean(false),
Exclusively: jsii.Boolean(false),
Execute: jsii.Boolean(false),
Force: jsii.Boolean(false),
IgnoreErrors: jsii.Boolean(false),
Json: jsii.Boolean(false),
Lookups: jsii.Boolean(false),
Notices: jsii.Boolean(false),
NotificationArns: []*string{
jsii.String("notificationArns"),
},
Output: jsii.String("output"),
OutputsFile: jsii.String("outputsFile"),
Parameters: map[string]*string{
"parametersKey": jsii.String("parameters"),
},
PathMetadata: jsii.Boolean(false),
Profile: jsii.String("profile"),
Proxy: jsii.String("proxy"),
RequireApproval: awscdk.Cloud_assembly_schema.RequireApproval_NEVER,
ReuseAssets: []*string{
jsii.String("reuseAssets"),
},
RoleArn: jsii.String("roleArn"),
Rollback: jsii.Boolean(false),
Stacks: []*string{
jsii.String("stacks"),
},
Staging: jsii.Boolean(false),
Strict: jsii.Boolean(false),
ToolkitStackName: jsii.String("toolkitStackName"),
Trace: jsii.Boolean(false),
UsePreviousParameters: jsii.Boolean(false),
Verbose: jsii.Boolean(false),
VersionReporting: jsii.Boolean(false),
},
Enabled: jsii.Boolean(false),
ExpectedMessage: jsii.String("expectedMessage"),
ExpectError: jsii.Boolean(false),
},
Destroy: &DestroyCommand{
Args: &DestroyOptions{
All: jsii.Boolean(false),
App: jsii.String("app"),
AssetMetadata: jsii.Boolean(false),
CaBundlePath: jsii.String("caBundlePath"),
Color: jsii.Boolean(false),
Context: map[string]*string{
"contextKey": jsii.String("context"),
},
Debug: jsii.Boolean(false),
Ec2Creds: jsii.Boolean(false),
Exclusively: jsii.Boolean(false),
Force: jsii.Boolean(false),
IgnoreErrors: jsii.Boolean(false),
Json: jsii.Boolean(false),
Lookups: jsii.Boolean(false),
Notices: jsii.Boolean(false),
Output: jsii.String("output"),
PathMetadata: jsii.Boolean(false),
Profile: jsii.String("profile"),
Proxy: jsii.String("proxy"),
RoleArn: jsii.String("roleArn"),
Stacks: []*string{
jsii.String("stacks"),
},
Staging: jsii.Boolean(false),
Strict: jsii.Boolean(false),
Trace: jsii.Boolean(false),
Verbose: jsii.Boolean(false),
VersionReporting: jsii.Boolean(false),
},
Enabled: jsii.Boolean(false),
ExpectedMessage: jsii.String("expectedMessage"),
ExpectError: jsii.Boolean(false),
},
},
DiffAssets: jsii.Boolean(false),
Hooks: &Hooks{
PostDeploy: []*string{
jsii.String("postDeploy"),
},
PostDestroy: []*string{
jsii.String("postDestroy"),
},
PreDeploy: []*string{
jsii.String("preDeploy"),
},
PreDestroy: []*string{
jsii.String("preDestroy"),
},
},
Regions: []*string{
jsii.String("regions"),
},
StackUpdateWorkflow: jsii.Boolean(false),
}
Properties
allowDeleteFailuresoptionalbooleanallow_delete_failuresoptionalboolallowDeleteFailuresoptionalBooleanAllowDeleteFailuresoptionalboolAllowDeleteFailuresoptional*bool = false #When false, the test will fail if CloudFormation skips deleting a resource during a stack update. When true, only a warning is printed.
allowDestroyoptionalstring[]allow_destroyoptionaltyping.List[str]allowDestroyoptionalList<String>AllowDestroyoptionalstring[]AllowDestroyoptional*[]*string #Default: do not allow destruction of any resources on update
notes
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']
assertionStackoptionalstringassertion_stackoptionalstrassertionStackoptionalStringAssertionStackoptionalstringAssertionStackoptional*string #Default: no assertion stack
This is the value that can be used to deploy the stack with the CDK CLI
assertionStackNameoptionalstringassertion_stack_nameoptionalstrassertionStackNameoptionalStringAssertionStackNameoptionalstringAssertionStackNameoptional*string #Default: no assertion stack
cdkCommandOptionsoptionalCdkCommandscdk_command_optionsoptionalCdkCommandscdkCommandOptionsoptionalCdkCommandsCdkCommandOptionsoptionalCdkCommandsCdkCommandOptionsoptionalCdkCommands #Default: runner default options
diffAssetsoptionalbooleandiff_assetsoptionalbooldiffAssetsoptionalBooleanDiffAssetsoptionalboolDiffAssetsoptional*bool = false #For example any tests involving custom resources or bundling
Default: no hooks
e.g. { postDeploy: ['yarn', 'test'] }
regionsoptionalstring[]regionsoptionaltyping.List[str]regionsoptionalList<String>Regionsoptionalstring[]Regionsoptional*[]*string #Default: can run in any region
stackUpdateWorkflowoptionalbooleanstack_update_workflowoptionalboolstackUpdateWorkflowoptionalBooleanStackUpdateWorkflowoptionalboolStackUpdateWorkflowoptional*bool = true #