Skip to content

Commit

Permalink
#141 Upgrading cfn-model version to inherit Globals section parsing (#…
Browse files Browse the repository at this point in the history
…381)

* Updating deprecated 'version' property to 'ruby-version' for setup-ruby action.

* #141 Upgrading cfn-model version to inherit Globals section parsing and adding validation test.
  • Loading branch information
pshelby authored Feb 21, 2020
1 parent f3ef5d2 commit 8e38447
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AllCops:
Style/IfUnlessModifier:
Enabled: false

Metrics/LineLength:
Layout/LineLength:
Max: 120

Style/Documentation:
Expand Down
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PATH
specs:
cfn-nag (0.0.0)
aws-sdk-s3 (~> 1.60.1)
cfn-model (= 0.4.14)
cfn-model (= 0.4.16)
lightly (~> 0.3.2)
logging (~> 2.2.2)
netaddr (~> 2.0.4)
Expand All @@ -14,22 +14,22 @@ GEM
specs:
ast (2.4.0)
aws-eventstream (1.0.3)
aws-partitions (1.270.0)
aws-sdk-core (3.89.1)
aws-partitions (1.275.0)
aws-sdk-core (3.90.1)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.28.0)
aws-sdk-kms (1.29.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.60.1)
aws-sdk-s3 (1.60.2)
aws-sdk-core (~> 3, >= 3.83.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2)
cfn-model (0.4.14)
cfn-model (0.4.16)
kwalify (= 0.7.2)
psych (~> 3)
diff-lcs (1.3)
Expand Down
2 changes: 1 addition & 1 deletion cfn-nag.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |s|
# versus what we used to run tests in cfn-nag before publishing cfn-nag
# they are coupled and we are doing a good bit of experimenting in cfn-model
# i might consider collapsing them again....
s.add_runtime_dependency('cfn-model', '0.4.14')
s.add_runtime_dependency('cfn-model', '0.4.16')
s.add_runtime_dependency('logging', '~> 2.2.2')
s.add_runtime_dependency('netaddr', '~> 2.0.4')
s.add_runtime_dependency('optimist', '~> 3.0.0')
Expand Down
9 changes: 9 additions & 0 deletions spec/cfn_nag_integration/cfn_nag_lambda_permission_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,14 @@
actual_aggregate_results = @cfn_nag.audit_aggregate_across_files input_path: test_template_path(template_name)
expect(actual_aggregate_results[0][:file_results][:failure_count]).to eq 0
end

it 'makes globals available as a top-level hash' do
template_name = 'yaml/sam/globals.yml'
cfn_model = CfnParser.new.parse read_test_template(template_name)
globals = cfn_model.globals

expect(globals).to_not be_nil
expect(globals['Function'].timeout).to eq 30
end
end
end

0 comments on commit 8e38447

Please sign in to comment.