Add upstreams.yaml testing file so calls to upstreams['global] doesn't cause tests to fail
This commit is contained in:
@@ -199,15 +199,14 @@ def __init__(self, root, db_dir=None, upstream_dbs=None,
|
||||
|
||||
self.is_upstream = is_upstream
|
||||
|
||||
# Create global
|
||||
index_path = self._index_path
|
||||
# Create .spack-db/index.json for global upstream it doesn't exist
|
||||
global_install_tree = spack.config.get(
|
||||
'upstreams')['global']['install_tree']
|
||||
global_install_tree = global_install_tree.replace(
|
||||
'$spack', spack.paths.prefix)
|
||||
if self.is_upstream:
|
||||
if global_install_tree in self._db_dir:
|
||||
if not os.path.isfile(index_path):
|
||||
if not os.path.isfile(self._index_path):
|
||||
f = open(self._index_path, "w+")
|
||||
database = {
|
||||
'database': {
|
||||
|
||||
@@ -290,6 +290,7 @@ def configuration_dir(tmpdir_factory, linux_os):
|
||||
packages_yaml = test_path.join('data', 'packages.yaml')
|
||||
config_yaml = test_path.join('data', 'config.yaml')
|
||||
repos_yaml = test_path.join('data', 'repos.yaml')
|
||||
upstreams_yaml = test_path.join('data', 'upstreams.yaml')
|
||||
|
||||
# Create temporary 'site' and 'user' folders
|
||||
tmpdir.ensure('site', dir=True)
|
||||
@@ -299,6 +300,7 @@ def configuration_dir(tmpdir_factory, linux_os):
|
||||
packages_yaml.copy(tmpdir.join('site', 'packages.yaml'))
|
||||
config_yaml.copy(tmpdir.join('site', 'config.yaml'))
|
||||
repos_yaml.copy(tmpdir.join('site', 'repos.yaml'))
|
||||
upstreams_yaml.copy(tmpdir.join('site', 'upstreams.yaml'))
|
||||
|
||||
# Write the one that needs modifications
|
||||
content = ''.join(compilers_yaml.read()).format(linux_os)
|
||||
|
||||
7
lib/spack/spack/test/data/upstreams.yaml
Normal file
7
lib/spack/spack/test/data/upstreams.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
upstreams:
|
||||
global:
|
||||
install_tree: $spack/opt/spack
|
||||
modules:
|
||||
tcl: $spack/share/spack/modules
|
||||
lmod: $spack/share/spack/lmod
|
||||
dotkit: $spack/share/spack/dotkit
|
||||
Reference in New Issue
Block a user