Fix Chef cookbook-related strainer issue

The last change* sadly missed a call to berks install and hence makes
strainer fail every time.  This change introduces a berks install call
to a workspace-relative directory that is then passed to strainer.

To use strainer, we need chef-berkshelf-prep for each test suite, though.

*) I0353b8207abb116ea3849c04df39546f8c2625db

Change-Id: Ic10fc436fae2e5bcc05f9fae15e43b7601255471
This commit is contained in:
Stephan Renatus 2014-06-02 12:41:42 +02:00
parent 6e88e9ada2
commit 4ddb8d2fa0
2 changed files with 6 additions and 5 deletions

View File

@ -20,6 +20,7 @@
- revoke-sudo
- gerrit-git-prep
- chef-bundler-prep
- chef-berkshelf-prep
- chef-cookbook-foodcritic
publishers:
@ -33,6 +34,7 @@
- revoke-sudo
- gerrit-git-prep
- chef-bundler-prep
- chef-berkshelf-prep
- chef-cookbook-rubocop
publishers:

View File

@ -140,11 +140,10 @@
name: chef-cookbook-rubocop
builders:
- shell: |
COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\')
if grep rubocop: Strainerfile; then
ruby1.9.1 /usr/bin/bundle exec strainer test -o rubocop
ruby1.9.1 /usr/bin/bundle exec strainer test --cookbooks-path=.cookbooks --only=rubocop
else
ruby1.9.1 /usr/bin/bundle exec ruby1.9.1 /usr/bin/bundle exec rubocop
ruby1.9.1 /usr/bin/bundle exec rubocop
fi
- builder:
@ -152,7 +151,7 @@
builders:
- shell: |
if grep foodcritic: Strainerfile; then
ruby1.9.1 /usr/bin/bundle exec strainer test -o foodcritic
ruby1.9.1 /usr/bin/bundle exec strainer test --cookbooks-path=.cookbooks --only=foodcritic
else
ruby1.9.1 /usr/bin/bundle exec foodcritic -f any -t ~FC003 -t ~FC023 .
fi
@ -163,7 +162,7 @@
- shell: |
COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\')
if grep chefspec: Strainerfile; then
ruby1.9.1 /usr/bin/bundle exec strainer test -o chefspec
ruby1.9.1 /usr/bin/bundle exec strainer test --cookbooks-path=.cookbooks --only=chefspec
else
ruby1.9.1 /usr/bin/bundle exec rspec .cookbooks/$COOKBOOK/spec
fi