File tree Expand file tree Collapse file tree 3 files changed +17
-12
lines changed
Expand file tree Collapse file tree 3 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -ev
3+ MODS=" $( git diff HEAD~1 Puppetfile | grep ^- -B2 | grep mod | cut -d" '" -f2) "
4+ rake validate_puppetfile SPEC_OPTS=' --format documentation --color --backtrace' || exit 1
5+ for module in ${MODS} ; do
6+ if [ -e ./${module} /Rakefile ]; then
7+ rake test_modules[./${module} /Rakefile] SPEC_OPTS=' --format documentation --color --backtrace' || exit 1
8+ else
9+ echo " Missing ./${module} /Rakefile, not running spec tests."
10+ fi
11+ done
Original file line number Diff line number Diff line change 11language : ruby
22install :
3- - gem install bundler
4- - gem install rake
5- - gem install r10k
6- script : " rake test SPEC_OPTS='--format documentation --color --backtrace'"
3+ script : " ./.travis.sh"
74rvm :
8- - 1.9.3
95 - 2.0.0
106matrix :
117 fast_finish : true
128env :
139 matrix :
14- - PUPPET_GEM_VERSION="~> 3.3.0"
15- - PUPPET_GEM_VERSION="~> 3.4.0"
16- - PUPPET_GEM_VERSION="~> 3.6.0"
1710 - PUPPET_GEM_VERSION="~> 3.7.0"
1811notifications :
1912 email : false
Original file line number Diff line number Diff line change @@ -2,17 +2,18 @@ task(:default).clear
22task :default => :test
33
44desc 'Run Puppetfile Validation'
5- task :test => [ :validate_puppetfile , :all_modules ]
5+ task :test => [ :validate_puppetfile , :test_modules ]
66
77desc "Validate the Puppetfile syntax"
88task :validate_puppetfile do
99 $stderr. puts "---> syntax:puppetfile"
1010 sh "r10k puppetfile check"
1111end
1212
13- desc "Run rspec tests for each modules"
14- task :all_modules do
15- FileList [ "*/Rakefile" ] . each do |project |
13+ desc "Run rspec test on specified modules"
14+ task :test_modules , [ :modules ] do |t , args |
15+ args . with_defaults ( :modules => FileList [ "*/Rakefile" ] )
16+ Array ( args [ :modules ] ) . each do |project |
1617 dir = project . pathmap ( "%d" )
1718 Dir . chdir ( dir ) do
1819 puts "======"
You can’t perform that action at this time.
0 commit comments