-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show skip_message and correct title #1109
Conversation
1546dcc
to
4e3754b
Compare
Tests still have to be updated, but let's agree on the desired format. With this profile: control 'CHECK file' do
title "Check a file"
describe file('/etc/passwd') do
it { should exist }
its('mode') { should cmp '0644' }
its('size') { should be < 5 }
end
end
control 'CHECK win111' do
title "Trying my luck :)"
describe windows_feature('linux_kernel') do
it { should be_installed }
its('info') { should cmp 'test' }
end
end
control 'CHECK win222' do
describe windows_feature('linux_kernel') do
it { should be_installed }
end
end
describe directory('/etc/') do
it { should exist }
its('mode') { should cmp '0755' }
end
describe windows_feature('linux_kernel') do
it { should be_installed }
it { should be_enabled }
end Code in master is generating this cli output:
As can be seen here(^), reason why control This is what my PR addresses and provides this output for the same profile:
It also removes the In "results": [
{
"status": "skipped",
"code_desc": "Windows Feature 'linux_kernel' The `windows_feature` resource is not supported on your OS.",
"skip_message": "The `windows_feature` resource is not supported on your OS.",
"resource": "Windows Feature 'linux_kernel'",
"run_time": 1.6e-05,
"start_time": "2016-09-22 12:00:20 +0100"
} In "results": [
{
"status": "skipped",
"code_desc": "Windows Feature 'linux_kernel'",
"skip_message": "The `windows_feature` resource is not supported on your OS.",
"resource": "Windows Feature 'linux_kernel'",
"run_time": 9e-06,
"start_time": "2016-09-22 11:58:11 +0100"
} |
I love that new output, it is much clearer and explains what is going on! Thank you Alex 👍 |
👍 |
da15a5f
to
fe05e53
Compare
fe05e53
to
cc25e88
Compare
@alexpop is this ready? Could you please resolve the Gemfile conflict? |
cc25e88
to
13da437
Compare
Ready @chris-rock, all green! |
Fixes: #1097
With the example in this ticket ^, the change in this PR provides the following output:
When a control title is not defined:
When a control title is defined:
I'll have to do a bit more testing.
@ksubrama, do you recall why we have these?
https://github.com/chef/inspec/blob/v0.35.0/lib/inspec/rspec_json_formatter.rb#L337-L338