-
-
Notifications
You must be signed in to change notification settings - Fork 28
Introducing version_naming property that makes modulefile as version … #679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+117
−3
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
53e085f
Introducing version_naming property that makes modulefile as version …
AmjadUEA e1996fa
Ran black to format the indenting
AmjadUEA 5d60af3
Adding version_naming test
AmjadUEA 2199f20
Trying to fix the test issue
AmjadUEA 75240b5
Fixing condition for Test
AmjadUEA 4133ee7
Adding in get statement instead of set statement
AmjadUEA 9483d2b
Fixing line 46 replacing set with get
AmjadUEA 5e0b994
Adding in pytest.mark.parametize for disable install testing
AmjadUEA 6a47294
Adding in suggestions from PR review
AmjadUEA cc4be9b
removing the private class variable forgot to cleanup
AmjadUEA a929ac0
Merge branch 'main' into main
Amjadhpc 52ae600
Bump to 0.1.31
Amjadhpc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/usr/bin/python | ||
|
||
# Copyright (C) 2021-2023 Vanessa Sochat. | ||
|
||
# This Source Code Form is subject to the terms of the | ||
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed | ||
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import io | ||
import os | ||
import shutil | ||
|
||
import pytest | ||
|
||
import shpc.main.registry as registry | ||
import shpc.utils | ||
|
||
from .helpers import here, init_client | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"module_sys,module_file,container_tech", | ||
[ | ||
("lmod", "module.lua", "singularity"), | ||
("lmod", "module.lua", "podman"), | ||
("tcl", "module.tcl", "singularity"), | ||
("tcl", "module.tcl", "podman"), | ||
("lmod", "module.lua", "singularity"), | ||
("lmod", "module.lua", "podman"), | ||
("tcl", "module.tcl", "singularity"), | ||
( | ||
"tcl", | ||
"module.tcl", | ||
"podman", | ||
), | ||
], | ||
) | ||
def test_version_naming_install(tmp_path, module_sys, module_file, container_tech): | ||
|
||
""" | ||
Test that version naming install makes module file as version number | ||
""" | ||
client = init_client(str(tmp_path), module_sys, container_tech) | ||
|
||
client.settings.set("version_naming", True) | ||
assert client.settings.get("version_naming") == True | ||
# Install known tag | ||
client.install("python:3.9.2-alpine") | ||
|
||
# Modules folder is created | ||
assert os.path.exists(client.settings.module_base) | ||
|
||
module_dir = os.path.join(client.settings.module_base, "python") | ||
|
||
assert os.path.exists(module_dir) | ||
|
||
module_file = os.path.join(module_dir, "3.9.2-alpine") | ||
|
||
assert os.path.exists(module_file) | ||
|
||
@pytest.mark.parametrize( | ||
"module_sys,module_file,container_tech", | ||
[ | ||
("lmod", "module.lua", "singularity"), | ||
("lmod", "module.lua", "podman"), | ||
("tcl", "module.tcl", "singularity"), | ||
("tcl", "module.tcl", "podman"), | ||
("lmod", "module.lua", "singularity"), | ||
("lmod", "module.lua", "podman"), | ||
("tcl", "module.tcl", "singularity"), | ||
( | ||
"tcl", | ||
"module.tcl", | ||
"podman", | ||
), | ||
], | ||
) | ||
|
||
def test_disabled_version_naming_install( | ||
tmp_path, module_sys, module_file, container_tech | ||
): | ||
|
||
""" | ||
Test that version naming install makes module file as version number | ||
""" | ||
client = init_client(str(tmp_path), module_sys, container_tech) | ||
|
||
client.settings.set("version_naming", False) | ||
assert client.settings.get("version_naming") == False | ||
# Install known tag | ||
client.install("python:3.9.2-alpine") | ||
|
||
# Modules folder is created | ||
assert os.path.exists(client.settings.module_base) | ||
|
||
module_dir = os.path.join(client.settings.module_base, "python", "3.9.2-alpine") | ||
|
||
assert os.path.exists(module_dir) | ||
module_file = os.path.join(module_dir, module_file) | ||
assert os.path.exists(module_file) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.