Skip to content

Add Unit Tests for Tool Info, Tool Info Schema, and 7-Zip Builder - #1184

Merged
ptr727 merged 2 commits into
developfrom
feature/coverage-pure-data-tests
Nov 3, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/coverage-pure-data-tests

Conversation

@ptr727

@ptr727 ptr727 commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Adds unit tests for code that only a Windows tool update runs. No Linux unit, integration, or regression run reaches it, so Codecov counts every line of it as missed.

  • MediaToolInfoTests: CompareTo ordering for each field, including case-insensitive file name and version, plus Copy and WriteLine.
  • ToolInfoJsonSchemaTests: the file round trip, the null-document refusal, GetToolInfo by tool family, and Upgrade accepting the current schema and refusing an older one.
  • SevenZipToolTests: the 7-Zip command builder's option order, blank-option skipping, and escaping, the version command, and GetVersion reading the version and file info.

This is phase 6 of the coverage plan on the coverage track (#1171), group A. Measured locally, the four files go from 9 to 128 covered lines. SevenZipTool.cs keeps its bootstrap and update paths uncovered, since they download from the network.

Verification: the .NET Format chain is clean, and the unit suite passes (517 tests). The local strict review ran twice: the first pass raised 4 findings, all fixed, and the second raised none.

🤖 Generated with Claude Code

ptr727 and others added 2 commits November 2, 2026 16:43
Cover MediaToolInfo comparison and copy, the tool info schema round trip
and upgrade refusal, the 7-Zip command builder, and 7-Zip version parsing
with file info. These paths run only during a Windows tool update, so no
Linux unit, integration, or regression run reaches them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 3, 2026 00:47
@ptr727

ptr727 commented Nov 3, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head a0576698529612dfd5f65630e4ead97814a21b35, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9d50d791-258e-4553-9546-63e7832356df
Commits

Reviewing files that changed from the base of the PR and between 85a01c0 and a057669.

Files selected for processing: 3
  • PlexCleanerTests/MediaToolInfoTests.cs
  • PlexCleanerTests/SevenZipToolTests.cs
  • PlexCleanerTests/ToolInfoJsonSchemaTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Cover tool metadata, JSON schema, and 7-Zip command behavior

🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Add unit tests for tool metadata ordering, copying, and logging.
• Cover tool-info JSON round trips, family lookup, and schema-version rejection.
• Verify 7-Zip command construction and version parsing without running downloads.
Diagram

graph TD
  SchemaTests["Schema tests"] --> Schema["JSON schema"] --> Info["Tool info"]
  InfoTests["Info tests"] --> Info
  ZipTests["7-Zip tests"] --> Zip["7-Zip tool"] --> Builder["Command builder"]
  Zip --> Info
  SchemaTests --> InfoTests
Loading
High-Level Assessment

Direct unit tests are appropriate for these deterministic paths and avoid requiring Windows tool updates or network downloads. End-to-end update tests would cover different behavior but would not be a practical substitute for this isolated coverage.

Files changed (3) +264 / -0

Tests (3) +264 / -0
MediaToolInfoTests.csTest tool metadata comparison, copying, and logging +101/-0

Test tool metadata comparison, copying, and logging

• Adds tests for tool type and family initialization, case-insensitive comparison and ordering by each compared field, full-field copying, and the logged prefix and version.

PlexCleanerTests/MediaToolInfoTests.cs

SevenZipToolTests.csTest 7-Zip commands and installed-version parsing +83/-0

Test 7-Zip commands and installed-version parsing

• Checks argument order, blank-option skipping, escaping, and the argument-free version command. A temporary file verifies that version parsing also records file size and modification time.

PlexCleanerTests/SevenZipToolTests.cs

ToolInfoJsonSchemaTests.csTest tool-info persistence, lookup, and schema compatibility +80/-0

Test tool-info persistence, lookup, and schema compatibility

• Covers file serialization round trips, rejection of a null JSON document, tool-family lookup, and acceptance of the current schema versus rejection and error logging for an older version.

PlexCleanerTests/ToolInfoJsonSchemaTests.cs

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active issues are identified, and the change is limited to focused unit tests covering Windows-oriented tool metadata, schema handling, and 7-Zip command construction.

No open issues 🎉

What changed in this PR

Adds focused unit tests for Windows-oriented tool metadata, schema handling, and 7-Zip command construction. The tests improve coverage for logic not exercised by Linux integration or regression runs.

Changes:

  • Added MediaToolInfo tests for construction, comparison, copying, and logging.
  • Added ToolInfoJsonSchema tests for serialization, lookup, null handling, and schema upgrades.
  • Added 7-Zip tests for command construction, option handling, escaping, and version metadata parsing.
File Description
PlexCleanerTests/​ToolInfoJsonSchemaTests.cs Covers schema round trips, tool-family lookup, null rejection, and version upgrades.
PlexCleanerTests/​SevenZipToolTests.cs Covers 7-Zip command construction, option handling, escaping, and installed-tool version metadata parsing.
PlexCleanerTests/​MediaToolInfoTests.cs Covers MediaToolInfo behavior and comparison semantics.

Review effort: Lite

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