Skip to content
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

print profile summary and test summary #1083

Merged
merged 1 commit into from
Sep 19, 2016
Merged

Conversation

vjeffrey
Copy link

@vjeffrey vjeffrey commented Sep 15, 2016

i put a wip on it only because I'm working on getting the two shell functional tests that are failing to a passing state; i'm a little confused about why they're failing, since running the same thing those tests are running manually gives me the correct output.
screen shot 2016-09-15 at 4 50 47 pm
screen shot 2016-09-15 at 4 50 55 pm
screen shot 2016-09-15 at 4 51 02 pm

fixes #852

@vjeffrey
Copy link
Author

this is what the two failing shell tests are running; it gives me the correct output here but comes back with an incorrect summary count in the functional tests :/
screen shot 2016-09-15 at 4 55 50 pm

@stevendanna
Copy link
Contributor

@vjeffrey I think the remaining failures are related to inspec shell -c which takes a whole different code path: https://github.com/chef/inspec/blob/master/lib/inspec/cli.rb#L214-L224

@vjeffrey
Copy link
Author

argh!!!!!! ok, i'll go try to fix that. argggg

@vjeffrey
Copy link
Author

mo-flippin-o i'm down to one failing test. almost there.

@vjeffrey
Copy link
Author

vjeffrey commented Sep 15, 2016

screen shot 2016-09-15 at 7 09 48 pm

AHHHHHHHHHHHHHHHH i'm trying to figure out why the second test isn't in the results array....

@vjeffrey vjeffrey changed the title wip: print profile summary and test summary print profile summary and test summary Sep 16, 2016
@vjeffrey
Copy link
Author

ready for review!

failed += 1
elsif control[:results].any? { |r| r[:status] == 'skipped' }
skipped += 1
@anonymous_tests.each do |control|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please count control_tests too :)

else
passed += 1
passed +=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add spaces

COLORS['passed'], 0, COLORS['reset'],
COLORS['failed'], 0, COLORS['reset'],
COLORS['skipped'], 0, COLORS['reset'])
output.puts(s) if @current_control.nil? || (@anonymous_tests.empty? && controls_res['total'] == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this old-school summary and use the Test summary instead (adjusting functional tests)

@vjeffrey
Copy link
Author

comments addressed @arlimus :)

@vjeffrey
Copy link
Author

screen shot 2016-09-18 at 9 44 37 pm

@arlimus
Copy link
Contributor

arlimus commented Sep 19, 2016

Awesome improvement, thank you @vjeffrey !! 😄
Also kudos @stevendanna for helping on this one.

@arlimus arlimus merged commit 303cb08 into master Sep 19, 2016
@arlimus arlimus deleted the vj/update-json-summary branch September 19, 2016 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InSpec output for summary needs to count controls
4 participants