Fixed failing test

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
Vasu1105 2021-06-04 15:42:14 +05:30
parent 38206d80e8
commit 6f4bd2413d
3 changed files with 3 additions and 10 deletions

View file

@ -3,9 +3,3 @@ control 'CONTROL super' do
skip 'This will be skipped super intentionally.'
end
end
control 'CONTROL database' do
describe mysql_session do
its('something') { should be 3 }
end
end

View file

@ -97,7 +97,7 @@ describe "inspec exec with junit formatter" do
_(run_result.stderr).must_equal ""
_(schema.validate(doc)).must_be_empty
suite = doc.xpath("//testsuite").first
_(suite.attr("skipped")).must_equal "2"
_(suite.attr("skipped")).must_equal "1"
testcase = doc.xpath("//testcase").first
_(testcase.xpath("//skipped")).wont_be_empty
end

View file

@ -299,8 +299,7 @@ Test Summary: 0 successful, 0 failures, 0 skipped
it "exits with an error" do
_(stdout).must_include "skippy\n ↺ This will be skipped super intentionally.\n"
_(stdout).must_include " ↺ CONTROL database: MySQL Session\n ↺ Can't run MySQL SQL checks without authentication\n"
_(stdout).must_include "Profile Summary: 0 successful controls, 0 control failures, 2 controls skipped\nTest Summary: 0 successful, 0 failures, 2 skipped\n"
_(stdout).must_include "Profile Summary: 0 successful controls, 0 control failures, 1 control skipped\nTest Summary: 0 successful, 0 failures, 1 skipped\n"
_(stderr).must_equal ""
@ -312,7 +311,7 @@ Test Summary: 0 successful, 0 failures, 0 skipped
let(:out) { inspec("exec " + File.join(profile_path, "skippy-controls") + " --no-distinct-exit --no-create-lockfile") }
it "exits with code 0 and skipped tests in output" do
_(stdout).must_include "Profile Summary: 0 successful controls, 0 control failures, 2 controls skipped\nTest Summary: 0 successful, 0 failures, 2 skipped\n"
_(stdout).must_include "Profile Summary: 0 successful controls, 0 control failures, 1 control skipped\nTest Summary: 0 successful, 0 failures, 1 skipped\n"
_(stderr).must_equal ""