Skip to content
Permalink
Browse files

(PDK-381) Ensure spec fixtures are cleaned up, even if the test fails

  • Loading branch information...
rodjek committed Aug 10, 2017
1 parent f723861 commit 3338d0315713f7e7ae2600372ac119f5f9ea0034
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/puppetlabs_spec_helper/rake_tasks.rb
@@ -368,9 +368,12 @@ def max_thread_limit

desc "Run spec tests and clean the fixtures directory if successful"
task :spec do
Rake::Task[:spec_prep].invoke
Rake::Task[:spec_standalone].invoke
Rake::Task[:spec_clean].invoke
begin
Rake::Task[:spec_prep].invoke
Rake::Task[:spec_standalone].invoke
ensure
Rake::Task[:spec_clean].invoke
end
end

desc "Parallel spec tests"
@@ -384,9 +387,10 @@ def max_thread_limit

Rake::Task[:spec_prep].invoke
ParallelTests::CLI.new.run(args)
Rake::Task[:spec_clean].invoke
rescue LoadError
raise 'Add the parallel_tests gem to Gemfile to enable this task'
ensure
Rake::Task[:spec_clean].invoke
end
end

0 comments on commit 3338d03

Please sign in to comment.
You can’t perform that action at this time.