Skip to content
Snippets Groups Projects
Commit ffc91bd8 authored by Todd Gamblin's avatar Todd Gamblin
Browse files

tests: move mock config.yaml files to common directory

Test configuration files (except modules.yaml) were in the root level of
test/data, but should really just be in their own directory.  The absence
of modules.yaml was also breaking module tests if we got module
preferences after tests started, as the mock modules.yaml was not in the
test directory.
parent 3017584c
No related branches found
No related tags found
No related merge requests found
...@@ -363,23 +363,16 @@ def configuration_dir(tmpdir_factory, linux_os): ...@@ -363,23 +363,16 @@ def configuration_dir(tmpdir_factory, linux_os):
""" """
tmpdir = tmpdir_factory.mktemp('configurations') tmpdir = tmpdir_factory.mktemp('configurations')
# Name of the yaml files in the test/data folder # <test_path>/data/config has mock config yaml files in it
test_path = py.path.local(spack.paths.test_path) # copy these to the site config.
compilers_yaml = test_path.join('data', 'compilers.yaml') test_config = py.path.local(spack.paths.test_path).join('data', 'config')
packages_yaml = test_path.join('data', 'packages.yaml') test_config.copy(tmpdir.join('site'))
config_yaml = test_path.join('data', 'config.yaml')
repos_yaml = test_path.join('data', 'repos.yaml')
# Create temporary 'site' and 'user' folders
tmpdir.ensure('site', dir=True)
tmpdir.ensure('user', dir=True)
# Copy the configurations that don't need further work # Create temporary 'defaults', 'site' and 'user' folders
packages_yaml.copy(tmpdir.join('site', 'packages.yaml')) tmpdir.ensure('user', dir=True)
config_yaml.copy(tmpdir.join('site', 'config.yaml'))
repos_yaml.copy(tmpdir.join('site', 'repos.yaml'))
# Write the one that needs modifications # Slightly modify compilers.yaml to look like Linux
compilers_yaml = test_config.join('compilers.yaml')
content = ''.join(compilers_yaml.read()).format(linux_os) content = ''.join(compilers_yaml.read()).format(linux_os)
t = tmpdir.join('site', 'compilers.yaml') t = tmpdir.join('site', 'compilers.yaml')
t.write(content) t.write(content)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment