diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2019-12-31 12:56:21 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2019-12-31 13:48:01 -0800 |
commit | ffc91bd86ee6ff98a1307ddefb84a6b1783c96a9 (patch) | |
tree | 56248342b58cef1e9c15758bc8c583e36fda5ce6 | |
parent | 3017584c48172ce4df976ee723ae9caf4509c68f (diff) | |
download | spack-ffc91bd86ee6ff98a1307ddefb84a6b1783c96a9.tar.gz spack-ffc91bd86ee6ff98a1307ddefb84a6b1783c96a9.tar.bz2 spack-ffc91bd86ee6ff98a1307ddefb84a6b1783c96a9.tar.xz spack-ffc91bd86ee6ff98a1307ddefb84a6b1783c96a9.zip |
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.
-rw-r--r-- | lib/spack/spack/test/conftest.py | 23 | ||||
-rw-r--r-- | lib/spack/spack/test/data/config/compilers.yaml (renamed from lib/spack/spack/test/data/compilers.yaml) | 0 | ||||
-rw-r--r-- | lib/spack/spack/test/data/config/config.yaml (renamed from lib/spack/spack/test/data/config.yaml) | 0 | ||||
-rw-r--r-- | lib/spack/spack/test/data/config/packages.yaml (renamed from lib/spack/spack/test/data/packages.yaml) | 0 | ||||
-rw-r--r-- | lib/spack/spack/test/data/config/repos.yaml (renamed from lib/spack/spack/test/data/repos.yaml) | 0 |
5 files changed, 8 insertions, 15 deletions
diff --git a/lib/spack/spack/test/conftest.py b/lib/spack/spack/test/conftest.py index 572a38c225..7fb99a4147 100644 --- a/lib/spack/spack/test/conftest.py +++ b/lib/spack/spack/test/conftest.py @@ -363,23 +363,16 @@ def configuration_dir(tmpdir_factory, linux_os): """ tmpdir = tmpdir_factory.mktemp('configurations') - # Name of the yaml files in the test/data folder - test_path = py.path.local(spack.paths.test_path) - compilers_yaml = test_path.join('data', 'compilers.yaml') - packages_yaml = test_path.join('data', 'packages.yaml') - 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) + # <test_path>/data/config has mock config yaml files in it + # copy these to the site config. + test_config = py.path.local(spack.paths.test_path).join('data', 'config') + test_config.copy(tmpdir.join('site')) - # Copy the configurations that don't need further work - packages_yaml.copy(tmpdir.join('site', 'packages.yaml')) - config_yaml.copy(tmpdir.join('site', 'config.yaml')) - repos_yaml.copy(tmpdir.join('site', 'repos.yaml')) + # Create temporary 'defaults', 'site' and 'user' folders + tmpdir.ensure('user', dir=True) - # 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) t = tmpdir.join('site', 'compilers.yaml') t.write(content) diff --git a/lib/spack/spack/test/data/compilers.yaml b/lib/spack/spack/test/data/config/compilers.yaml index 7aec138473..7aec138473 100644 --- a/lib/spack/spack/test/data/compilers.yaml +++ b/lib/spack/spack/test/data/config/compilers.yaml diff --git a/lib/spack/spack/test/data/config.yaml b/lib/spack/spack/test/data/config/config.yaml index 0611251189..0611251189 100644 --- a/lib/spack/spack/test/data/config.yaml +++ b/lib/spack/spack/test/data/config/config.yaml diff --git a/lib/spack/spack/test/data/packages.yaml b/lib/spack/spack/test/data/config/packages.yaml index c7256ddb33..c7256ddb33 100644 --- a/lib/spack/spack/test/data/packages.yaml +++ b/lib/spack/spack/test/data/config/packages.yaml diff --git a/lib/spack/spack/test/data/repos.yaml b/lib/spack/spack/test/data/config/repos.yaml index 4fbbfe9d62..4fbbfe9d62 100644 --- a/lib/spack/spack/test/data/repos.yaml +++ b/lib/spack/spack/test/data/config/repos.yaml |