Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

kmsg: unit tests to cover kernel record parsing and terminal output - #5304

Open
Sunil Muthuswamy (sunilmut) wants to merge 4 commits into
microsoft:mainfrom
sunilmut:user/sunilmut/unit-tests-kmsg-158
Open

Sunil Muthuswamy (sunilmut) wants to merge 4 commits into
microsoft:mainfrom
sunilmut:user/sunilmut/unit-tests-kmsg-158

Conversation

@sunilmut

@sunilmut Sunil Muthuswamy (sunilmut) commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Test cases informed by actual logging consumers.

Add unit tests for:

  • Verify malformed headers, record flags and metadata parsing.
  • Cover escaped bytes and microsecond timestamp boundaries.
  • Verify terminal output for each severity level.

Before: coverage unavailable because the baseline had no tests.
After: Linux x64 all-features coverage 93.60% (117/125 production lines)

Test changes only; no product code changes.

Test cases informed by actual logging consumers.

- Verify malformed headers, record flags and metadata parsing.
- Cover escaped bytes and microsecond timestamp boundaries.
- Verify terminal output for each severity level.

Before: coverage unavailable because the baseline had no tests.
After: Linux x64 all-features coverage 93.60% (117/125 production lines)

Test changes only; no product code changes.
@sunilmut
Sunil Muthuswamy (sunilmut) requested a review from a team as a code owner November 27, 2026 08:22
Copilot AI balanced review requested due to automatic review settings November 27, 2026 08:22

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.

🟢 Approval recommended

There are no active review issues for the kmsg test additions and development dependency change.

No open issues 🎉

What changed in this PR

Adds unit tests for the kmsg crate’s kernel-log and serial-console parsing and terminal formatting. Production code is unchanged.

Changes:

  • Covers extended records, metadata, escaped bytes, and malformed headers.
  • Checks microsecond timestamps and terminal colors for all severity levels.
  • Adds the workspace tracing helper as a test dependency.
File Description
support/​kmsg/​src/​lib.rs Adds parsing, validation, and terminal-output tests.
support/​kmsg/​Cargo.toml Adds test_with_tracing as a development dependency.
Cargo.lock Records the new test dependency for kmsg.

Review effort: Balanced

@sunilmut Sunil Muthuswamy (sunilmut) changed the title kmsg: cover kernel record parsing and terminal output kmsg: unit tests to cover kernel record parsing and terminal output Nov 27, 2026
Copilot AI balanced review requested due to automatic review settings November 30, 2026 18:19

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.

🟢 Approval recommended

There are no active review issues with the added kernel-log parsing and terminal-formatting tests.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 1, 2026 04:20

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.

🟢 Approval recommended

No active review issues block the test-only additions to kmsg parsing and formatting coverage.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 1, 2026 18:03

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.

🟢 Approval recommended

No active review issues block the added kernel-record parsing and terminal-formatting tests.

No open issues 🎉

Review effort: Balanced

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.

4 participants