summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2019-12-02 01:03:20 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2019-12-18 21:10:31 -0800
commitaf249d3cf6617cd635ed7aa54dddd83d7eb09cef (patch)
tree61f659e0a4407fa16b0395360e67eb85858cd685
parent531f370e0d3256202e1eb40dce669e8ae2ebb15a (diff)
downloadspack-af249d3cf6617cd635ed7aa54dddd83d7eb09cef.tar.gz
spack-af249d3cf6617cd635ed7aa54dddd83d7eb09cef.tar.bz2
spack-af249d3cf6617cd635ed7aa54dddd83d7eb09cef.tar.xz
spack-af249d3cf6617cd635ed7aa54dddd83d7eb09cef.zip
package_sanity: add a test to enforce no nonexisting dependencies in builtin
We shouldn't allow packages to have missing dependencies in the mainline. - [x] Add a test to enforce this.
-rw-r--r--lib/spack/spack/test/package_sanity.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/spack/spack/test/package_sanity.py b/lib/spack/spack/test/package_sanity.py
index e7ac1563eb..1764d8ac25 100644
--- a/lib/spack/spack/test/package_sanity.py
+++ b/lib/spack/spack/test/package_sanity.py
@@ -10,6 +10,7 @@ import re
import pytest
import spack.fetch_strategy
+import spack.package
import spack.paths
import spack.repo
import spack.util.executable as executable
@@ -187,3 +188,18 @@ def test_prs_update_old_api():
assert not failing, msg.format(
len(failing), ','.join(failing)
)
+
+
+def test_all_dependencies_exist():
+ """Make sure no packages have nonexisting dependencies."""
+ missing = {}
+ pkgs = [pkg for pkg in spack.repo.path.all_package_names()]
+ spack.package.possible_dependencies(
+ *pkgs, transitive=True, missing=missing)
+
+ lines = [
+ "%s: [%s]" % (name, ", ".join(deps)) for name, deps in missing.items()
+ ]
+ assert not missing, "These packages have missing dependencies:\n" + (
+ "\n".join(lines)
+ )