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
!82
Remove cmd
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Remove cmd
continue-with-remove-cmd
into
main
Overview
21
Commits
34
Pipelines
18
Changes
1
Merged
Ashwin Kumar Karnad
requested to merge
continue-with-remove-cmd
into
main
1 year ago
Overview
4
Commits
34
Pipelines
18
Changes
1
Expand
0
0
Merge request reports
Viewing commit
019c7cf1
Show latest version
1 file
+
44
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
019c7cf1
add test_remove_global_package_sets
· 019c7cf1
Ashwin Kumar Karnad
authored
1 year ago
tests/test_mpsd_software.py
+
44
−
1
Options
@@ -249,7 +249,7 @@ def test_install_environment_zlib():
with
open
(
package_set_src_dir
/
"
global_generic
"
/
"
global_packages.list
"
,
"
w
"
)
as
f
:
f
.
write
(
"
zlib@1.2.13
\n
"
)
f
.
write
(
"
zlib@1.2.13
\n
zstd@1.5.2
\n
"
)
# add zlib to whitelist of module creation file by replacing anaconda3%gcc@10.2.1
# with zlib@1.2.13
@@ -772,6 +772,49 @@ def test_remove_package_sets(tmp_path, simple_toolchain):
)
def
test_remove_global_package_sets
():
"""
Test removal of global package_sets via spack.
"""
root_dir
=
Path
(
"
/tmp/test_global_generic
"
)
if
not
root_dir
.
exists
():
# we need the sample spack instance with global_generic
# this is already done in test_install_environment_zlib
# so we just need to call it
test_install_environment_zlib
()
# check that zlib and zstd are installed
spack_dir
=
root_dir
/
"
dev-23a
"
/
mod
.
get_native_microarchitecture
()
/
"
spack
"
source_spack
=
(
f
"
export SPACK_DIR=
{
spack_dir
}
&&
"
f
'
.
{
spack_dir
/
"
share
"
/
"
spack
"
/
"
setup-env.sh
"
}
'
)
# check that zlib is installed
# location commands exits with non zero if not installed thus
# breaking failing test
mod
.
run
(
f
"
{
source_spack
}
&& spack location -i zlib
"
,
shell
=
True
,
check
=
True
)
# check that zstd is installed
mod
.
run
(
f
"
{
source_spack
}
&& spack location -i zstd
"
,
shell
=
True
,
check
=
True
)
# remove global_generic
mod
.
remove_environment
(
mpsd_release
=
"
dev-23a
"
,
root_dir
=
root_dir
,
package_sets
=
[
"
global_generic
"
],
force_remove
=
True
,
)
# check that zstd@1.5 is not installed
# we are here flipping the exit code to check that it is not installed
mod
.
run
(
f
"
{
source_spack
}
&& (spack location -i zstd && exit 1 || exit 0 )
"
,
shell
=
True
,
check
=
True
,
)
# check that zlib is not installed
mod
.
run
(
f
"
{
source_spack
}
&& (spack location -i zlib && exit 1 || exit 0 )
"
,
shell
=
True
,
check
=
True
,
)
def
test_interface
(
tmp_path
):
"""
Test other things (not implemented yet).
"""
pass
Loading