[rubygems/rubygems] Allow smoother breaking changes in test env

https://github.com/rubygems/rubygems/commit/0fc3feae19
This commit is contained in:
David Rodríguez 2024-07-23 20:56:32 +02:00 committed by git
parent b37ffb9345
commit ec13ccdf53
2 changed files with 14 additions and 3 deletions

View File

@ -102,7 +102,18 @@ module Spec
end
def tmp(*path)
source_root.join("tmp", scope, *path)
tmp_root(scope).join(*path)
end
def tmp_root(scope)
source_root.join("tmp", "#{test_env_version}.#{scope}")
end
# Bump this version whenever you make a breaking change to the spec setup
# that requires regenerating tmp/.
def test_env_version
1
end
def scope

View File

@ -57,8 +57,8 @@ module Spec
install_test_deps
(2..Parallel.processor_count).each do |n|
source = Path.source_root.join("tmp", "1")
destination = Path.source_root.join("tmp", n.to_s)
source = Path.tmp_root("1")
destination = Path.tmp_root(n.to_s)
FileUtils.rm_rf destination
FileUtils.cp_r source, destination