8000 test(cli): add coverage for maximize/list-solvers/version/managers commands by dominicusin · Pull Request #60 · dominicusin/package-maximizer · GitHub
[go: up one dir, main page]

Skip to content

test(cli): add coverage for maximize/list-solvers/version/managers commands - #60

Merged
dominicusin merged 1 commit into
mainfrom
test/cli-coverage
Sep 1, 2026
Merged

dominicusin merged 1 commit into
mainfrom
test/cli-coverage

Conversation

@dominicusin
Copy link
Copy Markdown
Owner

Summary

  • Added tests for maximize (text, json, unknown manager, conflicts, weights)
  • Added tests for list-solvers command
  • Added tests for version command
  • CLI coverage: 67% → 72%
  • Tests: 500 passed, 2 skipped, 85% total coverage

Test plan

  • 500 passed, 2 skipped
  • Coverage 85%
  • CI green (pending)

…mmands

- Added tests for maximize (text, json, unknown manager, conflicts, weights)
- Added tests for list-solvers command
- Added tests for version command
- CLI coverage: 67% → 72%
- Tests: 500 passed, 2 skipped
@qodo-code-review
Copy link
Copy Markdown

PR Summary by Qodo

Add CLI coverage for maximize, solvers, version, and managers

🧪 Tests 🕐 Less than 10 minutes

Grey Divider

AI Description

• Cover maximize success, JSON, validation, conflict, and weighted execution paths.
• Verify solver listings and version output through Click’s test runner.
• Relax manager-list assertions to stable, representative registry entries.
Diagram

sequenceDiagram
    participant T as CLI Tests
    participant R as Click Runner
    participant C as CLI Commands
    participant M as Package Maximizer
    participant S as Solver Registry
    participant V as Version Metadata
    T->>R: Invoke scenarios
    R->>C: Parse arguments
    alt maximize
        C->>M: Solve packages
        M-->>C: Selected packages
    else list solvers
        C->>S: Read registry
        S-->>C: Solver entries
    else version
        C->>V: Read version
        V-->>C: Version string
    end
    C-->>R: Output or error
    R-->>T: Exit and output
Loading
High-Level Assessment

Direct Click runner tests are appropriate for this targeted coverage increase: they exercise argument parsing, command branching, output formatting, and exit codes without introducing unnecessary mocks. End-to-end root-command tests could complement registration coverage later, but are not a better replacement for these focused scenarios.

Files changed (1) +60 / -1

Tests (1) +60 / -1
test_cli_commands.pyExpand targeted CLI command coverage +60/-1

Expand targeted CLI command coverage

• Imports and exercises maximize, list-solvers, and version commands through Click’s test runner. The new scenarios cover text and JSON results, invalid manager and solver errors, conflicts, weights, registry output, and version output, while removing the list-managers assertion for choco.

tests/test_cli_commands.py

@qodo-code-review
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 describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@dominicusin
dominicusin merged commit 81b4cf2 into main Sep 1, 2026
15 of 16 checks passed
@dominicusin
dominicusin deleted the test/cli-coverage branch September 1, 2026 00:10
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.

1 participant

0