Files
cookbook-openstack-block-st…/run_tests.bash
John Dewey 9ae54fc736 Initial testing via chefspec of all recipes
* Did not implement template testing ATM.  Need to go through
  and add those.  Hoping to get some help with that.
2013-05-05 22:17:48 -07:00

20 lines
534 B
Bash
Executable File

#!/usr/bin/env bash
# A script to run tests locally before committing.
set -e
COOKBOOK=$(awk '/^name/ {print $NF}' metadata.rb |tr -d \"\')
if [ -z $COOKBOOK ]; then
echo "Cookbook name not defined in metadata.rb"
exit 1
fi
BUNDLE_PATH=${BUNDLE_PATH:-.bundle}
BERKSHELF_PATH=${BERKSHELF_PATH:-.cookbooks}
bundle install --path=${BUNDLE_PATH}
bundle exec berks install --path=${BERKSHELF_PATH}
bundle exec foodcritic -f any -t ~FC003 -t ~FC023 ${BERKSHELF_PATH}/${COOKBOOK}
bundle exec rspec ${BERKSHELF_PATH}/${COOKBOOK}