test: use multiline regex search helper - #3327
Conversation
Signed-off-by: Dhruv Maniya <dhruvmaniya1998@gmail.com>
|
Hi @iamdhrv! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Hi, thanks for your help. |
|
I have now signed the individual Meta CLA using this GitHub account. The required check may still be propagating; please let me know if any additional action is needed from me. Thank you. |
|
@codex, please review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa79acab3d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| result, _err = run_python_script(cmd) | ||
|
|
||
| assert_regex_match( | ||
| assert_multiline_regex_search( |
There was a problem hiding this comment.
Preserve literal matching for expected log output
When any of these callback cases produces the expected output, this assertion still fails because assert_multiline_regex_search always interprets the entire string as a regex. Literal prefixes such as [HYDRA] and [JOB] become character classes, whereas the removed helper first accepted lines that were exactly equal; for example, searching for [HYDRA] Init custom_callback does not match the identical literal text. The same unescaped prefixes occur in the changed sweep and Hydra-mode tests, so either retain the literal-equality behavior or escape those portions before switching helpers.
Useful? React with 👍 / 👎.
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Thanks. Before we can continue reviewing this PR, please:
Once those changes are pushed and CI is clean, please mark the PR ready for review. |
Change
assert_regex_matchtoassert_multiline_regex_searchWhy
The old helper split both values and ran a separate
re.matchfor every line,which prevented patterns from expressing multiline context and duplicated the
existing multiline search helper. A single normalized
re.search(..., re.MULTILINE)now handles these assertions consistently.Checks
git diff --checkThe focused pytest suite could not start locally because this source checkout
does not contain generated ANTLR parsers and the machine has no Java runtime.
CI's normal parser-generation step remains the authoritative full-suite check.
Fixes #1749