Skip to content

Commit

Permalink
travis, gem, rake cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jlyheden committed Nov 26, 2014
1 parent 142a8dc commit 839de60
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ spec/fixtures/
.vagrant/
.kitchen/
.kitchen.local.yml
reports/
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format RspecJunitFormatter
--out reports/rspec.xml
--format documentation
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rvm: 1.9.3
env:
- PUPPET_VERSION=3.7.3
11 changes: 7 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
source 'https://rubygems.org'

puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3', '<=3.5.1']
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : '>=3.7.3'

group :rspec, :kitchen do
gem 'librarian-puppet'
gem 'puppet', puppetversion
gem 'rspec_junit_formatter'
gem 'puppet-blacksmith'
end

group :rspec do
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'puppet-lint', '>= 0.3.2'
gem 'puppet-lint', '< 1.1.0'
gem 'facter', '>= 1.7.0'
gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git'
gem 'puppet-syntax'
end

group :kitchen do
gem 'test-kitchen'
#gem 'kitchen-vagrant'
gem 'kitchen-docker'
gem 'kitchen-puppet', :git => 'https://github.com/neillturner/kitchen-puppet.git'
#gem 'vagrant-wrapper'
gem 'kitchen-vagrant'
gem 'vagrant-wrapper'
end
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# go

[![Build Status](https://secure.travis-ci.org/unibet/puppet-go.png)](http://travis-ci.org/unibet/puppet-go)

#### Table of Contents

1. [Overview](#overview)
Expand Down
46 changes: 19 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,44 +1,36 @@
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet_blacksmith/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'bundler'
require 'rake/clean'

Bundler.require(:rake)
Rake::Task[:lint].clear
PuppetLint::RakeTask.new :lint do |config|
config.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp", "test/**/*.pp"]
config.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}'
config.disable_checks = ["class_inherits_from_params_class", "80chars", "autoloader_layout"]
end
exclude_paths = [
"pkg/**/*",
"vendor/**/*",
"spec/**/*",
"test/**/*"
]

CLEAN.include('spec/fixtures/')
CLOBBER.include('.tmp', '.librarian')
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.send("disable_autoloader_layout")
PuppetLint.configuration.send("disable_quoted_booleans")
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths

task :librarian_spec_prep do
sh "librarian-puppet install --path spec/fixtures/modules"
end

task :spec_prep => :librarian_spec_prep
task :default => [:spec, :lint]
task :validate => :syntax

task :default => [:spec]

desc "Validate manifests, templates, and ruby files"
task :validate do
Dir['manifests/**/*.pp'].each do |manifest|
sh "puppet parser validate --noop #{manifest}"
end
Dir['spec/**/*.rb','lib/**/*.rb','test/**/*.rb'].each do |ruby_file|
sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/
end
Dir['templates/**/*.erb'].each do |template|
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end

begin
require 'kitchen/rake_tasks'
Kitchen::RakeTasks.new
rescue LoadError
puts ">>>>> Kitchen gem not loaded, omitting tasks" unless ENV['CI']
desc "Run integration tests"
task :integration do
sh "kitchen test all --destroy=always"
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
:operatingsystem => 'RedHat'
}
end

at_exit { RSpec::Puppet::Coverage.report! }

0 comments on commit 839de60

Please sign in to comment.