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-636) Always remove symlink fixtures. Only remove downloaded fixtures if tests pass. #241

Merged
merged 1 commit into from
May 8, 2018
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions lib/puppetlabs_spec_helper/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@
begin
Rake::Task[:spec_prep].invoke
Rake::Task[:spec_standalone].invoke(*args.extras)
ensure
Rake::Task[:spec_clean].invoke
ensure
Rake::Task[:spec_clean_symlinks].invoke
end
end

Expand All @@ -78,8 +79,9 @@

Rake::Task[:spec_prep].invoke
ParallelTests::CLI.new.run(args)
ensure
Rake::Task[:spec_clean].invoke
ensure
Rake::Task[:spec_clean_symlinks].invoke
end
end
end
Expand Down
13 changes: 9 additions & 4 deletions lib/puppetlabs_spec_helper/tasks/fixtures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,17 @@ def check_directory_for_symlinks(dir='.')

FileUtils::rm_rf(module_working_directory)

fixtures("symlinks").each do |source, opts|
target = opts["target"]
FileUtils::rm_f(target)
end
Rake::Task[:spec_clean_symlinks].invoke

if File.zero?("spec/fixtures/manifests/site.pp")
FileUtils::rm_f("spec/fixtures/manifests/site.pp")
end
end

desc "Clean up any fixture symlinks"
task :spec_clean_symlinks do
fixtures("symlinks").each do |source, opts|
target = opts["target"]
FileUtils::rm_f(target)
end
end