run.py: check for pattern on test's parent dir#2864
Open
inashivb wants to merge 1 commit intoOISF:masterfrom
Open
run.py: check for pattern on test's parent dir#2864inashivb wants to merge 1 commit intoOISF:masterfrom
inashivb wants to merge 1 commit intoOISF:masterfrom
Conversation
catenacyber
reviewed
Jan 16, 2026
Collaborator
|
Thanks for doing this |
In case the test name is not a match for a pattern passed on the
cmdline, also check for it's parent dir. It is no use to make test names
redundant when the dir clubs them under a name but they should all be
able to run if the dir pattern was passed.
Current behavior:
run.py dcerpc # runs all tests that match dcerpc; this leaves some
# tests in dcerpc/ dir that do not have dcerpc in their
# names
With this patch:
run.py dcerpc # first matches the test name with the pattern, if not
# found, checks if its parent dir matches. All dcerpc
# tests grouped under dcerpc/ dir will run
96525be to
c29d881
Compare
catenacyber
reviewed
Jan 23, 2026
| if dirpath == tdir: | ||
| continue | ||
| basename = os.path.basename(dirpath) | ||
| parent = dirpath.replace(tdir, "") |
Collaborator
There was a problem hiding this comment.
Strip prefix dirty like parent = dirpath[len(tdir):] ?
catenacyber
reviewed
Jan 23, 2026
| for pattern in patterns: | ||
| if args.exact: | ||
| if pattern == basename: | ||
| if pattern == parent or pattern == basename: |
Collaborator
There was a problem hiding this comment.
I am not sure we should change the exact logic with parent name
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previous PR: #2858
Changes since v2: