From d28a4026b75a59f3811879a815424b48c904d3b2 Mon Sep 17 00:00:00 2001 From: Sebastien Badia Date: Fri, 21 Mar 2014 10:29:42 +0100 Subject: [PATCH] [spec] Update rake tasks (refs: #372) Update the default task to clean fixtures, and don't run coverage report (asked by @EmilienM). New tasks: rake => run all tests and clean fixtures (alias on :test) rake test => run all tests and clean fixtures rake test_keep => run all tests and don't clean fixtures COV=y rake cov => run all tests, run coverage repo, and don't clean fixtures Refs: #372 --- README.md | 2 +- Rakefile | 10 +++++++++- spec/classes/coverage_spec.rb | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 04d4c034..5e6fc43a 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ Limitations Getting Involved ---------------- -Need a feature? Found a bug? Let me know! +Need a feature? Found a bug? Let us know! We are extremely interested in growing a community of OpenStack experts and users around these modules so they can serve as an example of consolidated best practices of how to deploy openstack. diff --git a/Rakefile b/Rakefile index 6230cc29..d7b4fb01 100644 --- a/Rakefile +++ b/Rakefile @@ -17,7 +17,15 @@ PuppetSyntax.exclude_paths = exclude_paths task(:default).clear -task :default => [:spec_prep, :spec_standalone, :lint] +task :default => :test desc 'Run syntax, lint and spec tests' task :test => [:syntax,:lint,:spec] + +desc 'Run syntax, lint and spec tests (without fixture purge = train/airplane)' +task :test_keep => [:syntax,:lint,:spec_prep,:spec_standalone] + +if ENV['COV'] + desc 'Run syntax, lint, spec tests and coverage' + task :cov => [:syntax,:lint,:spec_prep,:spec_standalone] +end diff --git a/spec/classes/coverage_spec.rb b/spec/classes/coverage_spec.rb index 12513b83..fbe09652 100644 --- a/spec/classes/coverage_spec.rb +++ b/spec/classes/coverage_spec.rb @@ -1 +1,5 @@ -at_exit { RSpec::Puppet::Coverage.report! } +require 'spec_helper' + +if ENV['COV'] + at_exit { RSpec::Puppet::Coverage.report! } +end