File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -20,18 +20,22 @@ changedmodules=$(echo -e "$tmpchangedmodules" | sort -u)
2020
2121# now that we have the list of modules that changed, run rspec for each module
2222for module_dir in $changedmodules ; do
23- echo -e " \e[0;36mRunning rspec-puppet tests for module $1 ...\e[0m"
24- cd $module_dir
25- # this will run rspec for every test in the module
26- rspec > $error_msg
27- RC=$?
28- if [ $RC -ne 0 ]; then
29- echo -en " \e[0;31m"
30- cat $error_msg
31- echo -e " Error: rspec-puppet test(s) failed for $module_dir (see above)\e[0m"
32- syntax_errors=` expr $syntax_errors + 1`
23+ # only run rspec if the "spec" directory exists
24+ if [ -d " ${module_dir} /spec" ]; then
25+ echo -e " \e[0;36mRunning rspec-puppet tests for module $1 ...\e[0m"
26+ cd $module_dir
27+ # this will run rspec for every test in the module
28+ rspec > $error_msg
29+ RC=$?
30+ if [ $RC -ne 0 ]; then
31+ echo -en " \e[0;31m"
32+ cat $error_msg
33+ echo -e " Error: rspec-puppet test(s) failed for $module_dir (see above)\e[0m"
34+ syntax_errors=` expr $syntax_errors + 1`
35+ fi
3336 fi
3437done
38+
3539cd $oldpwd > /dev/null
3640
3741rm $error_msg
You can’t perform that action at this time.
0 commit comments