fix(logfiles): report globs matching no files in msg checks - #3571
Merged
Conversation
In check_msgs_presence_in_logs: * Match the rotated-log regex against the file name instead of the whole path. A parent directory with a dot followed by digits (e.g. "build.123") made every log file look rotated, so all files were skipped and the check silently passed. * Report an error when a glob matches no log file instead of silently passing (e.g. on a typo in the glob). * Anchor ROTATED_RE so that a live log file with dots and digits in its name (e.g. "node-1.2.stdout") is not misdetected as rotated. Add unit tests covering the fixed behavior, search through rotated log files and seek offset handling.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes false-positive “rotated log” detection in check_msgs_presence_in_logs and makes log-message presence checks fail loudly when a file glob matches no logs, preventing silent passes due to path quirks or glob typos.
Changes:
- Anchor
ROTATED_REand match it against the basename (not the full path) to avoid skipping live logs due to dotted parent directories. - Treat “glob matched zero (non-rotated) files” as an explicit error condition.
- Add unit tests covering: no files matched, dotted parent dirs, rotated vs live filename handling, rotated-log traversal, and seek-offset behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| framework_tests/test_logfiles.py | Adds unit tests for check_msgs_presence_in_logs behavior (glob matching, rotation handling, rotated traversal, seek offsets). |
| cardano_node_tests/utils/logfiles.py | Fixes rotated-log detection and makes “no matched files” a reported error for message-presence checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The module now covers also the expected messages checks, not just ignore rules handling.
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.
In check_msgs_presence_in_logs:
Add unit tests covering the fixed behavior, search through rotated log files and seek offset handling.