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
8589196c
Commit
8589196c
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
update tests to incorporate new cmd_log_file
parent
e890b612
No related branches found
Branches containing commit
No related tags found
2 merge requests
!37
Update log names and variable names
,
!29
Restructure log location
Pipeline
#370215
failed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests.py
+9
-8
9 additions, 8 deletions
tests.py
with
9 additions
and
8 deletions
tests.py
+
9
−
8
View file @
8589196c
...
...
@@ -164,13 +164,13 @@ def test_setup_log_cmd(tmp_path):
Check that logs/install-software-environment.log is updated when the module is run
"""
log_file
=
"
install.log
"
cmd_
log_file
=
mod
.
config_vars
[
'
cmd_log_file
'
]
script_dir
=
tmp_path
/
"
test_prepare_env
"
mpsd_release_to_test
=
"
dev-23a
"
release_base_dir
=
script_dir
/
mpsd_release_to_test
if
os
.
path
.
exists
(
release_base_dir
/
log_file
):
initial_bytes
=
os
.
path
.
getsize
(
log_file
)
if
os
.
path
.
exists
(
release_base_dir
/
cmd_
log_file
):
initial_bytes
=
os
.
path
.
getsize
(
cmd_
log_file
)
else
:
initial_bytes
=
0
...
...
@@ -179,11 +179,11 @@ def test_setup_log_cmd(tmp_path):
mod
.
prepare_environment
(
mpsd_release
=
mpsd_release_to_test
,
script_dir
=
(
script_dir
))
# check that logs/install-software-environment.log is updated
assert
os
.
path
.
exists
(
release_base_dir
/
log_file
)
assert
os
.
path
.
getsize
(
release_base_dir
/
log_file
)
>
initial_bytes
assert
os
.
path
.
exists
(
release_base_dir
/
cmd_
log_file
)
assert
os
.
path
.
getsize
(
release_base_dir
/
cmd_
log_file
)
>
initial_bytes
# Check that the log file has "Spack environments branch: dev-23a " in the last line
with
open
(
release_base_dir
/
log_file
,
"
r
"
)
as
f
:
with
open
(
release_base_dir
/
cmd_
log_file
,
"
r
"
)
as
f
:
last_line
=
f
.
readlines
()[
-
1
]
assert
"
Spack environments branch: dev-23a
"
in
last_line
...
...
@@ -227,6 +227,7 @@ def test_install_environment_zlib():
script_dir
.
mkdir
(
exist_ok
=
True
,
parents
=
True
)
mpsd_release_to_test
=
"
dev-23a
"
toolchain_to_test
=
"
global_generic
"
cmd_log_file
=
mod
.
config_vars
[
'
cmd_log_file
'
]
mpsd_microarch
=
mod
.
get_native_microarchitecture
()
release_base_dir
=
script_dir
/
mpsd_release_to_test
create_mock_git_repository
(
target_directory
=
script_dir
,
create_directory
=
False
)
...
...
@@ -301,11 +302,11 @@ def test_install_environment_zlib():
os
.
path
.
basename
(
build_log
)
# assert that install log files exists
assert
os
.
path
.
exists
(
release_base_dir
/
"
install.log
"
)
assert
os
.
path
.
exists
(
release_base_dir
/
cmd_log_file
)
# assert that the build log is written to the install log file
os
.
path
.
basename
(
build_log
)
with
open
(
release_base_dir
/
"
install.log
"
,
"
r
"
)
as
f
:
with
open
(
release_base_dir
/
cmd_log_file
,
"
r
"
)
as
f
:
lines
=
f
.
read
()
assert
(
f
"
installing
{
toolchain_to_test
}
and logging at
{
str
(
build_log
)
}
"
in
lines
...
...
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