From 6fc35345eae76ad6479e707f50bc4568a1c897fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Mon, 6 Oct 2014 17:46:33 +0200 Subject: [PATCH 1/9] Added autoinclude of archive::prerequisites and rspec tests --- .gitignore | 2 ++ .travis.yml | 9 ++++++- Modulefile | 4 +-- Rakefile | 33 ++++++++++++++++++++++--- manifests/init.pp | 9 ++++++- spec/classes/archive_spec.rb | 3 --- spec/defines/archive_spec.rb | 31 +++++++++++++++++++++++ spec/fixtures/manifests/site.pp | 0 spec/fixtures/modules/archive/manifests | 1 + spec/spec.opts | 1 + spec/spec_helper.rb | 9 +++++-- tests/init.pp | 15 +++++++++++ 12 files changed, 104 insertions(+), 13 deletions(-) delete mode 100644 spec/classes/archive_spec.rb create mode 100644 spec/defines/archive_spec.rb create mode 100644 spec/fixtures/manifests/site.pp create mode 120000 spec/fixtures/modules/archive/manifests create mode 100644 spec/spec.opts create mode 100644 tests/init.pp diff --git a/.gitignore b/.gitignore index 008b417..72dd333 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /metadata.json /.project +/.gemfile.lock +/.bundle/config diff --git a/.travis.yml b/.travis.yml index 8fc3d34..c1a5925 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: ruby -script: "rake spec lint" +script: "rake rspec lint && puppet apply tests/init.pp --noop --modulepath spec/fixtures/modules/" rvm: + - 1.8.7 - 1.9.2 - 1.9.3 - 2.0.0 @@ -12,5 +13,11 @@ matrix: exclude: - rvm: 2.0.0 env: PUPPET_VERSION="~> 2.7.0" + exclude: + - rvm: 1.8.7 + env: PUPPET_VERSION="~> 3.2.0" + exclude: + - rvm: 1.8.7 + env: PUPPET_VERSION="~> 3.4.0" gemfile: .gemfile diff --git a/Modulefile b/Modulefile index ea4c0b0..ea78e11 100644 --- a/Modulefile +++ b/Modulefile @@ -1,5 +1,5 @@ -name 'gini-archive' -version '0.2.0' +name 'wavesoftware-archive' +version '0.2.1' author 'Jochen Schalanda' license 'Apache 2.0' project_page 'https://github.com/gini/puppet-archive' diff --git a/Rakefile b/Rakefile index 26fd890..bddc648 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,32 @@ require 'rake' -require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet-lint/tasks/puppet-lint' +require 'rspec/core/rake_task' -PuppetLint.configuration.send("disable_80chars") +desc "Run all RSpec code examples" +RSpec::Core::RakeTask.new(:rspec) do |t| + t.rspec_opts = File.read("spec/spec.opts").chomp || "" +end + +SPEC_SUITES = (Dir.entries('spec') - ['.', '..','fixtures']).select {|e| File.directory? "spec/#{e}" } +namespace :rspec do + SPEC_SUITES.each do |suite| + desc "Run #{suite} RSpec code examples" + RSpec::Core::RakeTask.new(suite) do |t| + t.pattern = "spec/#{suite}/**/*_spec.rb" + t.rspec_opts = File.read("spec/spec.opts").chomp || "" + end + end +end +task :smoke do + sh 'puppet apply tests/init.pp --noop --modulepath spec/fixtures/modules' +end +task :default => [ :rspec, :smoke ] + +begin + if Gem::Specification::find_by_name('puppet-lint') + require 'puppet-lint/tasks/puppet-lint' + PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"] + task :default => [:rspec, :lint, :smoke ] + end +rescue Gem::LoadError +end -task :default => [:spec, :lint] diff --git a/manifests/init.pp b/manifests/init.pp index 948011b..b6e8229 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -58,6 +58,10 @@ $proxy = undef, $dependency_class = Class['archive::prerequisites'], $exec_path = ['/usr/local/bin', '/usr/bin', '/bin']) { + + if $dependency_class == Class['archive::prerequisites'] { + include archive::prerequisites + } archive::download {"${name}.${extension}": ensure => $ensure, @@ -86,6 +90,9 @@ timeout => $timeout, strip_components => $strip_components, exec_path => $exec_path, - require => Archive::Download["${name}.${extension}"] + require => [ + Archive::Download["${name}.${extension}"], + $dependency_class + ], } } diff --git a/spec/classes/archive_spec.rb b/spec/classes/archive_spec.rb deleted file mode 100644 index 6094ab7..0000000 --- a/spec/classes/archive_spec.rb +++ /dev/null @@ -1,3 +0,0 @@ -require 'spec_helper' - -# No specs yet. See http://rspec-puppet.com/ diff --git a/spec/defines/archive_spec.rb b/spec/defines/archive_spec.rb new file mode 100644 index 0000000..8b930f8 --- /dev/null +++ b/spec/defines/archive_spec.rb @@ -0,0 +1,31 @@ +require 'spec_helper' +require 'rspec-puppet' + +describe 'archive', :type => :define do + let(:title) { 'apache-tomcat-8.0.11' } + let(:params) { { + :ensure => 'present', + :url => 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.11/bin/apache-tomcat-8.0.11.zip', + :extension => 'zip', + :username => 'example', + :password => 'example', + :target => '/opt', + } } + it { should compile } + it { should compile.with_all_deps } + it { should contain_class('archive::prerequisites') } + it { should contain_archive__download('apache-tomcat-8.0.11.zip') } + it { should contain_archive__extract('apache-tomcat-8.0.11') } + it { should contain_exec('download digest of archive apache-tomcat-8.0.11.zip') } + it { + should contain_exec('download archive apache-tomcat-8.0.11.zip and check sum').with_command( + 'curl --user example:example -s -L -o /usr/src/apache-tomcat-8.0.11.zip ' + + 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.11/bin/apache-tomcat-8.0.11.zip' + ) + } + it { + should contain_exec('Unpack apache-tomcat-8.0.11').with_command( + 'mkdir -p /opt/apache-tomcat-8.0.11 && unzip -o /usr/src/apache-tomcat-8.0.11.zip -d /opt/apache-tomcat-8.0.11' + ) + } +end \ No newline at end of file diff --git a/spec/fixtures/manifests/site.pp b/spec/fixtures/manifests/site.pp new file mode 100644 index 0000000..e69de29 diff --git a/spec/fixtures/modules/archive/manifests b/spec/fixtures/modules/archive/manifests new file mode 120000 index 0000000..373b992 --- /dev/null +++ b/spec/fixtures/modules/archive/manifests @@ -0,0 +1 @@ +../../../../manifests \ No newline at end of file diff --git a/spec/spec.opts b/spec/spec.opts new file mode 100644 index 0000000..5052887 --- /dev/null +++ b/spec/spec.opts @@ -0,0 +1 @@ +--color \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index dc7e9f4..7a10d4f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,2 +1,7 @@ -require 'rubygems' -require 'puppetlabs_spec_helper/module_spec_helper' +require 'rspec-puppet' + +fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) +RSpec.configure do |c| + c.module_path = File.join(fixture_path, 'modules') + c.manifest_dir = File.join(fixture_path, 'manifests') +end diff --git a/tests/init.pp b/tests/init.pp new file mode 100644 index 0000000..70df92e --- /dev/null +++ b/tests/init.pp @@ -0,0 +1,15 @@ +archive { 'apache-tomcat-6.0.26': + ensure => present, + url => 'http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz', + target => '/opt', +} + +archive { 'apache-tomcat-8.0.11': + ensure => present, + url => 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.11/bin/apache-tomcat-8.0.11.zip', + extension => 'zip', + username => 'example', + password => 'example', + target => '/opt', +} + From c9d3b13ba02bc9c5ee1773b4c5bdaaabc1d0d911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Mon, 6 Oct 2014 17:50:16 +0200 Subject: [PATCH 2/9] Readme fix --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 60811ff..2d1aefc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Puppet Archive Module ===================== -[![Build Status](https://secure.travis-ci.org/gini/puppet-archive.png)](http://travis-ci.org/gini/puppet-archive) +[![Build Status](https://secure.travis-ci.org/wavesoftware/puppet-archive.png)](http://travis-ci.org/wavesoftware/puppet-archive) Overview -------- @@ -34,6 +34,9 @@ Supported Platforms The module has been tested on the following operating systems. Testing and patches for other platforms are welcome. * Debian Linux 7.0 (Wheezy) +* Ubuntu 13.04 +* RHEL 6.5 +* Oracle Linux 6.5 Support @@ -61,3 +64,4 @@ Contributors * Zijad Purkovic (zajk) * Martin Konrad (mark0n) * Brendan Murtagh (bmurt) +* Krzysztof SuszyƄski (cardil) From 700e1b15812918452fd830fe8afaa8a4d166dce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Mon, 6 Oct 2014 17:52:22 +0200 Subject: [PATCH 3/9] Readme fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2d1aefc..89798f3 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ The module has been tested on the following operating systems. Testing and patch * Debian Linux 7.0 (Wheezy) * Ubuntu 13.04 -* RHEL 6.5 -* Oracle Linux 6.5 +* RHEL 6.x +* Oracle Linux 6.x Support From c1272976c834ad90b1056676ecf3ab31b0d8d238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Mon, 6 Oct 2014 18:24:46 +0200 Subject: [PATCH 4/9] Corrected Travis CI exclude Matrix, and addrd new Puppet 3.7 and ruby 2.1 --- .gitignore | 1 + .travis.yml | 11 +++-- Rakefile | 4 +- spec/defines/archive_spec.rb | 82 ++++++++++++++++++++++++------------ 4 files changed, 65 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 72dd333..95924f0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /.project /.gemfile.lock /.bundle/config +/pkg/* diff --git a/.travis.yml b/.travis.yml index c1a5925..f3158b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,26 @@ language: ruby -script: "rake rspec lint && puppet apply tests/init.pp --noop --modulepath spec/fixtures/modules/" +script: "rake rspec smoke lint" rvm: - 1.8.7 - - 1.9.2 - 1.9.3 - 2.0.0 + - 2.1.0 env: - PUPPET_VERSION="~> 2.7.0" - PUPPET_VERSION="~> 3.2.0" - PUPPET_VERSION="~> 3.4.0" + - PUPPET_VERSION="~> 3.7.0" matrix: exclude: - rvm: 2.0.0 env: PUPPET_VERSION="~> 2.7.0" - exclude: + - rvm: 2.1.0 + env: PUPPET_VERSION="~> 2.7.0" - rvm: 1.8.7 env: PUPPET_VERSION="~> 3.2.0" - exclude: - rvm: 1.8.7 env: PUPPET_VERSION="~> 3.4.0" + - rvm: 1.8.7 + env: PUPPET_VERSION="~> 3.7.0" gemfile: .gemfile diff --git a/Rakefile b/Rakefile index bddc648..c32daf6 100644 --- a/Rakefile +++ b/Rakefile @@ -24,8 +24,8 @@ task :default => [ :rspec, :smoke ] begin if Gem::Specification::find_by_name('puppet-lint') require 'puppet-lint/tasks/puppet-lint' - PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"] - task :default => [:rspec, :lint, :smoke ] + PuppetLint.configuration.ignore_paths = [ "spec/**/*.pp", "vendor/**/*.pp", "pkg/*" ] + task :default => [:rspec, :smoke, :lint ] end rescue Gem::LoadError end diff --git a/spec/defines/archive_spec.rb b/spec/defines/archive_spec.rb index 8b930f8..ab9abb0 100644 --- a/spec/defines/archive_spec.rb +++ b/spec/defines/archive_spec.rb @@ -2,30 +2,58 @@ require 'rspec-puppet' describe 'archive', :type => :define do - let(:title) { 'apache-tomcat-8.0.11' } - let(:params) { { - :ensure => 'present', - :url => 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.11/bin/apache-tomcat-8.0.11.zip', - :extension => 'zip', - :username => 'example', - :password => 'example', - :target => '/opt', - } } - it { should compile } - it { should compile.with_all_deps } - it { should contain_class('archive::prerequisites') } - it { should contain_archive__download('apache-tomcat-8.0.11.zip') } - it { should contain_archive__extract('apache-tomcat-8.0.11') } - it { should contain_exec('download digest of archive apache-tomcat-8.0.11.zip') } - it { - should contain_exec('download archive apache-tomcat-8.0.11.zip and check sum').with_command( - 'curl --user example:example -s -L -o /usr/src/apache-tomcat-8.0.11.zip ' + - 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.11/bin/apache-tomcat-8.0.11.zip' - ) - } - it { - should contain_exec('Unpack apache-tomcat-8.0.11').with_command( - 'mkdir -p /opt/apache-tomcat-8.0.11 && unzip -o /usr/src/apache-tomcat-8.0.11.zip -d /opt/apache-tomcat-8.0.11' - ) - } -end \ No newline at end of file + context 'with filetype => zip' do + let(:title) { 'apache-tomcat-8.0.11' } + let(:params) { { + :ensure => 'present', + :url => 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.11/bin/apache-tomcat-8.0.11.zip', + :extension => 'zip', + :username => 'example', + :password => 'example', + :target => '/opt', + } } + it { should compile } + it { should compile.with_all_deps } + it { should contain_class('archive::prerequisites') } + it { should contain_archive__download('apache-tomcat-8.0.11.zip') } + it { should contain_archive__extract('apache-tomcat-8.0.11') } + it { should contain_exec('download digest of archive apache-tomcat-8.0.11.zip') } + it { + should contain_exec('download archive apache-tomcat-8.0.11.zip and check sum').with_command( + 'curl --user example:example -s -L -o /usr/src/apache-tomcat-8.0.11.zip ' + + 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.11/bin/apache-tomcat-8.0.11.zip' + ) + } + it { + should contain_exec('Unpack apache-tomcat-8.0.11').with_command( + 'mkdir -p /opt/apache-tomcat-8.0.11 && unzip -o /usr/src/apache-tomcat-8.0.11.zip -d /opt/apache-tomcat-8.0.11' + ) + } + end + context 'with filetype => tarball' do + let(:title) { 'apache-tomcat-8.0.11' } + let(:params) { { + :ensure => 'present', + :url => 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.11/bin/apache-tomcat-8.0.11.tar.gz', + :target => '/usr/src', + } } + it { should compile } + it { should compile.with_all_deps } + it { should contain_class('archive::prerequisites') } + it { should contain_archive__download('apache-tomcat-8.0.11.tar.gz') } + it { should contain_archive__extract('apache-tomcat-8.0.11') } + it { should contain_exec('download digest of archive apache-tomcat-8.0.11.tar.gz') } + it { + should contain_exec('download archive apache-tomcat-8.0.11.tar.gz and check sum').with_command( + 'curl -s -L -o /usr/src/apache-tomcat-8.0.11.tar.gz ' + + 'http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.11/bin/apache-tomcat-8.0.11.tar.gz' + ) + } + it { + should contain_exec('Unpack apache-tomcat-8.0.11').with_command( + 'mkdir -p /usr/src/apache-tomcat-8.0.11 && tar --no-same-owner --no-same-permissions ' + + '--strip-components=0 -xzf /usr/src/apache-tomcat-8.0.11.tar.gz -C /usr/src/apache-tomcat-8.0.11' + ) + } + end +end From fde4bb7a789ae9be1c11c54c73a143cdeffc1ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Thu, 9 Oct 2014 10:26:09 +0200 Subject: [PATCH 5/9] Updated structure for spec test base on puppetlabs/concat module --- .fixtures.yml | 1 + .gemfile | 10 ------- .gitignore | 1 + .puppet-lint.rc | 1 - .travis.yml | 37 ++++++++++-------------- Gemfile | 27 ++++++++++++++++++ Rakefile | 38 +++++++------------------ manifests/init.pp | 2 +- spec/fixtures/manifests/site.pp | 0 spec/fixtures/modules/archive/manifests | 1 - spec/spec.opts | 7 ++++- spec/spec_helper.rb | 8 +----- spec/{ => unit}/defines/archive_spec.rb | 0 13 files changed, 62 insertions(+), 71 deletions(-) delete mode 100644 .gemfile delete mode 100644 .puppet-lint.rc create mode 100644 Gemfile delete mode 100644 spec/fixtures/manifests/site.pp delete mode 120000 spec/fixtures/modules/archive/manifests rename spec/{ => unit}/defines/archive_spec.rb (100%) diff --git a/.fixtures.yml b/.fixtures.yml index 715cad4..7632658 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,3 +1,4 @@ +--- fixtures: symlinks: archive: "#{source_dir}" diff --git a/.gemfile b/.gemfile deleted file mode 100644 index c9713f0..0000000 --- a/.gemfile +++ /dev/null @@ -1,10 +0,0 @@ -source 'https://rubygems.org' -puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : ['~> 3.2.0'] - -gem 'puppet', puppetversion - -group :test do - gem 'rake', '>= 0.9.0' - gem 'puppetlabs_spec_helper', '>= 0.4.1' - gem 'puppet-lint' -end diff --git a/.gitignore b/.gitignore index 95924f0..4749e1e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /.gemfile.lock /.bundle/config /pkg/* +/Gemfile.lock diff --git a/.puppet-lint.rc b/.puppet-lint.rc deleted file mode 100644 index fac18a5..0000000 --- a/.puppet-lint.rc +++ /dev/null @@ -1 +0,0 @@ ---no-80chars diff --git a/.travis.yml b/.travis.yml index f3158b5..69dac9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,19 @@ +--- language: ruby -script: "rake rspec smoke lint" -rvm: - - 1.8.7 - - 1.9.3 - - 2.0.0 - - 2.1.0 -env: - - PUPPET_VERSION="~> 2.7.0" - - PUPPET_VERSION="~> 3.2.0" - - PUPPET_VERSION="~> 3.4.0" - - PUPPET_VERSION="~> 3.7.0" +bundler_args: --without development +script: "bundle exec rake validate lint spec SPEC_OPTS='--format documentation'" matrix: - exclude: - - rvm: 2.0.0 - env: PUPPET_VERSION="~> 2.7.0" - - rvm: 2.1.0 - env: PUPPET_VERSION="~> 2.7.0" - - rvm: 1.8.7 - env: PUPPET_VERSION="~> 3.2.0" - - rvm: 1.8.7 - env: PUPPET_VERSION="~> 3.4.0" - - rvm: 1.8.7 - env: PUPPET_VERSION="~> 3.7.0" + fast_finish: true + include: + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 2.7" + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3.0" + - rvm: 2.0.0 + env: PUPPET_GEM_VERSION="~> 3.0" + - rvm: 2.1.0 + env: PUPPET_GEM_VERSION="~> 3.7" +notifications: + email: false gemfile: .gemfile diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..081b1a2 --- /dev/null +++ b/Gemfile @@ -0,0 +1,27 @@ +source ENV['GEM_SOURCE'] || "https://rubygems.org" + +group :development, :test do + gem 'rake', :require => false + gem 'rspec-puppet', :require => false + gem 'puppetlabs_spec_helper', :require => false + gem 'serverspec', :require => false + gem 'puppet-lint', '0.3.2', :require => false + gem 'beaker', :require => false + gem 'beaker-rspec', :require => false + gem 'pry', :require => false + gem 'simplecov', :require => false +end + +if facterversion = ENV['FACTER_GEM_VERSION'] + gem 'facter', facterversion, :require => false +else + gem 'facter', :require => false +end + +if puppetversion = ENV['PUPPET_GEM_VERSION'] + gem 'puppet', puppetversion, :require => false +else + gem 'puppet', :require => false +end + +# vim:ft=ruby diff --git a/Rakefile b/Rakefile index c32daf6..08e62d5 100644 --- a/Rakefile +++ b/Rakefile @@ -1,32 +1,14 @@ -require 'rake' -require 'rspec/core/rake_task' +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' -desc "Run all RSpec code examples" -RSpec::Core::RakeTask.new(:rspec) do |t| - t.rspec_opts = File.read("spec/spec.opts").chomp || "" -end +PuppetLint.configuration.fail_on_warnings +PuppetLint.configuration.send('disable_80chars') +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"] -SPEC_SUITES = (Dir.entries('spec') - ['.', '..','fixtures']).select {|e| File.directory? "spec/#{e}" } -namespace :rspec do - SPEC_SUITES.each do |suite| - desc "Run #{suite} RSpec code examples" - RSpec::Core::RakeTask.new(suite) do |t| - t.pattern = "spec/#{suite}/**/*_spec.rb" - t.rspec_opts = File.read("spec/spec.opts").chomp || "" - end - end -end task :smoke do - sh 'puppet apply tests/init.pp --noop --modulepath spec/fixtures/modules' + sh 'puppet apply tests/init.pp --noop --modulepath ../' end -task :default => [ :rspec, :smoke ] - -begin - if Gem::Specification::find_by_name('puppet-lint') - require 'puppet-lint/tasks/puppet-lint' - PuppetLint.configuration.ignore_paths = [ "spec/**/*.pp", "vendor/**/*.pp", "pkg/*" ] - task :default => [:rspec, :smoke, :lint ] - end -rescue Gem::LoadError -end - diff --git a/manifests/init.pp b/manifests/init.pp index b6e8229..98775dd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -58,7 +58,7 @@ $proxy = undef, $dependency_class = Class['archive::prerequisites'], $exec_path = ['/usr/local/bin', '/usr/bin', '/bin']) { - + if $dependency_class == Class['archive::prerequisites'] { include archive::prerequisites } diff --git a/spec/fixtures/manifests/site.pp b/spec/fixtures/manifests/site.pp deleted file mode 100644 index e69de29..0000000 diff --git a/spec/fixtures/modules/archive/manifests b/spec/fixtures/modules/archive/manifests deleted file mode 120000 index 373b992..0000000 --- a/spec/fixtures/modules/archive/manifests +++ /dev/null @@ -1 +0,0 @@ -../../../../manifests \ No newline at end of file diff --git a/spec/spec.opts b/spec/spec.opts index 5052887..91cd642 100644 --- a/spec/spec.opts +++ b/spec/spec.opts @@ -1 +1,6 @@ ---color \ No newline at end of file +--format +s +--colour +--loadby +mtime +--backtrace diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7a10d4f..2c6f566 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1 @@ -require 'rspec-puppet' - -fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) -RSpec.configure do |c| - c.module_path = File.join(fixture_path, 'modules') - c.manifest_dir = File.join(fixture_path, 'manifests') -end +require 'puppetlabs_spec_helper/module_spec_helper' diff --git a/spec/defines/archive_spec.rb b/spec/unit/defines/archive_spec.rb similarity index 100% rename from spec/defines/archive_spec.rb rename to spec/unit/defines/archive_spec.rb From 5275f875e14bd43ae64799649b3f18051066eb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Thu, 9 Oct 2014 10:29:36 +0200 Subject: [PATCH 6/9] Fix for Gemfile --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 69dac9e..5c66256 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,5 +15,4 @@ matrix: env: PUPPET_GEM_VERSION="~> 3.7" notifications: email: false -gemfile: .gemfile From 0cd56e37e72374d95df527213d49a3bf1dfde8d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Thu, 9 Oct 2014 10:35:57 +0200 Subject: [PATCH 7/9] Testing with Puppet smke tests... --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5c66256..dbe8ebe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ --- language: ruby bundler_args: --without development -script: "bundle exec rake validate lint spec SPEC_OPTS='--format documentation'" +script: "bundle exec rake validate lint spec smoke SPEC_OPTS='--format documentation'" matrix: fast_finish: true include: From 9f3a5691447b1e35c98cb88c9a56eedfb27225cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Thu, 9 Oct 2014 10:58:45 +0200 Subject: [PATCH 8/9] Fix for running smoke tests --- .travis.yml | 2 +- Rakefile | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index dbe8ebe..610b309 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ --- language: ruby bundler_args: --without development -script: "bundle exec rake validate lint spec smoke SPEC_OPTS='--format documentation'" +script: "bundle exec rake validate lint spec SPEC_OPTS='--format documentation' && bundle exec rake smoke" matrix: fast_finish: true include: diff --git a/Rakefile b/Rakefile index 08e62d5..5c397d7 100644 --- a/Rakefile +++ b/Rakefile @@ -10,5 +10,7 @@ PuppetLint.configuration.send('disable_single_quote_string_with_variables') PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] task :smoke do - sh 'puppet apply tests/init.pp --noop --modulepath ../' + Rake::Task[:spec_prep].invoke + sh "puppet apply tests/init.pp --noop --modulepath spec/fixtures/modules" + Rake::Task[:spec_clean].invoke end From ab7404fed03d8d91e92d5ed7ccb23cba96b2e649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Suszy=C5=84ski?= Date: Thu, 9 Oct 2014 11:21:13 +0200 Subject: [PATCH 9/9] Prepare for backport to gini/archive --- Modulefile | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modulefile b/Modulefile index ea78e11..17beeee 100644 --- a/Modulefile +++ b/Modulefile @@ -1,5 +1,5 @@ -name 'wavesoftware-archive' -version '0.2.1' +name 'gini-archive' +version '0.2.2' author 'Jochen Schalanda' license 'Apache 2.0' project_page 'https://github.com/gini/puppet-archive' diff --git a/README.md b/README.md index 89798f3..4e740b3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Puppet Archive Module ===================== -[![Build Status](https://secure.travis-ci.org/wavesoftware/puppet-archive.png)](http://travis-ci.org/wavesoftware/puppet-archive) +[![Build Status](https://secure.travis-ci.org/gini/puppet-archive.png)](http://travis-ci.org/gini/puppet-archive) Overview --------