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
f9ee635e
Commit
f9ee635e
authored
1 year ago
by
Hans Fangohr
Browse files
Options
Downloads
Patches
Plain Diff
make pydocstyle pass
parent
28a8d969
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!19
Move linux-debian11 into main
,
!15
Include Pydocstyle into CI
Pipeline
#368457
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests.py
+21
-11
21 additions, 11 deletions
tests.py
with
21 additions
and
11 deletions
tests.py
+
21
−
11
View file @
f9ee635e
"""
Tests for mpsd-software-environment.py.
"""
import
importlib
import
os
import
shutil
...
...
@@ -10,7 +12,7 @@ mod = importlib.import_module("mpsd-software-environment")
def
test_os_chdir
(
tmp_path
):
# c
reate a temporary directory for testing
"""
C
reate a temporary directory for testing
.
"""
temp_dir
=
tmp_path
/
"
test_os_chdir
"
temp_dir
.
mkdir
()
...
...
@@ -26,11 +28,13 @@ def test_os_chdir(tmp_path):
def
test_prepare_environment
(
tmp_path
):
# simulate running ./install-software-environment.py --release dev-23a \
# --target-directory /tmp/test_prepare_env
# prepare_env is run when cmd is not specified, we can test cmd='prepare'
# and cmd=None to check both cases
"""
Simulate running preparation of environment.
Simulate running ./install-software-environment.py --release dev-23a
\
--target-directory /tmp/test_prepare_env
prepare_env is run when cmd is not specified, we can test cmd=
'
prepare
'
and cmd=None to check both cases
"""
script_dir
=
tmp_path
/
"
test_prepare_env
"
spack_environments
=
"
spack-environments
"
mpsd_release_to_test
=
"
dev-23a
"
...
...
@@ -71,7 +75,10 @@ def test_prepare_environment(tmp_path):
def
test_setup_log_cmd
(
tmp_path
):
# check that logs/install-software-environment.log is updated when the module is run
"""
Check that log is updated.
Check that logs/install-software-environment.log is updated when the module is run
"""
log_file
=
"
install.log
"
script_dir
=
tmp_path
/
"
test_prepare_env
"
...
...
@@ -96,11 +103,13 @@ def test_setup_log_cmd(tmp_path):
def
test_install_environment
(
tmp_path
):
# Test the installation part
# This is a long test, its handy to test this with print statements printed to
# stdout, use:
# pytest -s
# Expect an Exception when wrong toolchains are provided
"""
Test the installation of a toolchain.
This is a long test, its handy to test this with print statements printed to
stdout, use:
pytest -s
Expect an Exception when wrong toolchains are provided
"""
with
pytest
.
raises
(
Exception
):
mod
.
install_environment
(
mpsd_release
=
"
dev-23a
"
,
...
...
@@ -213,6 +222,7 @@ def test_install_environment(tmp_path):
def
test_interface
(
tmp_path
):
"""
Test other things (not implemented yet).
"""
pass
# ensure that installing without toolchains only passes the available toolchains
# check that the script branch and hash are correct when running the script
...
...
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