diff --git a/.gitignore b/.gitignore index c0b13279..ba691093 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,5 @@ pkg .vagrant spec/fixtures/* - spec/reports/* +coverage/* diff --git a/.travis.yml b/.travis.yml index 74a6582e..6d2e6d43 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,11 @@ before_install: script: - bundle exec rake syntax - bundle exec rake lint - - bundle exec rake ci:setup:rspec spec + - bundle exec rake spec notifications: email: - biemond@gmail.com env: - PUPPET_VERSION=3.3.2 - PUPPET_VERSION=3.4.3 - - PUPPET_VERSION=3.6.2 \ No newline at end of file + - PUPPET_VERSION=3.7.5 \ No newline at end of file diff --git a/Gemfile b/Gemfile index 7eb6fd64..835515eb 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.0'] +puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['= 3.7.5'] platform :ruby_19, :ruby_20 do gem 'coveralls', :require => false @@ -13,7 +13,7 @@ gem 'rspec-system-puppet' gem 'puppetlabs_spec_helper' gem 'puppet-syntax' gem 'facter', '>= 1.6.10' -gem 'ci_reporter_rspec' +# gem 'ci_reporter_rspec' gem 'rubocop', :git => 'https://github.com/bbatsov/rubocop', :require => false gem 'puppet-blacksmith' gem 'fog', '>= 1.25.0' diff --git a/Rakefile b/Rakefile index 6e357130..c0e73bba 100644 --- a/Rakefile +++ b/Rakefile @@ -3,8 +3,10 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' require 'puppet-syntax/tasks/puppet-syntax' require 'pathname' -require 'ci/reporter/rake/rspec' +# require 'ci/reporter/rake/rspec' require 'puppet_blacksmith/rake_tasks' +require 'rake' +require 'rspec/core/rake_task' desc "Run acceptance tests" RSpec::Core::RakeTask.new(:acceptance) do |t| @@ -18,37 +20,9 @@ RSpec::Core::RakeTask.new(:test) do |t| end PuppetLint.configuration.send("disable_80chars") -# PuppetLint.configuration.send("disable_right_to_left_relationship") -# PuppetLint.configuration.send("disable_autoloader_layout") -# PuppetLint.configuration.send("disable_names_containing_dash") PuppetLint.configuration.send("disable_class_inherits_from_params_class") -# PuppetLint.configuration.send("disable_parameter_order") -# PuppetLint.configuration.send("disable_inherits_across_namespaces") -# PuppetLint.configuration.send("disable_nested_classes_or_defines") PuppetLint.configuration.send("disable_variable_scope") -# PuppetLint.configuration.send("disable_slash_comments") -# PuppetLint.configuration.send("disable_star_comments") -# PuppetLint.configuration.send("disable_selector_inside_resource") PuppetLint.configuration.send("disable_case_without_default") -# PuppetLint.configuration.send("disable_documentation") -# PuppetLint.configuration.send("disable_double_quoted_strings") -# PuppetLint.configuration.send("disable_only_variable_string") -# PuppetLint.configuration.send("disable_variables_not_enclosed") -# PuppetLint.configuration.send("disable_single_quote_string_with_variables") -# PuppetLint.configuration.send("disable_quoted_booleans") -#--no-puppet_url_without_modules -# PuppetLint.configuration.send("disable_variable_contains_dash") -# PuppetLint.configuration.send("disable_hard_tabs") -# PuppetLint.configuration.send("disable_trailing_whitespace") -# PuppetLint.configuration.send("disable_2sp_soft_tabs") -# PuppetLint.configuration.send("disable_arrow_alignment") -# PuppetLint.configuration.send("disable_unquoted_resource_title") -# PuppetLint.configuration.send("disable_ensure_first_param") -# PuppetLint.configuration.send("disable_duplicate_params") -# PuppetLint.configuration.send("disable_unquoted_file_mode") -# PuppetLint.configuration.send("disable_file_mode") -# PuppetLint.configuration.send("disable_ensure_not_symlink_target") -#--no-unquoted_node_name exclude_paths = [ "pkg/**/*", @@ -58,6 +32,8 @@ exclude_paths = [ PuppetLint.configuration.ignore_paths = exclude_paths PuppetSyntax.exclude_paths = exclude_paths +task :spec => :test + desc "Run syntax, lint, and spec tests." task :default => [ :spec_prep, diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 6cc1ab3b..44c03b00 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'wildfly' do +describe 'wildfly', :type => :class do context 'with defaults for all parameters' do it { should contain_class('wildfly') } it { should contain_class('archive').that_comes_before('wildfly::prepare') } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ac2fd4c7..309f6daf 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,11 +1,17 @@ +begin + require 'coveralls' + Coveralls.wear! + +rescue LoadError + puts "No Coveralls support" +end + require 'rspec-puppet' require 'puppetlabs_spec_helper/module_spec_helper' - fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) - # include common helpers -support_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec/support/*.rb')) -Dir[support_path].each { |f| require f } +support_path = File.expand_path(File.join(File.dirname(__FILE__), '..','spec/support/*.rb')) +Dir[support_path].each {|f| require f} RSpec.configure do |c| c.config = '/doesnotexist' @@ -17,4 +23,4 @@ def param_value(subject, type, title, param) subject.resource(type, title).send(:parameters)[param.to_sym] end -# at_exit { RSpec::Puppet::Coverage.report! } +at_exit { RSpec::Puppet::Coverage.report! } \ No newline at end of file diff --git a/test.sh b/test.sh index 5f32a241..712fe08e 100755 --- a/test.sh +++ b/test.sh @@ -24,7 +24,8 @@ gem update --system 2.1.11 bundle exec rake syntax bundle exec rake lint -bundle exec rake ci:setup:rspec spec +bundle exec rake spec +#bundle exec rake ci:setup:rspec spec bundle exec rspec spec/acceptance BEAKER_set=centos-70-x64 bundle exec rspec spec/acceptance BEAKER_set=debian-78-x64 bundle exec rspec spec/acceptance