Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dedal
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EBRAINS RI
Tech Hub
Platform
EBRAINS Software Distribution
dedal
Commits
45c0a69e
Commit
45c0a69e
authored
2 months ago
by
Adrian Ciu
Browse files
Options
Downloads
Patches
Plain Diff
esd-spack-installation: added concretization step and tests
parent
6d92683c
No related branches found
No related tags found
1 merge request
!4
feat(spack_operation): implement setup_spack_env functionality
Pipeline
#58802
failed with stages
in 3 minutes and 7 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
esd/tests/spack_from_scratch_test.py
+11
-11
11 additions, 11 deletions
esd/tests/spack_from_scratch_test.py
with
11 additions
and
11 deletions
esd/tests/spack_from_scratch_test.py
+
11
−
11
View file @
45c0a69e
...
@@ -11,14 +11,14 @@ from esd.utils.utils import file_exists_and_not_empty
...
@@ -11,14 +11,14 @@ from esd.utils.utils import file_exists_and_not_empty
def
test_spack_repo_exists_1
():
def
test_spack_repo_exists_1
():
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
)
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
)
assert
spack_manager
.
spack_repo_exists
(
'
ebrains-spack-builds
'
)
==
False
assert
spack_manager
.
spack_repo_exists
(
'
ebrains-spack-builds
'
)
==
False
def
test_spack_repo_exists_2
(
tmp_path
):
def
test_spack_repo_exists_2
(
tmp_path
):
install_dir
=
tmp_path
install_dir
=
tmp_path
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
)
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
)
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
)
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
)
with
pytest
.
raises
(
NoSpackEnvironmentException
):
with
pytest
.
raises
(
NoSpackEnvironmentException
):
spack_manager
.
spack_repo_exists
(
env
.
env_name
)
spack_manager
.
spack_repo_exists
(
env
.
env_name
)
...
@@ -26,7 +26,7 @@ def test_spack_repo_exists_2(tmp_path):
...
@@ -26,7 +26,7 @@ def test_spack_repo_exists_2(tmp_path):
def
test_spack_repo_exists_3
(
tmp_path
):
def
test_spack_repo_exists_3
(
tmp_path
):
install_dir
=
tmp_path
install_dir
=
tmp_path
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
)
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
)
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
)
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
)
spack_manager
.
setup_spack_env
()
spack_manager
.
setup_spack_env
()
assert
spack_manager
.
spack_repo_exists
(
env
.
env_name
)
==
False
assert
spack_manager
.
spack_repo_exists
(
env
.
env_name
)
==
False
...
@@ -35,7 +35,7 @@ def test_spack_from_scratch_setup_1(tmp_path):
...
@@ -35,7 +35,7 @@ def test_spack_from_scratch_setup_1(tmp_path):
install_dir
=
tmp_path
install_dir
=
tmp_path
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
,
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
,
'
https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
'
,
)
'
https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
'
,
)
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
system_name
=
'
ebrainslab
'
)
system_name
=
'
ebrainslab
'
)
spack_manager
.
setup_spack_env
()
spack_manager
.
setup_spack_env
()
assert
spack_manager
.
spack_repo_exists
(
env
.
env_name
)
==
False
assert
spack_manager
.
spack_repo_exists
(
env
.
env_name
)
==
False
...
@@ -46,7 +46,7 @@ def test_spack_from_scratch_setup_2(tmp_path):
...
@@ -46,7 +46,7 @@ def test_spack_from_scratch_setup_2(tmp_path):
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
,
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
,
'
https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
'
,
)
'
https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
'
,
)
repo
=
env
repo
=
env
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
repos
=
[
repo
,
repo
],
repos
=
[
repo
,
repo
],
system_name
=
'
ebrainslab
'
)
system_name
=
'
ebrainslab
'
)
spack_manager
.
setup_spack_env
()
spack_manager
.
setup_spack_env
()
...
@@ -57,7 +57,7 @@ def test_spack_from_scratch_setup_3(tmp_path):
...
@@ -57,7 +57,7 @@ def test_spack_from_scratch_setup_3(tmp_path):
install_dir
=
tmp_path
install_dir
=
tmp_path
env
=
SpackModel
(
'
new_env1
'
,
install_dir
)
env
=
SpackModel
(
'
new_env1
'
,
install_dir
)
repo
=
env
repo
=
env
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
repos
=
[
repo
,
repo
],
repos
=
[
repo
,
repo
],
system_name
=
'
ebrainslab
'
)
system_name
=
'
ebrainslab
'
)
with
pytest
.
raises
(
BashCommandException
):
with
pytest
.
raises
(
BashCommandException
):
...
@@ -67,7 +67,7 @@ def test_spack_from_scratch_setup_3(tmp_path):
...
@@ -67,7 +67,7 @@ def test_spack_from_scratch_setup_3(tmp_path):
def
test_spack_from_scratch_setup_4
(
tmp_path
):
def
test_spack_from_scratch_setup_4
(
tmp_path
):
install_dir
=
tmp_path
install_dir
=
tmp_path
env
=
SpackModel
(
'
new_env2
'
,
install_dir
)
env
=
SpackModel
(
'
new_env2
'
,
install_dir
)
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
)
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
)
spack_manager
.
setup_spack_env
()
spack_manager
.
setup_spack_env
()
assert
spack_manager
.
spack_env_exists
()
==
True
assert
spack_manager
.
spack_env_exists
()
==
True
...
@@ -75,7 +75,7 @@ def test_spack_from_scratch_setup_4(tmp_path):
...
@@ -75,7 +75,7 @@ def test_spack_from_scratch_setup_4(tmp_path):
def
test_spack_not_a_valid_repo
():
def
test_spack_not_a_valid_repo
():
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
Path
(),
None
)
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
Path
(),
None
)
repo
=
env
repo
=
env
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
repos
=
[
repo
],
repos
=
[
repo
],
system_name
=
'
ebrainslab
'
)
system_name
=
'
ebrainslab
'
)
with
pytest
.
raises
(
NoSpackEnvironmentException
):
with
pytest
.
raises
(
NoSpackEnvironmentException
):
...
@@ -87,7 +87,7 @@ def test_spack_from_scratch_concretize_1(tmp_path):
...
@@ -87,7 +87,7 @@ def test_spack_from_scratch_concretize_1(tmp_path):
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
,
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
,
'
https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
'
,
)
'
https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
'
,
)
repo
=
env
repo
=
env
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
repos
=
[
repo
,
repo
],
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
repos
=
[
repo
,
repo
],
system_name
=
'
ebrainslab
'
)
system_name
=
'
ebrainslab
'
)
spack_manager
.
setup_spack_env
()
spack_manager
.
setup_spack_env
()
spack_manager
.
concretize_spack_env
(
force
=
True
)
spack_manager
.
concretize_spack_env
(
force
=
True
)
...
@@ -100,7 +100,7 @@ def test_spack_from_scratch_concretize_2(tmp_path):
...
@@ -100,7 +100,7 @@ def test_spack_from_scratch_concretize_2(tmp_path):
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
,
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
,
'
https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
'
,
)
'
https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
'
,
)
repo
=
env
repo
=
env
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
repos
=
[
repo
,
repo
],
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
repos
=
[
repo
,
repo
],
system_name
=
'
ebrainslab
'
)
system_name
=
'
ebrainslab
'
)
spack_manager
.
setup_spack_env
()
spack_manager
.
setup_spack_env
()
spack_manager
.
concretize_spack_env
(
force
=
False
)
spack_manager
.
concretize_spack_env
(
force
=
False
)
...
@@ -113,7 +113,7 @@ def test_spack_from_scratch_concretize_3(tmp_path):
...
@@ -113,7 +113,7 @@ def test_spack_from_scratch_concretize_3(tmp_path):
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
,
env
=
SpackModel
(
'
ebrains-spack-builds
'
,
install_dir
,
'
https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
'
,
)
'
https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git
'
,
)
repo
=
env
repo
=
env
spack_manager
:
SpackManagerScratch
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
spack_manager
=
SpackManagerCreator
.
get_spack_manger
(
SpackManagerEnum
.
FROM_SCRATCH
,
env
=
env
,
repos
=
[
repo
,
repo
],
repos
=
[
repo
,
repo
],
system_name
=
'
ebrainslab
'
)
system_name
=
'
ebrainslab
'
)
spack_manager
.
setup_spack_env
()
spack_manager
.
setup_spack_env
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment