Skip to content

fix(logfiles): report globs matching no files in msg checks - #3571

Merged
mkoura merged 2 commits into
masterfrom
logfiles_check_msgs_fixes
Jul 30, 2026
Merged

fix(logfiles): report globs matching no files in msg checks#3571
mkoura merged 2 commits into
masterfrom
logfiles_check_msgs_fixes

Conversation

@mkoura

@mkoura mkoura commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

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.

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.
@mkoura
mkoura requested a review from saratomaz as a code owner July 30, 2026 10:32
@mkoura
mkoura requested review from Copilot and removed request for saratomaz July 30, 2026 10:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_RE and 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.

Comment thread framework_tests/test_logfiles.py Outdated
Comment thread cardano_node_tests/utils/logfiles.py
The module now covers also the expected messages checks, not just
ignore rules handling.
@mkoura
mkoura merged commit 19b5854 into master Jul 30, 2026
3 checks passed
@mkoura
mkoura deleted the logfiles_check_msgs_fixes branch July 30, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants