Add upstreams.yaml testing file so calls to upstreams['global] doesn't cause tests to fail

This commit is contained in:
Carson Woods
2019-07-18 11:28:23 -06:00
parent deb2d3745c
commit a7ad344c2a
3 changed files with 11 additions and 3 deletions

View File

@@ -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': {

View File

@@ -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)

View 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