Use strainer for chef checks when possible

This way, we get a per-cookbook possibility to set test-specific
options.  For example, a certain cookbook might want to be more or less
strict with foodcritic and could then handle that from the cookbooks
Strainerfile.  In addition to that, its is transparent for cookbook
contributors to figure out what test get run by jenkins.

Change-Id: I0353b8207abb116ea3849c04df39546f8c2625db
This commit is contained in:
Stephan Renatus 2014-05-26 11:16:14 +02:00
parent 85e3221f0b
commit cf7c5bddcf

View File

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