Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/puppetlabs_spec_helper/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down