Skip to content

Commit

Permalink
update system test for eyaml parsing and validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuchard committed Sep 29, 2023
1 parent 151677e commit b8af8f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 2.3.0
### 2.3.0 (Next)
- Support Puppet 8.
- Upgrade EYAML validation functionality from experimental to beta.

### 2.2.2
- Workaround Ruby passbyref issue mutating an immutable.
Expand Down
20 changes: 10 additions & 10 deletions spec/system/system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
context 'executed as a system from the CLI with arguments and various files to be processed' do
# see regression_check_spec
if ENV['CIRCLECI'] == 'true' || ENV['GITHUB_ACTIONS'] == 'true'
let(:cli) { PuppetCheck::CLI.run(%w[-s --puppet-lint no-hard_tabs-check,no-140chars-check --rubocop Layout/LineLength,Style/Encoding .]) }
let(:cli) { PuppetCheck::CLI.run(%w[-s --puppet-lint no-hard_tabs-check,no-140chars-check --rubocop Layout/LineLength,Style/Encoding --public keys/public_key.pkcs7.pem --private keys/private_key.pkcs7.pem .]) }
else
let(:cli) { PuppetCheck::CLI.run(%w[-s --puppet-lint no-hard_tabs-check,no-140chars-check --rubocop Layout/LineLength,Style/Encoding --smoke -n good.example.com --octoconfig spec/octocatalog-diff/octocatalog-diff.cfg.rb .]) }
let(:cli) { PuppetCheck::CLI.run(%w[-s --puppet-lint no-hard_tabs-check,no-140chars-check --rubocop Layout/LineLength,Style/Encoding --public keys/public_key.pkcs7.pem --private keys/private_key.pkcs7.pem --smoke -n good.example.com --octoconfig spec/octocatalog-diff/octocatalog-diff.cfg.rb .]) }
end

it 'outputs diagnostic results correctly after processing all of the files' do
Dir.chdir(fixtures_dir)

expect { cli }.not_to raise_exception

expect(PuppetCheck.files[:errors].length).to eql(10)
expect(PuppetCheck.files[:warnings].length).to eql(11)
expect(PuppetCheck.files[:clean].length).to eql(13)
expect(PuppetCheck.files[:ignored].length).to eql(6)
expect(PuppetCheck.files[:errors].length).to eql(11)
expect(PuppetCheck.files[:warnings].length).to eql(12)
expect(PuppetCheck.files[:clean].length).to eql(14)
expect(PuppetCheck.files[:ignored].length).to eql(3)

expect(cli).to eql(2)
end
Expand Down Expand Up @@ -50,10 +50,10 @@
expect { Rake::Task[:'puppetcheck:file'].invoke(settings) }.to raise_error(ArgumentError, /Attempt to redefine entity/)

# current puppet pops limitations no longer allow testing this
# expect(PuppetCheck.files[:errors].length).to eql(10)
# expect(PuppetCheck.files[:warnings].length).to eql(11)
# expect(PuppetCheck.files[:clean].length).to eql(13)
# expect(PuppetCheck.files[:ignored].length).to eql(6)
# expect(PuppetCheck.files[:errors].length).to eql(11)
# expect(PuppetCheck.files[:warnings].length).to eql(12)
# expect(PuppetCheck.files[:clean].length).to eql(14)
# expect(PuppetCheck.files[:ignored].length).to eql(3)
end
end
end

0 comments on commit b8af8f8

Please sign in to comment.