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
4ac0a230
Commit
4ac0a230
authored
2 months ago
by
Adrian Ciu
Browse files
Options
Downloads
Patches
Plain Diff
esd-spack-installation: added clean up after each test
parent
a6c7030f
No related branches found
Branches containing commit
No related tags found
1 merge request
!4
feat(spack_operation): implement setup_spack_env functionality
Pipeline
#58787
passed with stages
in 2 minutes and 52 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-0
1 addition, 0 deletions
README.md
esd/tests/spack_from_scratch_test.py
+16
-16
16 additions, 16 deletions
esd/tests/spack_from_scratch_test.py
esd/tests/spack_install_test.py
+5
-5
5 additions, 5 deletions
esd/tests/spack_install_test.py
with
22 additions
and
21 deletions
README.md
+
1
−
0
View file @
4ac0a230
# ~~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
This diff is collapsed.
Click to expand it.
esd/tests/spack_from_scratch_test.py
+
16
−
16
View file @
4ac0a230
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
esd/tests/spack_install_test.py
+
5
−
5
View file @
4ac0a230
...
...
@@ -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
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