Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mpsd-software-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MPSD Computational Science
mpsd-software-manager
Commits
de972872
Commit
de972872
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
first attempt at adding tests
parent
9533dcc1
No related branches found
No related tags found
1 merge request
!41
Status command
Pipeline
#370481
failed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mpsd-software-environment.py
+2
-1
2 additions, 1 deletion
mpsd-software-environment.py
tests.py
+22
-0
22 additions, 0 deletions
tests.py
with
24 additions
and
1 deletion
mpsd-software-environment.py
+
2
−
1
View file @
de972872
...
...
@@ -843,7 +843,7 @@ def environment_status(mpsd_release, script_dir):
f
"
Release
{
mpsd_release
}
has not been completly installed yet
"
"
, try reinstalling it (spack directory not found)
"
)
return
return
None
# find all folders for all microarch in the release directory
# except for the blacklisted files
black_listed_files
=
[
...
...
@@ -873,6 +873,7 @@ def environment_status(mpsd_release, script_dir):
plog
.
info
(
f
"
-
{
microarch
}
:
\n
\t
{
toolchains
}
"
)
return
toolchain_map
def
main
():
"""
Execute main entry point.
"""
parser
=
argparse
.
ArgumentParser
(
description
=
about_tool
)
...
...
This diff is collapsed.
Click to expand it.
tests.py
+
22
−
0
View file @
de972872
...
...
@@ -424,6 +424,28 @@ def test_create_log_file_names():
assert
build_log_file_name
is
None
def
test_environment_status
(
tmp_path
):
"""
Test that the environment status is correct.
"""
toolchain_map
=
mod
.
environment_status
(
"
fake-release
"
,
tmp_path
)
assert
toolchain_map
is
None
# create a fake environment
mpsd_release
=
"
dev-23a
"
mpsd_microarch
=
"
sandybridge
"
expected_toochain_map
=
{
"
sandybridge
"
:
[
"
foss2021a
"
,
"
intel2021a
"
]}
for
mpsd_release
in
expected_toochain_map
.
keys
():
toolchain_files_path
=
(
tmp_path
/
mpsd_release
/
mpsd_microarch
/
"
lmod
"
/
"
Core
"
/
"
toolchains
"
)
toolchain_files_path
.
mkdir
(
parents
=
True
)
for
toolchain
in
expected_toochain_map
[
mpsd_release
]:
toolchain_file
=
toolchain_files_path
/
f
"
{
toolchain
}
.lua
"
toolchain_file
.
touch
()
# check that the environment status is correct
toolchain_map
=
mod
.
environment_status
(
mpsd_release
,
tmp_path
)
assert
toolchain_map
==
expected_toochain_map
def
test_interface
(
tmp_path
):
"""
Test other things (not implemented yet).
"""
pass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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