diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2021-10-21 17:44:53 +0200 |
---|---|---|
committer | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2021-10-25 09:11:04 +0200 |
commit | 6d69d23aa5574df501ac8bdccdeaaf0ecc550f1b (patch) | |
tree | f71030e9da8fbcfc044febe7a4a4353203ae3419 /lib | |
parent | dd4d7bae1dfdcba1697b7c669b5518bfd2daf39c (diff) | |
download | spack-6d69d23aa5574df501ac8bdccdeaaf0ecc550f1b.tar.gz spack-6d69d23aa5574df501ac8bdccdeaaf0ecc550f1b.tar.bz2 spack-6d69d23aa5574df501ac8bdccdeaaf0ecc550f1b.tar.xz spack-6d69d23aa5574df501ac8bdccdeaaf0ecc550f1b.zip |
Add a unit test to prevent regression
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/test/cmd/dependencies.py | 4 | ||||
-rw-r--r-- | lib/spack/spack/test/concretize.py | 14 | ||||
-rw-r--r-- | lib/spack/spack/test/data/config/packages.yaml | 3 | ||||
-rw-r--r-- | lib/spack/spack/test/package_class.py | 1 |
4 files changed, 20 insertions, 2 deletions
diff --git a/lib/spack/spack/test/cmd/dependencies.py b/lib/spack/spack/test/cmd/dependencies.py index 7ca1eae2e5..9d2ebccd9d 100644 --- a/lib/spack/spack/test/cmd/dependencies.py +++ b/lib/spack/spack/test/cmd/dependencies.py @@ -14,7 +14,9 @@ from spack.main import SpackCommand dependencies = SpackCommand('dependencies') -mpis = ['mpich', 'mpich2', 'multi-provider-mpi', 'zmpi'] +mpis = [ + 'low-priority-provider', 'mpich', 'mpich2', 'multi-provider-mpi', 'zmpi' +] mpi_deps = ['fake'] diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py index d30191f4f2..b2ac1b6446 100644 --- a/lib/spack/spack/test/concretize.py +++ b/lib/spack/spack/test/concretize.py @@ -1274,3 +1274,17 @@ class TestConcretize(object): # package doesn't end up using a later implementation s = spack.spec.Spec('hpcviewer@2019.02').concretized() assert s['java'].satisfies('virtual-with-versions@1.8.0') + + @pytest.mark.regression('26866') + def test_non_default_provider_of_multiple_virtuals(self): + s = spack.spec.Spec( + 'many-virtual-consumer ^low-priority-provider' + ).concretized() + assert s['mpi'].name == 'low-priority-provider' + assert s['lapack'].name == 'low-priority-provider' + + for virtual_pkg in ('mpi', 'lapack'): + for pkg in spack.repo.path.providers_for(virtual_pkg): + if pkg.name == 'low-priority-provider': + continue + assert pkg not in s diff --git a/lib/spack/spack/test/data/config/packages.yaml b/lib/spack/spack/test/data/config/packages.yaml index 84f470d208..7d5e06a74c 100644 --- a/lib/spack/spack/test/data/config/packages.yaml +++ b/lib/spack/spack/test/data/config/packages.yaml @@ -1,7 +1,8 @@ packages: all: providers: - mpi: [openmpi, mpich] + mpi: [openmpi, mpich, zmpi] + lapack: [openblas-with-lapack] blas: [openblas] externaltool: buildable: False diff --git a/lib/spack/spack/test/package_class.py b/lib/spack/spack/test/package_class.py index 22939105a4..8c55b47ba4 100644 --- a/lib/spack/spack/test/package_class.py +++ b/lib/spack/spack/test/package_class.py @@ -30,6 +30,7 @@ def mpi_names(mock_repo_path): def mpileaks_possible_deps(mock_packages, mpi_names): possible = { 'callpath': set(['dyninst'] + mpi_names), + 'low-priority-provider': set(), 'dyninst': set(['libdwarf', 'libelf']), 'fake': set(), 'libdwarf': set(['libelf']), |