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
5145b063
Commit
5145b063
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
fix typo and tests
parent
790ea004
No related branches found
No related tags found
2 merge requests
!39
Split logfile templates usage
,
!29
Restructure log location
Pipeline
#370250
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
+1
-0
1 addition, 0 deletions
mpsd-software-environment.py
tests.py
+16
-21
16 additions, 21 deletions
tests.py
with
17 additions
and
21 deletions
mpsd-software-environment.py
+
1
−
0
View file @
5145b063
...
...
@@ -101,6 +101,7 @@ def create_log_file_names(
log_template
=
config_vars
[
"
installer_log_template
"
]
return
log_template
.
substitute
(
mpsd_release
=
mpsd_release
,
mpsd_microarch
=
mpsd_microarch
,
date
=
date
,
action
=
action
,
...
...
This diff is collapsed.
Click to expand it.
tests.py
+
16
−
21
View file @
5145b063
...
...
@@ -383,51 +383,46 @@ def test_metadata_logging(tmp_path):
assert
len
(
read_dict
)
==
len
(
keys
)
@pytest.mark.skip
(
reason
=
"
This function is redundant in the next version of the script.
"
)
def
test_create_log_file_names
():
"""
Test that the log file names are created correctly.
"""
pass
create_log_file_names
=
mod
.
create_log_file_names
mpsd_release
=
"
dev-23a
"
mpsd_microarch
=
"
sandybridge
"
date
=
datetime
.
datetime
.
now
().
replace
(
microsecond
=
0
).
isoformat
()
action
=
"
install
"
toolchain
=
"
foss2021a
"
# test
for correct action and toolchai
n
installer_log_file
,
build_log_file
=
create_log_file_names
(
# test
build_log_file_name generatio
n
build_log_file
_name
=
create_log_file_names
(
mpsd_microarch
=
mpsd_microarch
,
mpsd_release
=
mpsd_release
,
date
=
date
,
action
=
action
,
toolchain
=
toolchain
,
)
assert
installer_log_file
==
f
"
{
mpsd_release
}
_
{
mpsd_microarch
}
_
{
date
}
_
{
action
}
.log
"
assert
(
build_log_file
==
f
"
{
mpsd_release
}
_
{
mpsd_microarch
}
_
{
date
}
_
{
toolchain
}
_
{
action
}
.log
"
build_log_file
_name
==
f
"
{
mpsd_release
}
_
{
mpsd_microarch
}
_
{
date
}
_
BUILD_
{
toolchain
}
_
{
action
}
.log
"
)
# test no build log file for incorrect action
installer_log_file
,
build_log_file
=
create_log_file_names
(
installer_log_file_name
=
create_log_file_names
(
mpsd_microarch
=
mpsd_microarch
,
mpsd_release
=
mpsd_release
,
date
=
date
,
action
=
"
status
"
,
toolchain
=
toolchain
,
action
=
action
,
)
assert
installer_log_file
==
f
"
{
mpsd_release
}
_
{
mpsd_microarch
}
_
{
date
}
_status.log
"
assert
build_log_file
is
None
# test no build log file for incorrect toolchain
installer_log_file
,
build_log_file
=
create_log_file_names
(
assert
(
installer_log_file_name
==
f
"
{
mpsd_release
}
_
{
mpsd_microarch
}
_
{
date
}
_APEX_
{
action
}
.log
"
)
# test no build log file for incorrect action
build_log_file_name
=
create_log_file_names
(
mpsd_microarch
=
mpsd_microarch
,
mpsd_release
=
mpsd_release
,
date
=
date
,
action
=
"
reinstall
"
,
toolchain
=
None
,
action
=
"
status
"
,
toolchain
=
toolchain
,
)
assert
installer_log_file
==
f
"
{
mpsd_release
}
_
{
mpsd_microarch
}
_
{
date
}
_reinstall.log
"
assert
build_log_file
is
None
assert
build_log_file_name
is
None
def
test_interface
(
tmp_path
):
...
...
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