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.
This commit is contained in:
		@@ -10,6 +10,7 @@
 | 
			
		||||
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)
 | 
			
		||||
    )
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user