Class: AWSCDK::CloudAssemblySchema::TestOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudAssemblySchema::TestOptions
- Defined in:
- cloud_assembly_schema/test_options.rb
Overview
The set of options to control the workflow of the test runner.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#allow_delete_failures ⇒ Boolean?
readonly
Whether to allow resources that fail to delete during a stack update.
-
#allow_destroy ⇒ Array<String>?
readonly
List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.
-
#cdk_command_options ⇒ AWSCDK::CloudAssemblySchema::CDKCommands?
readonly
Additional options to use for each CDK command.
-
#diff_assets ⇒ Boolean?
readonly
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 ⇒ AWSCDK::CloudAssemblySchema::Hooks?
readonly
Additional commands to run at predefined points in the test workflow.
-
#regions ⇒ Array<String>?
readonly
Limit deployment to these regions.
-
#stack_update_workflow ⇒ Boolean?
readonly
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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(allow_delete_failures: nil, allow_destroy: nil, cdk_command_options: nil, diff_assets: nil, hooks: nil, regions: nil, stack_update_workflow: nil) ⇒ TestOptions
constructor
A new instance of TestOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(allow_delete_failures: nil, allow_destroy: nil, cdk_command_options: nil, diff_assets: nil, hooks: nil, regions: nil, stack_update_workflow: nil) ⇒ TestOptions
Returns a new instance of TestOptions.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'cloud_assembly_schema/test_options.rb', line 14 def initialize(allow_delete_failures: nil, allow_destroy: nil, cdk_command_options: nil, diff_assets: nil, hooks: nil, regions: nil, stack_update_workflow: nil) @allow_delete_failures = allow_delete_failures Jsii::Type.check_type(@allow_delete_failures, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "allowDeleteFailures") unless @allow_delete_failures.nil? @allow_destroy = allow_destroy Jsii::Type.check_type(@allow_destroy, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowDestroy") unless @allow_destroy.nil? @cdk_command_options = .is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::CDKCommands.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@cdk_command_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuQ2RrQ29tbWFuZHMifQ==")), "cdkCommandOptions") unless @cdk_command_options.nil? @diff_assets = diff_assets Jsii::Type.check_type(@diff_assets, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "diffAssets") unless @diff_assets.nil? @hooks = hooks.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::Hooks.new(**hooks.transform_keys(&:to_sym)) : hooks Jsii::Type.check_type(@hooks, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuSG9va3MifQ==")), "hooks") unless @hooks.nil? @regions = regions Jsii::Type.check_type(@regions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "regions") unless @regions.nil? @stack_update_workflow = stack_update_workflow Jsii::Type.check_type(@stack_update_workflow, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "stackUpdateWorkflow") unless @stack_update_workflow.nil? end |
Instance Attribute Details
#allow_delete_failures ⇒ Boolean? (readonly)
Default: false
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.
38 39 40 |
# File 'cloud_assembly_schema/test_options.rb', line 38 def allow_delete_failures @allow_delete_failures end |
#allow_destroy ⇒ Array<String>? (readonly)
Default: - do not allow destruction of any resources on update
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']
50 51 52 |
# File 'cloud_assembly_schema/test_options.rb', line 50 def allow_destroy @allow_destroy end |
#cdk_command_options ⇒ AWSCDK::CloudAssemblySchema::CDKCommands? (readonly)
Default: - runner default options
Additional options to use for each CDK command.
55 56 57 |
# File 'cloud_assembly_schema/test_options.rb', line 55 def @cdk_command_options end |
#diff_assets ⇒ Boolean? (readonly)
Default: false
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
63 64 65 |
# File 'cloud_assembly_schema/test_options.rb', line 63 def diff_assets @diff_assets end |
#hooks ⇒ AWSCDK::CloudAssemblySchema::Hooks? (readonly)
Default: - no hooks
Additional commands to run at predefined points in the test workflow.
e.g. { postDeploy: ['yarn', 'test'] }
70 71 72 |
# File 'cloud_assembly_schema/test_options.rb', line 70 def hooks @hooks end |
#regions ⇒ Array<String>? (readonly)
Default: - can run in any region
Limit deployment to these regions.
75 76 77 |
# File 'cloud_assembly_schema/test_options.rb', line 75 def regions @regions end |
#stack_update_workflow ⇒ Boolean? (readonly)
Default: true
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.
80 81 82 |
# File 'cloud_assembly_schema/test_options.rb', line 80 def stack_update_workflow @stack_update_workflow end |
Class Method Details
.jsii_properties ⇒ Object
82 83 84 85 86 87 88 89 90 91 92 |
# File 'cloud_assembly_schema/test_options.rb', line 82 def self.jsii_properties { :allow_delete_failures => "allowDeleteFailures", :allow_destroy => "allowDestroy", :cdk_command_options => "cdkCommandOptions", :diff_assets => "diffAssets", :hooks => "hooks", :regions => "regions", :stack_update_workflow => "stackUpdateWorkflow", } end |
Instance Method Details
#to_jsii ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'cloud_assembly_schema/test_options.rb', line 94 def to_jsii result = {} result.merge!({ "allowDeleteFailures" => @allow_delete_failures, "allowDestroy" => @allow_destroy, "cdkCommandOptions" => @cdk_command_options, "diffAssets" => @diff_assets, "hooks" => @hooks, "regions" => @regions, "stackUpdateWorkflow" => @stack_update_workflow, }) result.compact end |