summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-11-14 10:48:54 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-11-14 10:48:54 -0800
commit70e7e2a56d8b6db36de331df53e9be46252b9fc3 (patch)
treea1a21e3b42b93e5cf397061f707a61de26371bb4 /tasks
parent4be0cce9900dbfb37487b05171b7137331664e1b (diff)
downloadchef-70e7e2a56d8b6db36de331df53e9be46252b9fc3.tar.gz
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
Diffstat (limited to 'tasks')
-rw-r--r--tasks/rspec.rb34
1 files changed, 16 insertions, 18 deletions
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