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
1
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
aa13e8ee
Commit
aa13e8ee
authored
2 months ago
by
Jithu Murugan
Browse files
Options
Downloads
Patches
Plain Diff
- Corrected the failing unit tests and minor refactorings.
parent
5e4b78f9
No related branches found
No related tags found
1 merge request
!4
feat(spack_operation): implement setup_spack_env functionality
Pipeline
#59543
canceled with stages
in 20 minutes and 29 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dedal/tests/unit_tests/test_build_cache_manager.py
+7
-3
7 additions, 3 deletions
dedal/tests/unit_tests/test_build_cache_manager.py
dedal/tests/unit_tests/test_spack_operation_use_cache.py
+1
-3
1 addition, 3 deletions
dedal/tests/unit_tests/test_spack_operation_use_cache.py
with
8 additions
and
6 deletions
dedal/tests/unit_tests/test_build_cache_manager.py
+
7
−
3
View file @
aa13e8ee
...
...
@@ -60,12 +60,16 @@ class TestBuildCacheManager:
result
=
mock_build_cache_manager
.
get_public_key_from_cache
(
str
(
build_cache_dir
))
# Assert
# Cannot assure the order in which the OS returns the files,
# hence check if the result is in the expected list
assert
result
in
[
str
(
build_cache_dir
/
"
project0
"
/
"
_pgp
"
/
"
key0.pub
"
),
str
(
build_cache_dir
/
"
project0
"
/
"
_pgp
"
/
"
key1.pub
"
),
str
(
build_cache_dir
/
"
project1
"
/
"
_pgp
"
/
"
key0.pub
"
)]
log
=
(
expected_log_message
,
pgp_folders
,
pgp_folders
[
0
])
if
test_id
==
"
more_than_one_gpg_folder
"
else
(
expected_log_message
,
key_files
,
key_files
[
0
])
mock_build_cache_manager
.
_logger
.
warning
.
assert_called_once_with
(
*
log
)
assert
mock_build_cache_manager
.
_logger
.
warning
.
call_args
[
0
][
0
]
==
expected_log_message
assert
set
(
mock_build_cache_manager
.
_logger
.
warning
.
call_args
[
0
][
1
])
==
set
(
pgp_folders
)
if
test_id
==
"
more_than_one_gpg_folder
"
else
set
(
key_files
)
assert
mock_build_cache_manager
.
_logger
.
warning
.
call_args
[
0
][
2
]
in
pgp_folders
if
test_id
==
"
more_than_one_gpg_folder
"
else
key_files
@pytest.mark.parametrize
(
"
build_cache_dir, expected_log_message
"
,
[
(
None
,
'
Build cache directory does not exist!
'
),
...
...
This diff is collapsed.
Click to expand it.
dedal/tests/unit_tests/test_spack_operation_use_cache.py
+
1
−
3
View file @
aa13e8ee
...
...
@@ -5,12 +5,10 @@
# Description: Brief description of the file.
# Created by: Murugan, Jithu <j.murugan@fz-juelich.de>
# Created on: 2025-02-20
import
logging
from
pathlib
import
Path
import
pytest
from
dedal.commands.command_runner
import
CommandRunner
from
dedal.error_handling.exceptions
import
NoSpackEnvironmentException
from
dedal.spack_factory.SpackOperationUseCache
import
SpackOperationUseCache
...
...
@@ -51,7 +49,7 @@ class TestSpackOperationUseCache:
spack_operation_use_cache_mock
.
build_cache
.
download
.
assert_called_once_with
(
spack_operation_use_cache_mock
.
spack_config
.
buildcache_dir
)
spack_operation_use_cache_mock
.
build_cache
.
get_public_key_from_cache
.
assert_called_once_with
(
spack_operation_use_cache_mock
.
spack_config
.
buildcache_dir
)
str
(
spack_operation_use_cache_mock
.
spack_config
.
buildcache_dir
)
)
if
key_path
:
spack_operation_use_cache_mock
.
trust_gpg_key
.
assert_called_once_with
(
key_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