diff --git a/.travis.yml b/.travis.yml index ef9dcf18..eab11e1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,90 +11,33 @@ before_install: - gem --version - bundle -v -rvm: - - 1.8.7 - - 1.9.3 - - 2.0.0 - - 2.1.0 - - 2.3.1 - -env: - matrix: - - PUPPET_GEM_VERSION="~> 3.1.0" - - PUPPET_GEM_VERSION="~> 3.2.0" - - PUPPET_GEM_VERSION="~> 3.3.0" - - PUPPET_GEM_VERSION="~> 3.4.0" - - PUPPET_GEM_VERSION="~> 3.5.0" - - PUPPET_GEM_VERSION="~> 3.6.0" - - PUPPET_GEM_VERSION="~> 3.7.0" - - PUPPET_GEM_VERSION="~> 3.8.0" - - PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" - - PUPPET_GEM_VERSION="~> 4.0.0" - - PUPPET_GEM_VERSION="~> 4.1.0" - - PUPPET_GEM_VERSION="~> 4.2.0" - - PUPPET_GEM_VERSION="~> 4.3.0" - - PUPPET_GEM_VERSION="~> 4.4.0" - - PUPPET_GEM_VERSION="~> 4.5.0" - - PUPPET_GEM_VERSION="~> 4.6.0" - - PUPPET_GEM_VERSION="~> 4.7.0" - - PUPPET_GEM_VERSION="~> 4.8.0" - - PUPPET_GEM_VERSION="~> 4" - sudo: false script: 'SPEC_OPTS="--format documentation" bundle exec rake validate lint spec' matrix: fast_finish: true - exclude: - - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 3.1.0" - - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.1.0" - - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.2.0" - - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.3.0" - - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.4.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.0.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.1.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.2.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.3.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.4.0" - - rvm: 1.8.7 - env: PUPPET_GEM_VERSION="~> 4.5.0" + include: - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 2.0.0 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" + - rvm: 2.1.9 env: PUPPET_GEM_VERSION="~> 4.6.0" - - rvm: 1.8.7 + - rvm: 2.1.9 env: PUPPET_GEM_VERSION="~> 4.7.0" - - rvm: 1.8.7 + - rvm: 2.1.9 env: PUPPET_GEM_VERSION="~> 4.8.0" - - rvm: 1.8.7 + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 4.9.0" + - rvm: 2.1.9 + env: PUPPET_GEM_VERSION="~> 4.10.0" + - rvm: 2.1.9 env: PUPPET_GEM_VERSION="~> 4" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.1.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.2.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.3.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.4.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.5.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.6.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.7.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3.8.0" - - rvm: 2.3.1 - env: PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes" notifications: email: false diff --git a/Gemfile b/Gemfile index 898be012..c417fd3d 100644 --- a/Gemfile +++ b/Gemfile @@ -18,8 +18,7 @@ else gem 'facter', :require => false end -gem 'puppetlabs_spec_helper', '>= 1.2.0', :require => false -gem 'rspec-puppet', :require => false +gem 'rspec-puppet', '~> 2.0', :require => false gem 'puppet-lint', '~> 2.0', :require => false gem 'simplecov', :require => false @@ -27,7 +26,12 @@ gem 'rspec', '~> 2.0', :require => false if RUBY_VERSION >= '1.8.7' gem 'rake', '~> 10.0', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' gem 'json', '<= 1.8', :require => false if RUBY_VERSION < '2.0.0' gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION < '2.0.0' -gem 'metadata-json-lint', '0.0.11', :require => false if RUBY_VERSION < '1.9' -gem 'metadata-json-lint', :require => false if RUBY_VERSION >= '1.9' +gem 'metadata-json-lint', '0.0.11' if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' +gem 'metadata-json-lint', '1.0.0' if RUBY_VERSION >= '1.9' && RUBY_VERSION < '2.0' +gem 'metadata-json-lint' if RUBY_VERSION >= '2.0' + +gem 'puppetlabs_spec_helper', '2.0.2', :require => false if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' +gem 'puppetlabs_spec_helper', '>= 2.0.0', :require => false if RUBY_VERSION >= '1.9' +gem 'parallel_tests', '<= 2.9.0', :require => false if RUBY_VERSION < '2.0.0' # vim:ft=ruby diff --git a/README.md b/README.md index 36ecec4e..802e79f4 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,17 @@ Puppet module for installing and managing python, pip, virtualenvs and Gunicorn # Compatibility # -* Puppet v3 (with and without the future parser) +See `.travis.yml` for compatibility matrix. + +* Puppet v3 (with the future parser) * Puppet v4 ## Ruby versions -* 1.8.7 -* 1.9.3 -* 2.0.0 -* 2.1.0 -* 2.3.1 +* 1.8.7 - Puppet 3 +* 1.9.3 - Puppet 3 +* 2.0.0 - Puppet 3 +* 2.1.9 - Puppet 3 & 4 ## OS Distributions ## diff --git a/Rakefile b/Rakefile index 28d00a1e..abf2783b 100644 --- a/Rakefile +++ b/Rakefile @@ -17,7 +17,6 @@ PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_class_parameter_defaults') PuppetLint.configuration.send('disable_documentation') PuppetLint.configuration.send('disable_single_quote_string_with_variables') -PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] exclude_paths = [ "pkg/**/*", @@ -27,6 +26,13 @@ exclude_paths = [ PuppetLint.configuration.ignore_paths = exclude_paths PuppetSyntax.exclude_paths = exclude_paths +desc 'Validate manifests, templates, ruby files and shell scripts' +task :validate do + Dir['spec/**/*.rb'].each do |ruby_file| + sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/ + end +end + desc "Run acceptance tests" RSpec::Core::RakeTask.new(:acceptance) do |t| t.pattern = 'spec/acceptance' diff --git a/manifests/init.pp b/manifests/init.pp index 8b3caf30..a4e22236 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -133,10 +133,10 @@ } # Anchor pattern to contain dependencies - anchor { 'python::begin': } -> - class { 'python::install': } -> - class { 'python::config': } -> - anchor { 'python::end': } + anchor { 'python::begin': } + -> class { 'python::install': } + -> class { 'python::config': } + -> anchor { 'python::end': } # Allow hiera configuration of python resources create_resources('python::pip', $python_pips) diff --git a/manifests/install.pp b/manifests/install.pp index afe17dac..72da81de 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -164,12 +164,12 @@ } if $::python::rhscl_use_public_repository { - Package <| tag == 'python-scl-repo' |> -> - Package <| tag == 'python-scl-package' |> + Package <| tag == 'python-scl-repo' |> + -> Package <| tag == 'python-scl-package' |> } - Package <| tag == 'python-scl-package' |> -> - Package <| tag == 'python-pip-package' |> + Package <| tag == 'python-scl-package' |> + -> Package <| tag == 'python-pip-package' |> } default: { diff --git a/spec/defines/pip_spec.rb b/spec/defines/pip_spec.rb index e03fd7f1..56216c59 100644 --- a/spec/defines/pip_spec.rb +++ b/spec/defines/pip_spec.rb @@ -34,11 +34,11 @@ describe "proxy as" do context "defaults to empty" do let (:params) {{ }} - it { is_expected.to contain_exec("pip_install_rpyc").without_command(/--proxy/) } + it { should_not contain_exec("pip_install_rpyc").with_command(/--proxy/) } end context "does not add proxy to search command if set to latest and proxy is unset" do let (:params) {{ :ensure => 'latest' }} - it { is_expected.to contain_exec("pip_install_rpyc").without_command(/--proxy/) } + it { should_not contain_exec("pip_install_rpyc").with_command(/--proxy/) } it { is_expected.to contain_exec("pip_install_rpyc").without_unless(/--proxy/) } end context "adds proxy to install command if proxy set" do @@ -55,7 +55,7 @@ describe 'index as' do context 'defaults to empty' do let (:params) {{ }} - it { is_expected.to contain_exec('pip_install_rpyc').without_command(/--index-url/) } + it { should_not contain_exec('pip_install_rpyc').with_command(/--index-url/) } end context 'adds index to install command if index set' do let (:params) {{ :index => 'http://www.example.com/simple/' }}