Skip to content

Commit

Permalink
Travis check for syntax and lint before spec tests
Browse files Browse the repository at this point in the history
Without this patch lint and syntax checks were not being done before the
rspec tests. This ensures that the code can be parsed and passes lint
before the spec tests.
  • Loading branch information
ghoneycutt committed Sep 10, 2013
1 parent ac281d9 commit 347cdc1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fixtures:
symlinks:
"lvm": "#{source_dir}"
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ branches:
- master
language: ruby
bundler_args: --without development
script: bundle exec rake spec SPEC_OPTS='--format documentation'
script: 'bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec'
after_success:
- git clone -q git://github.com/puppetlabs/ghpublisher.git .forge-releng
- .forge-releng/publish
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ else
gem 'puppet', :require => false
end

gem 'puppet-lint', '>= 0.3.2'
# vim:ft=ruby
10 changes: 10 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]

desc "Run puppet in noop mode and check for syntax errors."
task :validate do
Dir['manifests/**/*.pp'].each do |path|
sh "puppet parser validate --noop #{path}"
end
end

0 comments on commit 347cdc1

Please sign in to comment.