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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion lib/chef-dk/command/verify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,39 @@ def components
end
end

add_component "rubocop" do |c|
c.gem_base_dir = "rubocop"
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

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

puts 'foo'
end
EOF
end
sh("rubocop foo.rb -l", cwd: cwd)
end
end
end

add_component "fauxhai" do |c|
c.gem_base_dir = "fauxhai"
c.smoke_test { sh("fauxhai") }
end

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('knife spork info')}
end

add_component "kitchen-vagrant" do |c|
c.gem_base_dir = "kitchen-vagrant"
# The build is not passing in travis, so no tests
Copy link

Choose a reason for hiding this comment

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

And maybe we can test this with: gem list kitchen-vagrant ?

c.smoke_test { sh("gem list kitchen-vagrant") }
end

add_component "package installation" do |c|

c.base_dir = "chef-dk"
Expand Down Expand Up @@ -181,7 +214,6 @@ def components
# object:
ComponentTest::NullTestResult.new
end

end

attr_reader :verification_threads
Expand Down
4 changes: 4 additions & 0 deletions spec/unit/command/verify_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class << self
"chef-client",
"chef-dk",
"chefspec",
"rubocop",
"fauxhai",
"knife-spork",
"kitchen-vagrant",
"package installation"
]
end
Expand Down