From 1da09acc6c1d5f3950ee95670d8d43f43fda1834 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Thu, 7 Mar 2013 23:24:06 +0100 Subject: [PATCH] Enabling Travis integration --- .fixtures.yml | 10 ++++++++++ .gemfile | 6 ++++++ .travis.yml | 24 ++++++++++++++---------- Rakefile | 14 +++++--------- spec/spec_helper.rb | 28 +--------------------------- 5 files changed, 36 insertions(+), 46 deletions(-) create mode 100644 .fixtures.yml create mode 100644 .gemfile diff --git a/.fixtures.yml b/.fixtures.yml new file mode 100644 index 0000000..d3e80a6 --- /dev/null +++ b/.fixtures.yml @@ -0,0 +1,10 @@ +fixtures: + repositories: + "puppi": "git://github.com/example42/puppi.git" + "monitor": "git://github.com/example42/puppet-monitor.git" + "firewall": "git://github.com/example42/puppet-firewall.git" + "iptables": "git://github.com/example42/puppet-iptables.git" + "concat": "git://github.com/example42/puppet-concat.git" + symlinks: + "postgresql": "#{source_dir}" + diff --git a/.gemfile b/.gemfile new file mode 100644 index 0000000..459723a --- /dev/null +++ b/.gemfile @@ -0,0 +1,6 @@ +source :rubygems + +puppetversion = ENV['PUPPET_VERSION'] +gem 'puppet', puppetversion, :require => false +gem 'puppet-lint' +gem 'puppetlabs_spec_helper', '>= 0.1.0' diff --git a/.travis.yml b/.travis.yml index ad7b2b4..dffeca9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,21 @@ language: ruby rvm: - 1.8.7 -before_script: -after_script: -script: "rake spec" -branches: - only: - - master + - 1.9.3 +script: + - "rake spec SPEC_OPTS='--format documentation'" env: - - PUPPET_VERSION=2.7.13 - - PUPPET_VERSION=2.7.6 - - PUPPET_VERSION=2.6.9 + - PUPPET_VERSION="~> 2.6.0" + - PUPPET_VERSION="~> 2.7.0" + - PUPPET_VERSION="~> 3.0.0" + - PUPPET_VERSION="~> 3.1.0" +matrix: + exclude: + - rvm: 1.9.3 + env: PUPPET_VERSION="~> 2.6.0" + gemfile: .gemfile + +gemfile: .gemfile notifications: email: - al@lab42.it -gemfile: .gemfile diff --git a/Rakefile b/Rakefile index 1e48992..1a8a8a0 100644 --- a/Rakefile +++ b/Rakefile @@ -1,9 +1,5 @@ -require 'rake' -require 'rspec/core/rake_task' - -RSpec::Core::RakeTask.new(:test) do |t| - t.rspec_opts = ["--format", "doc", "--color"] - t.pattern = 'spec/*/*_spec.rb' -end - -task :default => :test +require 'rubygems' +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint' +PuppetLint.configuration.send("disable_80chars") +PuppetLint.configuration.send('disable_class_parameter_defaults') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index da220fe..2c6f566 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,27 +1 @@ -# Based on https://github.com/puppetlabs/puppetlabs-ntp/blob/master/spec/spec_helper.rb -# Thanks to Ken Barber for advice about http://projects.puppetlabs.com/issues/11191 -require 'puppet' -require 'rspec-puppet' -require 'tmpdir' - -RSpec.configure do |c| - c.before :each do - # Create a temporary puppet confdir area and temporary site.pp so - # when rspec-puppet runs we don't get a puppet error. - @puppetdir = Dir.mktmpdir("postgresql") - manifestdir = File.join(@puppetdir, "manifests") - Dir.mkdir(manifestdir) - FileUtils.touch(File.join(manifestdir, "site.pp")) - Puppet[:confdir] = @puppetdir - end - - c.filter_run_excluding :broken => true - - c.after :each do - if FileTest.exists?("#{@puppetdir}") - FileUtils.remove_entry_secure(@puppetdir) - end - end - - c.module_path = File.join(File.dirname(__FILE__), '../../') -end +require 'puppetlabs_spec_helper/module_spec_helper'