Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Added fauxhai, rubocop, knife-spork, and kitchen-vagrant to verify #235

Merged
merged 7 commits into from
Nov 25, 2014

Conversation

jaym
Copy link
Contributor

@jaym jaym commented Nov 13, 2014

This will cause verify to fail on Windows, catching #221
Working on a change to omnibus-chef to correct this problem.
cc @btm @opscode/client-engineers

@lamont-granquist
Copy link
Contributor

might be useful to do something more than --version, but this is vastly better than nothing.


add_component "knife-spork" do |c|
c.gem_base_dir = "knife-spork"
c.unit_test { sh('rake test') }
Copy link

Choose a reason for hiding this comment

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

Instead of rake test I think we can run this:

$ knife spork info
Config Hash:
{}

Plugins:
KnifeSpork::Plugins::Campfire: disabled
KnifeSpork::Plugins::Eventinator: disabled
KnifeSpork::Plugins::Foodcritic: disabled
KnifeSpork::Plugins::Git: disabled
KnifeSpork::Plugins::Graphite: disabled
KnifeSpork::Plugins::Grove: disabled
KnifeSpork::Plugins::HipChat: disabled
KnifeSpork::Plugins::Irccat: disabled
KnifeSpork::Plugins::Jabber: disabled
KnifeSpork::Plugins::Rubocop: disabled
KnifeSpork::Plugins::Slack: disabled
KnifeSpork::Plugins::StatusNet: disabled

c.smoke_test { sh("rubocop --version") }
c.smoke_test do
tmpdir do |cwd|
with_file(File.join(cwd, 'foo.rb')) do |f|
Copy link
Contributor

Choose a reason for hiding this comment

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

At the risk of asking for trouble, won't this automatically open the file in $PWD?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i don't think so, tmp dir will create a dir and return that as cwd, which gets joined to foo.rb

@jaym jaym force-pushed the jdmundrawala/enhance-verify branch from 43f5298 to f5f9191 Compare November 14, 2014 21:10
@jaym
Copy link
Contributor Author

jaym commented Nov 19, 2014

@lamont-granquist @btm @sersut I've added something better than version.

@jaym jaym force-pushed the jdmundrawala/enhance-verify branch from 405f75a to 08e75ef Compare November 20, 2014 22:40
@tyler-ball
Copy link
Contributor

@jdmundrawala The rubocop smoke test looks 👍 - what about @sersut's question for spork?

@jaym
Copy link
Contributor Author

jaym commented Nov 21, 2014

@tyler-ball it's there, not sure why it does not show up under the comment view. Check the file directory

@tyler-ball
Copy link
Contributor

@jdmundrawala I see it now - thanks. If the sh fails, will it raise an exception or just return an error code?

I'm just making sure I understand how smoke_test knows if sh('knife spork info') fails

@danielsdeleo
Copy link
Contributor

@tyler-ball the way these work is, the test block returns a Mixlib::ShellOut object (or compatible type), and chef verify looks at the exit code and decides what to do with it: https://github.com/opscode/chef-dk/blob/5003ca06b220bb24b4deabd0e0d35cf07fb9019f/lib/chef-dk/command/verify.rb#L247-L252

tmpdir do |cwd|
with_file(File.join(cwd, 'foo.rb')) do |f|
f.write <<-EOF
def foo

Choose a reason for hiding this comment

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

Some debug left-overs? 🍒

Copy link
Contributor

Choose a reason for hiding this comment

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

@kwilczynski I don't think so - it seems to me that he is writing out some ruby code and then running rubocop on it to validate that rubocop is installed and working correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what @tyler-ball said

@btm
Copy link
Contributor

btm commented Nov 25, 2014

👍

jaym added a commit that referenced this pull request Nov 25, 2014
Added fauxhai, rubocop, knife-spork, and kitchen-vagrant to verify
@jaym jaym merged commit 992870b into master Nov 25, 2014
@jaym jaym deleted the jdmundrawala/enhance-verify branch January 27, 2016 04:49
@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

9 participants