From d6294e89b28d2eb412e3cafb40f07a895f6dc65d Mon Sep 17 00:00:00 2001 From: Daniel Werdermann Date: Fri, 12 Dec 2014 16:14:55 +0100 Subject: [PATCH] order and fix tests for travis-ci --- .fixtures.yml | 8 ++++++-- .gitmodules | 6 ------ .travis.yml | 29 ++++++++++++++++------------- Gemfile | 15 ++++----------- Modulefile | 12 ------------ Rakefile | 25 +++++++++++++++++++++++-- metadata.json | 14 ++++++++++++++ 7 files changed, 63 insertions(+), 46 deletions(-) delete mode 100644 .gitmodules delete mode 100644 Modulefile create mode 100644 metadata.json diff --git a/.fixtures.yml b/.fixtures.yml index ad6f685..85a49b8 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,6 +1,10 @@ fixtures: repositories: - "stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git" - "concat": "git://github.com/puppetlabs/puppetlabs-concat.git" + stdlib: + repo: "git://github.com/puppetlabs/puppetlabs-stdlib.git" + ref: "3.2.0" + logrotate: + repo: "git://github.com/puppetlabs/puppetlabs-concat.git" + ref: "1.0.0" symlinks: "nfs": "#{source_dir}" diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ed51201..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "spec/fixtures/modules/concat"] - path = spec/fixtures/modules/concat - url = git://github.com/ripienaar/puppet-concat.git -[submodule "spec/fixtures/modules/stdlib"] - path = spec/fixtures/modules/stdlib - url = https://github.com/puppetlabs/puppetlabs-stdlib diff --git a/.travis.yml b/.travis.yml index 3e7bfa2..f531306 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,17 @@ +--- language: ruby -rvm: - - 1.8.7 - - 1.9.2 - - 1.9.3 - - ree -before_install: - - git submodule update --init --recursive -script: "rake spec" -env: - - PUPPET_VERSION=2.7.20 - - PUPPET_VERSION=3.0.2 - - PUPPET_VERSION=3.1.0 - - PUPPET_VERSION=3.4.3 +bundler_args: --without system_tests +script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--color --format documentation'" +matrix: + fast_finish: true + include: + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0" + - rvm: 1.8.7 + env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0" + - rvm: 1.9.3 + env: PUPPET_GEM_VERSION="~> 3.0" + - rvm: 2.0.0 + env: PUPPET_GEM_VERSION="~> 3.0" +notifications: + email: false diff --git a/Gemfile b/Gemfile index 9c1f664..d0d980d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,14 +1,7 @@ source 'https://rubygems.org' - -if ENV.key?('PUPPET_VERSION') - puppetversion = "= #{ENV['PUPPET_VERSION']}" -else - puppetversion = ['>= 2.7'] -end - -gem 'rake' -gem 'puppet-lint' -gem 'rspec-puppet' +puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3'] gem 'puppet', puppetversion -gem 'puppetlabs_spec_helper' +gem 'puppetlabs_spec_helper', '>= 0.1.0' +gem 'puppet-lint', '>= 0.3.2' +gem 'facter', '>= 1.7.0' \ No newline at end of file diff --git a/Modulefile b/Modulefile deleted file mode 100644 index 08522d3..0000000 --- a/Modulefile +++ /dev/null @@ -1,12 +0,0 @@ -name 'haraldsk-nfs' -version '1.1.1' -source 'git@github.com:haraldsk/puppet-module-nfs.git' -author 'haraldsk@redpill-linpro.com' -license 'Apache License, Version 2.0' -summary 'nfs client and server module' -description 'nfs client and server module' -project_page 'https://github.com/haraldsk/puppet-module-nfs' - -dependency 'puppetlabs/concat', '>= 1.0.0' -dependency 'puppetlabs/stdlib', '>= 3.0.1' - diff --git a/Rakefile b/Rakefile index bfe494f..125cbfc 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,29 @@ +require 'rubygems' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' -PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", 'tests/**/*.pp'] +PuppetLint.configuration.fail_on_warnings +PuppetLint.configuration.send('relative') +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"] + +desc "Validate manifests, templates, and ruby files in lib." +task :validate do + Dir['manifests/**/*.pp'].each do |manifest| + sh "puppet parser validate --noop #{manifest}" + end + Dir['lib/**/*.rb'].each do |lib_file| + sh "ruby -c #{lib_file}" + end + Dir['templates/**/*.erb'].each do |template| + sh "erb -P -x -T '-' #{template} | ruby -c" + end +end task :test => [:spec, :lint] -task :default => :test +task :default => :test \ No newline at end of file diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..96155fd --- /dev/null +++ b/metadata.json @@ -0,0 +1,14 @@ +{ + "name": "echocat-nfs", + "version": "1.2.0", + "source": "git clone https://github.com/echocat/puppet-nfs.git", + "author": "echocat", + "license": "Apache 2.0", + "summary": "Installs and configures NFS server and clients", + "project_page": "https://github.com/echocat/puppet-nfs", + "issues_url": "https://github.com/echocat/puppet-nfs/issues", + "dependencies": [ + {"name":"puppetlabs-stdlib","version_requirement":">= 3.2.0"}, + {"name":"puppetlabs-concat","version_requirement":">= 1.0.0"} + ] +} \ No newline at end of file