Skip to content

Commit

Permalink
Add epp to acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Jul 5, 2019
1 parent f5fe32f commit b611171
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 11 additions & 0 deletions spec/acceptance/validate_puppet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'fileutils'

describe 'pdk validate puppet', module_command: true do
let(:epp_spinner_text) { %r{checking puppet EPP syntax}i }
let(:syntax_spinner_text) { %r{checking puppet manifest syntax}i }
let(:lint_spinner_text) { %r{checking puppet manifest style}i }

Expand All @@ -16,12 +17,14 @@
context 'with no .pp files' do
describe command('pdk validate puppet --format text:stdout --format junit:report.xml') do
its(:exit_status) { is_expected.to eq(0) }
its(:stderr) { is_expected.not_to match(epp_spinner_text) }
its(:stderr) { is_expected.not_to match(syntax_spinner_text) }
its(:stderr) { is_expected.not_to match(lint_spinner_text) }
its(:stdout) { is_expected.to match(%r{Target does not contain any files to validate}) }

describe file('report.xml') do
its(:content) { is_expected.to contain_valid_junit_xml }
its(:content) { is_expected.to have_junit_testcase.in_testsuite('puppet-epp').that_was_skipped }
its(:content) { is_expected.to have_junit_testcase.in_testsuite('puppet-syntax').that_was_skipped }
its(:content) { is_expected.to have_junit_testcase.in_testsuite('puppet-lint').that_was_skipped }
end
Expand All @@ -45,12 +48,14 @@ class foo {

describe command('pdk validate puppet --format text:stdout --format junit:report.xml') do
its(:exit_status) { is_expected.to eq(0) }
its(:stderr) { is_expected.not_to match(epp_spinner_text) }
its(:stderr) { is_expected.to match(syntax_spinner_text) }
its(:stderr) { is_expected.to match(lint_spinner_text) }
its(:stdout) { is_expected.to match(%r{Target does not contain any files to validate}) }

describe file('report.xml') do
its(:content) { is_expected.to contain_valid_junit_xml }
its(:content) { is_expected.to have_junit_testsuite('puppet-epp') }
its(:content) { is_expected.to have_junit_testsuite('puppet-syntax') }
its(:content) { is_expected.to have_junit_testsuite('puppet-lint') }
end
Expand All @@ -77,6 +82,7 @@ class foo {

describe command('pdk validate puppet --format text:stdout --format junit:report.xml') do
its(:exit_status) { is_expected.to eq(0) }
its(:stderr) { is_expected.not_to match(epp_spinner_text) }
its(:stderr) { is_expected.to match(syntax_spinner_text) }
its(:stderr) { is_expected.to match(lint_spinner_text) }

Expand Down Expand Up @@ -185,6 +191,7 @@ class foo {
describe command('pdk validate puppet --format text:stdout --format junit:report.xml') do
its(:exit_status) { is_expected.to eq(0) }
its(:stdout) { is_expected.to match(%r{^warning:.*#{Regexp.escape(init_pp)}.+class not documented}i) }
its(:stderr) { is_expected.not_to match(epp_spinner_text) }
its(:stderr) { is_expected.to match(syntax_spinner_text) }
its(:stderr) { is_expected.to match(lint_spinner_text) }

Expand Down Expand Up @@ -240,6 +247,7 @@ class foo {

describe command('pdk validate puppet --format text:stdout --format junit:report.xml') do
its(:exit_status) { is_expected.not_to eq(0) }
its(:stderr) { is_expected.not_to match(epp_spinner_text) }
its(:stderr) { is_expected.to match(syntax_spinner_text) }
its(:stderr) { is_expected.not_to match(lint_spinner_text) }

Expand Down Expand Up @@ -295,6 +303,7 @@ class foo {
describe command('pdk validate puppet --format text:stdout --format junit:report.xml') do
its(:exit_status) { is_expected.not_to eq(0) }
its(:stdout) { is_expected.to match(%r{#{Regexp.escape(example_pp)}.+autoload module layout}i) }
its(:stderr) { is_expected.not_to match(epp_spinner_text) }
its(:stderr) { is_expected.to match(syntax_spinner_text) }
its(:stderr) { is_expected.to match(lint_spinner_text) }

Expand Down Expand Up @@ -334,6 +343,7 @@ class foo {
describe command("pdk validate puppet --format text:stdout --format junit:report.xml #{clean_pp}") do
its(:exit_status) { is_expected.to eq(0) }
its(:stdout) { is_expected.to match(%r{Target does not contain any files to validate}) }
its(:stderr) { is_expected.not_to match(epp_spinner_text) }
its(:stderr) { is_expected.to match(syntax_spinner_text) }
its(:stderr) { is_expected.to match(lint_spinner_text) }

Expand Down Expand Up @@ -388,6 +398,7 @@ class foo {

describe command("pdk validate puppet --format text:stdout --format junit:report.xml #{another_problem_dir}") do
its(:exit_status) { is_expected.not_to eq(0) }
its(:stderr) { is_expected.not_to match(epp_spinner_text) }
its(:stderr) { is_expected.to match(syntax_spinner_text) }
its(:stderr) { is_expected.to match(lint_spinner_text) }
its(:stdout) { is_expected.to match(%r{#{Regexp.escape(another_problem_pp)}}) }
Expand Down
6 changes: 0 additions & 6 deletions spec/unit/pdk/validate/puppet/puppet_epp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@

it_behaves_like 'it accepts .epp targets'

describe '.pattern_ignore' do
it 'does not match plan files' do
expect(described_class.pattern_ignore).to eq('')
end
end

describe '.invoke' do
context 'when the validator runs correctly' do
before(:each) do
Expand Down

0 comments on commit b611171

Please sign in to comment.