-
Notifications
You must be signed in to change notification settings - Fork 304
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
CART-831 TEST: add support for arbitrary envariables in yaml files #4445
Merged
Merged
Changes from 5 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
44bd102
CART-831 tests: Add special other_env_vars param
mallove79 d102ccb
CART-831 tests: Use Yaml array syntax
mallove79 cc9d127
CART-831 tests: Fix pylint messages
mallove79 3de71a5
CART-831 tests: Resolve pylint warnings
mallove79 cf43b31
CART-831 tests: Method can be a function
mallove79 ef8c5fe
CART-831 tests: Add set_other_env_vars test
mallove79 9430ca3
CART-831 tests: main() is not needed
mallove79 7cecc44
CART-831 tests: Put all env vars in one yaml param
mallove79 578b9c5
Merge branch 'master' of https://github.com/daos-stack/daos into emal…
mallove79 862cfde
CART-831 tests: Merge master. Rerun CI tests.
mallove79 e2f522d
CART-831 tests: Protect against null env vars
mallove79 e1f9f3c
CART-831 tests: Remove set_other_env_vars script
mallove79 6cc1e12
CART-654 tests: Artifact archival issue? Re-try.
mallove79 589f7e9
Merge branch 'master' of https://github.com/daos-stack/daos into emal…
mallove79 7910a54
CART-831 tests: merge w/ master, and re-run.
mallove79 7636910
Merge branch 'master' of https://github.com/daos-stack/daos into emal…
mallove79 5bc5d57
CART-831 tests: Merge w/ master. Re-run.
mallove79 0c9c262
CART-831 tests: orterun CLI vars default to None
mallove79 966b445
Merge branch 'master' of https://github.com/daos-stack/daos into emal…
mallove79 502210c
CART-831 tests: Merge w/ master. Re-run.
mallove79 fd6637a
CART-831 tests: Oops -- missing "import os"
mallove79 2e2ffda
CART-831 tests: no camelCase, no aligning on '='
mallove79 8588d5e
CART-831 tests: pylint dislikes visual (=) align
mallove79 69f6b9e
CART-831 tests: Pylint dislikes os.environ["F"]
mallove79 903c4a5
CART-831 tests: pass_env needn't be class member
mallove79 5c75a2e
CART-831 tests: Adjust skip- pragmas
mallove79 25412f9
CART-831 tests: Remove unneeded YAML file
mallove79 a614036
CART-831 tests: Remove unhelpful print statements
mallove79 4a76526
Merge branch 'master' of https://github.com/daos-stack/daos into emal…
mallove79 f5dcccb
Merge branch 'master' of https://github.com/daos-stack/daos into emal…
mallove79 09adc5d
CART-831 tests: Check for dict key existence
mallove79 5f04779
Merge branch 'master' of https://github.com/daos-stack/daos into emal…
mallove79 86294b4
CART-831 tests: No more args to super in python 3
mallove79 28b66cd
CART-831 tests: python 3 super doesn't need args
mallove79 28f106d
CART-831 tests: Fix python indentation for pylint
mallove79 db256a9
Merge branch 'master' of https://github.com/daos-stack/daos into emal…
mallove79 2094671
CART-831 tests: Revert to python 2 super()
mallove79 7bccab9
CART-831 tests: Stringify all keys/vals in dict
mallove79 8cdc8a9
CART-654 tests: Supprese Pytnon 3 pylint messages
mallove79 286521a
CART-831 tests: params.get now returns OrderedDict
mallove79 b780fb8
CART-831 tests: Call super(.setUp) in py scripts
mallove79 44c9acd
CART-831 tests: Fix pylint indentation issues
mallove79 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 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 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 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 |
---|---|---|
|
@@ -105,6 +105,34 @@ def stop_process(proc): | |
|
||
return procrtn | ||
|
||
@staticmethod | ||
def set_other_env_vars(cartobj): | ||
""" import env vars from other_env_var param """ | ||
other_env_vars = cartobj.params.get("other_env_vars", | ||
"/run/defaultENV/") | ||
if other_env_vars is None: | ||
print("other_env_vars was not set in yaml file.\n") | ||
return | ||
|
||
for kv_pair in other_env_vars: | ||
key, value = kv_pair[0] | ||
print("Adding {}={} to environment.\n".format(key, value)) | ||
os.environ[key] = value | ||
|
||
@staticmethod | ||
def unset_other_env_vars(cartobj): | ||
""" import env vars from other_env_var param """ | ||
other_env_vars = cartobj.params.get("other_env_vars", | ||
"/run/defaultENV/") | ||
if other_env_vars is None: | ||
print("other_env_vars was not set in yaml file.\n") | ||
return | ||
|
||
for kv_pair in other_env_vars: | ||
key = kv_pair[0][0] | ||
print("Removing key {} from environment.\n".format(key)) | ||
del os.environ[key] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure i see the purpose of this function |
||
|
||
# What is special about pylint's 15 variable limit? | ||
# pylint: disable=too-many-locals | ||
def get_env(self, cartobj): | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to make it so that every cart test automatically calls this without having to do anything extra