diff --git a/softpack_core/app.py b/softpack_core/app.py index 9c796f4..7c9bc7b 100644 --- a/softpack_core/app.py +++ b/softpack_core/app.py @@ -44,7 +44,7 @@ def status() -> dict[str, Any]: def __init__(self) -> None: """Constructor.""" self.settings = Settings.parse_obj({}) - self.spack = Spack() + self.spack = Spack(self.settings.spack.bin, self.settings.spack.repo) self.router.add_middleware( CORSMiddleware, diff --git a/tests/integration/test_spack.py b/tests/integration/test_spack.py index 5a7f788..3baf616 100644 --- a/tests/integration/test_spack.py +++ b/tests/integration/test_spack.py @@ -34,8 +34,6 @@ def test_spack_packages(): packages = list(PackageCollection.iter()) - assert len(packages) == len(pkgs) - assert isinstance(packages[0], PackageMultiVersion) assert packages[0].name != "" @@ -43,12 +41,15 @@ def test_spack_packages(): assert len(packages[0].versions) != 0 if app.settings.spack.repo == "https://github.com/custom-spack/repo": - pytest.skip("skipped due to missing custom repo") + assert len(packages) == len(pkgs) + else: + assert len(packages) > len(pkgs) - spack = Spack("spack", app.settings.spack.repo) - spack.packages() + spack = Spack(custom_repo = app.settings.spack.repo) + + spack.packages() - assert len(spack.stored_packages) > len(pkgs) + assert len(spack.stored_packages) == len(packages) def test_spack_package_updater():