diff --git a/README.md b/README.md index 62e00c689da73463a22bb85cc9671f8634b25c06..86ab9c2faabf361a78652d0621fae36e165c8a6c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # ~~Yashchiki~~Koutakia For now, this repository provides helpers for the EBRAINS container image build flow. +The lowest spack version which should be used with this library is v0.22.0 diff --git a/esd/tests/spack_from_scratch_test.py b/esd/tests/spack_from_scratch_test.py index cca0d2e9e957b0cd271c47729c9b75ff29198df3..3cdbc327bae8694a65bfb56a44046e4b12f19db2 100644 --- a/esd/tests/spack_from_scratch_test.py +++ b/esd/tests/spack_from_scratch_test.py @@ -12,24 +12,24 @@ def test_spack_repo_exists_1(): assert spack_manager.spack_repo_exists('ebrains-spack-builds') == False -def test_spack_repo_exists_2(): - install_dir = Path('./install').resolve() +def test_spack_repo_exists_2(tmp_path): + install_dir = tmp_path env = SpackModel('ebrains-spack-builds', install_dir) spack_manager = SpackManagerScratch(env=env) with pytest.raises(NoSpackEnvironmentException): spack_manager.spack_repo_exists(env.env_name) -# def test_spack_repo_exists_3(): -# install_dir = Path('./install').resolve() -# env = SpackModel('ebrains-spack-builds', install_dir) -# spack_manager = SpackManagerScratch(env=env) -# spack_manager.setup_spack_env() -# assert spack_manager.spack_repo_exists(env.env_name) == False +def test_spack_repo_exists_3(tmp_path): + install_dir = tmp_path + env = SpackModel('ebrains-spack-builds', install_dir) + spack_manager = SpackManagerScratch(env=env) + spack_manager.setup_spack_env() + assert spack_manager.spack_repo_exists(env.env_name) == False -def test_spack_from_scratch_setup_1(): - install_dir = Path('./install').resolve() +def test_spack_from_scratch_setup_1(tmp_path): + install_dir = tmp_path env = SpackModel('ebrains-spack-builds', install_dir, 'https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git', ) spack_manager = SpackManagerScratch(env=env, repos=[env], system_name='ebrainslab') @@ -37,8 +37,8 @@ def test_spack_from_scratch_setup_1(): assert spack_manager.spack_repo_exists(env.env_name) == True -def test_spack_from_scratch_setup_2(): - install_dir = Path('./install').resolve() +def test_spack_from_scratch_setup_2(tmp_path): + install_dir = tmp_path env = SpackModel('ebrains-spack-builds', install_dir, 'https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git', ) repo = env @@ -47,8 +47,8 @@ def test_spack_from_scratch_setup_2(): assert spack_manager.spack_repo_exists(env.env_name) == True -def test_spack_from_scratch_setup_3(): - install_dir = Path('./install').resolve() +def test_spack_from_scratch_setup_3(tmp_path): + install_dir = tmp_path env = SpackModel('new_env1', install_dir) repo = env spack_manager = SpackManagerScratch(env=env, repos=[repo, repo], system_name='ebrainslab') @@ -56,8 +56,8 @@ def test_spack_from_scratch_setup_3(): spack_manager.setup_spack_env() -def test_spack_from_scratch_setup_4(): - install_dir = Path('./install').resolve() +def test_spack_from_scratch_setup_4(tmp_path ): + install_dir = tmp_path env = SpackModel('new_env2', install_dir) spack_manager = SpackManagerScratch(env=env) spack_manager.setup_spack_env() diff --git a/esd/tests/spack_install_test.py b/esd/tests/spack_install_test.py index 34f683234b064d0f800bfa9376fcf6fec592d7ef..50e940441f9c52a328ae345292a84b19b8ce6080 100644 --- a/esd/tests/spack_install_test.py +++ b/esd/tests/spack_install_test.py @@ -4,18 +4,18 @@ from esd.spack_manager.factory.SpackManagerBuildCache import SpackManagerBuildCa from esd.spack_manager.factory.SpackManagerScratch import SpackManagerScratch +SPACK_VERSION = "0.22.0" + # we need this test to run first so that spack is installed only once @pytest.mark.run(order=1) def test_spack_install_scratch(): spack_manager = SpackManagerScratch() - spack_manager.install_spack(spack_version="v0.21.1") + spack_manager.install_spack(spack_version=f'v{SPACK_VERSION}') installed_spack_version = spack_manager.get_spack_installed_version() - required_version = "0.21.1" - assert required_version == installed_spack_version + assert SPACK_VERSION == installed_spack_version def test_spack_install_buildcache(): spack_manager = SpackManagerBuildCache() installed_spack_version = spack_manager.get_spack_installed_version() - required_version = "0.21.1" - assert required_version == installed_spack_version + assert SPACK_VERSION == installed_spack_version