Interface ITestOptions
The set of options to control the workflow of the test runner.
Namespace: Amazon.CDK.CloudAssemblySchema
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ITestOptions
Syntax (vb)
Public Interface ITestOptions
Remarks
ExampleMetadata: fixture=_generated
Examples
// 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 testOptions = new TestOptions {
AllowDestroy = new [] { "allowDestroy" },
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
};
Synopsis
Properties
Allow |
List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test. |
Cdk |
Additional options to use for each CDK command. |
Diff |
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. |
Hooks | Additional commands to run at predefined points in the test workflow. |
Regions | Limit deployment to these regions. |
Stack |
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. |
Properties
AllowDestroy
List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.
virtual string[] AllowDestroy { get; }
Property Value
System.
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
CdkCommandOptions
Additional options to use for each CDK command.
virtual ICdkCommands CdkCommandOptions { get; }
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.
virtual Nullable<bool> DiffAssets { get; }
Property Value
System.
Remarks
For example any tests involving custom resources or bundling
Default: false
Hooks
Additional commands to run at predefined points in the test workflow.
virtual IHooks Hooks { get; }
Property Value
Remarks
e.g. { postDeploy: ['yarn', 'test'] }
Default: - no hooks
Regions
Limit deployment to these regions.
virtual string[] Regions { get; }
Property Value
System.
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.
virtual Nullable<bool> StackUpdateWorkflow { get; }
Property Value
System.
Remarks
Default: true