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
Merge requests
!17
split one test into three
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
split one test into three
split-installation-tests
into
force-checking-of-error-code
Overview
3
Commits
24
Pipelines
10
Changes
1
Merged
Hans Fangohr
requested to merge
split-installation-tests
into
force-checking-of-error-code
1 year ago
Overview
3
Commits
24
Pipelines
10
Changes
1
Expand
(I am trying to debug the third one on the Mac, and this makes it easier.)
0
0
Merge request reports
Viewing commit
94be2c00
Prev
Next
Show latest version
1 file
+
19
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
94be2c00
create git repo to reflect execution in production environment
· 94be2c00
Hans Fangohr
authored
1 year ago
tests.py
+
19
−
0
Options
@@ -43,6 +43,25 @@ def test_prepare_environment(tmp_path):
# check that the test directory does not exist
assert
not
script_dir
.
exists
()
# prepare_environment expects to be executed in git repository
# (mpsd-software-environments). It queries the commit on which we are to
# log that information. For this to work, we need to execute the command
# within a directory tree that has a git repository at the same or high
# level. Let's create one:
# create directory first
script_dir
.
mkdir
(
parents
=
True
)
# then create git repository:
with
mod
.
os_chdir
(
str
(
script_dir
)):
subprocess
.
run
(
"
git init .
"
,
shell
=
True
,
check
=
True
)
subprocess
.
run
(
"
echo
'
fake content
'
> readme.txt
"
,
shell
=
True
,
check
=
True
)
subprocess
.
run
(
"
git add readme.txt
"
,
shell
=
True
,
check
=
True
)
subprocess
.
run
(
"
pwd
"
,
shell
=
True
)
subprocess
.
run
(
'
git commit -m
"
first commit
"
readme.txt
'
,
shell
=
True
,
check
=
True
)
# now call the function we want to test
result
=
mod
.
prepare_environment
(
mpsd_release
=
mpsd_release_to_test
,
script_dir
=
(
script_dir
)
)
Loading