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
6013d566
Commit
6013d566
authored
1 year ago
by
Ashwin Kumar Karnad
Browse files
Options
Downloads
Patches
Plain Diff
add test_remove_global_package_sets
parent
99b2b5a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!82
Remove cmd
Pipeline
#384203
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_mpsd_software.py
+44
-1
44 additions, 1 deletion
tests/test_mpsd_software.py
with
44 additions
and
1 deletion
tests/test_mpsd_software.py
+
44
−
1
View file @
6013d566
...
...
@@ -257,7 +257,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
...
...
@@ -791,6 +791,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
...
...
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