-
Notifications
You must be signed in to change notification settings - Fork 309
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
DAOS-16834 test: tags.py config option #15983
base: master
Are you sure you want to change the base?
Conversation
Add support in tags.py to dump tests associated with tags and/or paths. Add TagSet to handle negative matching. E.g. foo,-bar Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Dalton Bohning <[email protected]>
Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Dalton Bohning <[email protected]>
Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Dalton Bohning <[email protected]>
Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Dalton Bohning <[email protected]>
Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Dalton Bohning <[email protected]>
Add data command line option to tags.py to list test yaml data. Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Phil Henderson <[email protected]>
Ticket title is 'Support running existing tests in MD on SSD stages with two pool variants' |
Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Phil Henderson <[email protected]>
src/tests/ftest/tags.py
Outdated
elif "weekly_regression" in tags: | ||
return "weekly" | ||
return "manual" |
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.
Probably should check if manual is in tags first so this function doesn't make unnecessary assumptions
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.
Fixed, thanks.
Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Phil Henderson <[email protected]>
Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Phil Henderson <[email protected]>
Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Phil Henderson <[email protected]>
Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Phil Henderson <[email protected]>
src/tests/ftest/tags.py
Outdated
"-v", "--verbose", | ||
action='store_true', | ||
help="print verbose output") | ||
|
||
args = parser.parse_args() | ||
args.paths = list(map(os.path.realpath, args.paths)) |
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.
This doesn't work now with the subparsers that don't have paths. E.g.
./src/tests/ftest/tags.py unit
Traceback (most recent call last):
File "/home/dbohning/daos-stack/daos/./src/tests/ftest/tags.py", line 959, in <module>
sys.exit(main())
File "/home/dbohning/daos-stack/daos/./src/tests/ftest/tags.py", line 933, in main
args.paths = list(map(os.path.realpath, args.paths))
AttributeError: 'Namespace' object has no attribute 'paths'
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.
Ah, right. I meant to make that conditional.
Test-tag: always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Phil Henderson <[email protected]>
You'll want to merge in master now that mine is merged |
Test-tag: test_always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Phil Henderson <[email protected]>
src/tests/ftest/tags.py
Outdated
Returns: | ||
list: values found for the key | ||
""" | ||
search = [[self.__data, ["root"]]] |
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.
What is "root" for?
else: | ||
raise ValueError(f"Unhandled command option: {args.command}") |
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.
I get this
./tags.py
Traceback (most recent call last):
File "/home/dbohning/daos-stack/daos/src/tests/ftest/./tags.py", line 960, in <module>
sys.exit(main())
File "/home/dbohning/daos-stack/daos/src/tests/ftest/./tags.py", line 954, in main
raise ValueError(f"Unhandled command option: {args.command}")
ValueError: Unhandled command option: None
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.
Fixed by making subparser 'command' required.
src/tests/ftest/tags.py
Outdated
subparsers = parser.add_subparsers( | ||
title='options for the tags command', | ||
dest='command') |
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 need required=True
since it is required
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.
Yes, thanks.
src/tests/ftest/tags.py
Outdated
Args: | ||
paths (list, optional): paths to files from which to list via their tags. Defaults to all | ||
ftest python files. | ||
list (set, optional): list of sets of tags used to filter displayed tests. Defaults to no |
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.
list (set, optional): list of sets of tags used to filter displayed tests. Defaults to no | |
tags (set, optional): list of sets of tags used to filter displayed tests. Defaults to no |
Typo?
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.
Yes, thanks.
src/tests/ftest/tags.py
Outdated
ftest python files. | ||
list (set, optional): list of sets of tags used to filter displayed tests. Defaults to no | ||
filtering. | ||
list (set, optional): list of sets of test yaml data keys to display. Defaults to None, |
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.
list (set, optional): list of sets of test yaml data keys to display. Defaults to None, | |
keys (set, optional): list of sets of test yaml data keys to display. Defaults to None, |
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.
Thanks.
Test-tag: test_always_passes Skip-unit-tests: true Skip-fault-injection-test: true Signed-off-by: Phil Henderson <[email protected]>
Add config command line option to tags.py to list test yaml data.
Test-tag: always_passes
Skip-unit-tests: true
Skip-fault-injection-test: true
Steps for the author:
After all prior steps are complete: