From 70e7e2a56d8b6db36de331df53e9be46252b9fc3 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 14 Nov 2014 10:48:54 -0800 Subject: skip expensive spec tests by default - `rake spec` skips knife integration tests - `rake spec:all` includes them - PRs only get `rake spec` - master (and 10/11/12-stable) get `rake spec:all` - rspec and rspec spec are still essentially rake spec:all (so omnibus-chef still tests every spec) - also some cleanup of the rspec jobs --- tasks/rspec.rb | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'tasks') diff --git a/tasks/rspec.rb b/tasks/rspec.rb index 95ae274955..a6fc5a9180 100644 --- a/tasks/rspec.rb +++ b/tasks/rspec.rb @@ -27,28 +27,16 @@ begin task :default => :spec - desc "Run all specs in spec directory" + desc "Run standard specs (minus long running specs)" RSpec::Core::RakeTask.new(:spec) do |t| - t.rspec_opts = ['--options', "\"#{CHEF_ROOT}/.rspec\""] - t.pattern = FileList['spec/**/*_spec.rb'] - end - - desc "Run all functional specs (in functional/ directory)" - RSpec::Core::RakeTask.new(:functional) do |t| - t.rspec_opts = ['--options', "\"#{CHEF_ROOT}/spec/spec.opts\""] - t.pattern = FileList['spec/functional/**/*_spec.rb'] - end - - desc "Run the rspec tests with activesupport loaded" - RSpec::Core::RakeTask.new(:spec_activesupport) do |t| - t.rspec_opts = ['--options', "\"#{CHEF_ROOT}/.rspec\"", "--require active_support/core_ext"] - t.pattern = FileList['spec/unit/**/*_spec.rb'] + # right now this just limits to functional + unit, but could also remove + # individual tests marked long-running + t.pattern = FileList['spec/{functional,unit}/**/*_spec.rb'] end namespace :spec do desc "Run all specs in spec directory with RCov" RSpec::Core::RakeTask.new(:rcov) do |t| - t.rspec_opts = ['--options', "\"#{CHEF_ROOT}/spec/spec.opts\""] t.pattern = FileList['spec/**/*_spec.rb'] t.rcov = true t.rcov_opts = lambda do @@ -56,16 +44,26 @@ begin end end + desc "Run all specs in spec directory" + RSpec::Core::RakeTask.new(:all) do |t| + t.pattern = FileList['spec/**/*_spec.rb'] + end + desc "Print Specdoc for all specs" RSpec::Core::RakeTask.new(:doc) do |t| t.rspec_opts = ["--format", "specdoc", "--dry-run"] t.pattern = FileList['spec/**/*_spec.rb'] end - [:unit].each do |sub| + desc "Run the specs under spec/unit with activesupport loaded" + RSpec::Core::RakeTask.new(:activesupport) do |t| + t.rspec_opts = ["--require active_support/core_ext"] + t.pattern = FileList['spec/unit/**/*_spec.rb'] + end + + [:unit, :functional, :integration, :stress].each do |sub| desc "Run the specs under spec/#{sub}" RSpec::Core::RakeTask.new(sub) do |t| - t.rspec_opts = ['--options', "\"#{CHEF_ROOT}/spec/spec.opts\""] t.pattern = FileList["spec/#{sub}/**/*_spec.rb"] end end -- cgit v1.2.1