Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dedal
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
3
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
5f0e57c1
Commit
5f0e57c1
authored
2 months ago
by
Adrian Ciu
Browse files
Options
Downloads
Patches
Plain Diff
VT-101: fixed warnings from tests
parent
dae40b4d
No related branches found
No related tags found
1 merge request
!9
VT-101: implemented spack find operation
Pipeline
#60805
passed with stages
in 37 minutes and 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dedal/tests/integration_tests/spack_from_cache_test.py
+40
-7
40 additions, 7 deletions
dedal/tests/integration_tests/spack_from_cache_test.py
with
40 additions
and
7 deletions
dedal/tests/integration_tests/spack_from_cache_test.py
+
40
−
7
View file @
5f0e57c1
...
@@ -9,8 +9,8 @@ from dedal.utils.utils import file_exists_and_not_empty, count_files_in_folder
...
@@ -9,8 +9,8 @@ from dedal.utils.utils import file_exists_and_not_empty, count_files_in_folder
from
dedal.utils.variables
import
test_spack_env_git
,
ebrains_spack_builds_git
from
dedal.utils.variables
import
test_spack_env_git
,
ebrains_spack_builds_git
def
test_spack_from_cache_
setup
(
tmp_
path
):
def
setup
(
path
):
install_dir
=
tmp_
path
install_dir
=
path
env
=
SpackDescriptor
(
'
test-spack-env
'
,
install_dir
,
test_spack_env_git
)
env
=
SpackDescriptor
(
'
test-spack-env
'
,
install_dir
,
test_spack_env_git
)
repo
=
SpackDescriptor
(
'
ebrains-spack-builds
'
,
install_dir
,
ebrains_spack_builds_git
)
repo
=
SpackDescriptor
(
'
ebrains-spack-builds
'
,
install_dir
,
ebrains_spack_builds_git
)
concretization_dir
=
install_dir
/
'
concretize
'
concretization_dir
=
install_dir
/
'
concretize
'
...
@@ -19,6 +19,11 @@ def test_spack_from_cache_setup(tmp_path):
...
@@ -19,6 +19,11 @@ def test_spack_from_cache_setup(tmp_path):
buildcache_dir
=
buildcache_dir
)
buildcache_dir
=
buildcache_dir
)
spack_config
.
add_repo
(
repo
)
spack_config
.
add_repo
(
repo
)
spack_operation
=
SpackOperationCreator
.
get_spack_operator
(
spack_config
,
use_cache
=
True
)
spack_operation
=
SpackOperationCreator
.
get_spack_operator
(
spack_config
,
use_cache
=
True
)
return
spack_operation
,
concretization_dir
,
buildcache_dir
def
test_spack_from_cache_setup
(
tmp_path
):
spack_operation
,
concretization_dir
,
buildcache_dir
=
setup
(
tmp_path
)
assert
isinstance
(
spack_operation
,
SpackOperationUseCache
)
assert
isinstance
(
spack_operation
,
SpackOperationUseCache
)
spack_operation
.
install_spack
(
bashrc_path
=
str
(
tmp_path
/
Path
(
'
.bashrc
'
)))
spack_operation
.
install_spack
(
bashrc_path
=
str
(
tmp_path
/
Path
(
'
.bashrc
'
)))
spack_operation
.
setup_spack_env
()
spack_operation
.
setup_spack_env
()
...
@@ -27,26 +32,54 @@ def test_spack_from_cache_setup(tmp_path):
...
@@ -27,26 +32,54 @@ def test_spack_from_cache_setup(tmp_path):
assert
file_exists_and_not_empty
(
concretization_download_file_path
)
==
True
assert
file_exists_and_not_empty
(
concretization_download_file_path
)
==
True
assert
count_files_in_folder
(
buildcache_dir
)
==
num_tags
assert
count_files_in_folder
(
buildcache_dir
)
==
num_tags
assert
'
local_cache
'
in
spack_operation
.
mirror_list
()
assert
'
local_cache
'
in
spack_operation
.
mirror_list
()
return
spack_operation
def
test_spack_from_cache_concretize
(
tmp_path
):
def
test_spack_from_cache_concretize
(
tmp_path
):
spack_operation
=
test_spack_from_cache_setup
(
tmp_path
)
spack_operation
,
concretization_dir
,
buildcache_dir
=
setup
(
tmp_path
)
assert
isinstance
(
spack_operation
,
SpackOperationUseCache
)
spack_operation
.
install_spack
(
bashrc_path
=
str
(
tmp_path
/
Path
(
'
.bashrc
'
)))
spack_operation
.
setup_spack_env
()
num_tags
=
len
(
spack_operation
.
build_cache
.
list_tags
())
concretization_download_file_path
=
concretization_dir
/
'
spack.lock
'
assert
file_exists_and_not_empty
(
concretization_download_file_path
)
==
True
assert
count_files_in_folder
(
buildcache_dir
)
==
num_tags
assert
'
local_cache
'
in
spack_operation
.
mirror_list
()
assert
spack_operation
.
concretize_spack_env
()
==
False
assert
spack_operation
.
concretize_spack_env
()
==
False
concretization_file_path
=
spack_operation
.
env_path
/
'
spack.lock
'
concretization_file_path
=
spack_operation
.
env_path
/
'
spack.lock
'
assert
file_exists_and_not_empty
(
concretization_file_path
)
==
True
assert
file_exists_and_not_empty
(
concretization_file_path
)
==
True
return
spack_operation
def
test_spack_from_cache_install_1
(
tmp_path
):
def
test_spack_from_cache_install_1
(
tmp_path
):
spack_operation
=
test_spack_from_cache_concretize
(
tmp_path
)
spack_operation
,
concretization_dir
,
buildcache_dir
=
setup
(
tmp_path
)
assert
isinstance
(
spack_operation
,
SpackOperationUseCache
)
spack_operation
.
install_spack
(
bashrc_path
=
str
(
tmp_path
/
Path
(
'
.bashrc
'
)))
spack_operation
.
setup_spack_env
()
num_tags
=
len
(
spack_operation
.
build_cache
.
list_tags
())
concretization_download_file_path
=
concretization_dir
/
'
spack.lock
'
assert
file_exists_and_not_empty
(
concretization_download_file_path
)
==
True
assert
count_files_in_folder
(
buildcache_dir
)
==
num_tags
assert
'
local_cache
'
in
spack_operation
.
mirror_list
()
assert
spack_operation
.
concretize_spack_env
()
==
False
concretization_file_path
=
spack_operation
.
env_path
/
'
spack.lock
'
assert
file_exists_and_not_empty
(
concretization_file_path
)
==
True
install_result
=
spack_operation
.
install_packages
(
jobs
=
2
,
signed
=
True
,
debug
=
False
)
install_result
=
spack_operation
.
install_packages
(
jobs
=
2
,
signed
=
True
,
debug
=
False
)
assert
install_result
.
returncode
==
0
assert
install_result
.
returncode
==
0
check_installed_spack_packages
(
spack_operation
,
tmp_path
)
check_installed_spack_packages
(
spack_operation
,
tmp_path
)
def
test_spack_from_cache_install_2
(
tmp_path
):
def
test_spack_from_cache_install_2
(
tmp_path
):
spack_operation
=
test_spack_from_cache_concretize
(
tmp_path
)
spack_operation
,
concretization_dir
,
buildcache_dir
=
setup
(
tmp_path
)
assert
isinstance
(
spack_operation
,
SpackOperationUseCache
)
spack_operation
.
install_spack
(
bashrc_path
=
str
(
tmp_path
/
Path
(
'
.bashrc
'
)))
spack_operation
.
setup_spack_env
()
num_tags
=
len
(
spack_operation
.
build_cache
.
list_tags
())
concretization_download_file_path
=
concretization_dir
/
'
spack.lock
'
assert
file_exists_and_not_empty
(
concretization_download_file_path
)
==
True
assert
count_files_in_folder
(
buildcache_dir
)
==
num_tags
assert
'
local_cache
'
in
spack_operation
.
mirror_list
()
assert
spack_operation
.
concretize_spack_env
()
==
False
concretization_file_path
=
spack_operation
.
env_path
/
'
spack.lock
'
assert
file_exists_and_not_empty
(
concretization_file_path
)
==
True
install_result
=
spack_operation
.
install_packages
(
jobs
=
2
,
signed
=
True
,
debug
=
False
,
test
=
'
root
'
)
install_result
=
spack_operation
.
install_packages
(
jobs
=
2
,
signed
=
True
,
debug
=
False
,
test
=
'
root
'
)
assert
install_result
.
returncode
==
0
assert
install_result
.
returncode
==
0
check_installed_spack_packages
(
spack_operation
,
tmp_path
)
check_installed_spack_packages
(
spack_operation
,
tmp_path
)
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