Skip to content

[test] add test for cli - #14

Merged
Moenupa merged 1 commit into
mainfrom
test/cli
Aug 31, 2026
Merged

Moenupa merged 1 commit into
mainfrom
test/cli

Conversation

@Moenupa

@Moenupa Moenupa commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Before submitting

Changes

  • add tests to cli.py
  • I updated the tests.
  • I updated documentation.

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.

🟡 Changes recommended

The new tests/cli/conftest.py fixture assigns to console.size, which is read-only in Rich and will raise AttributeError, breaking the CLI tests.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds end-to-end CLI tests under tests/cli/ to validate the prep and ppls Typer commands via in-process CliRunner invocations, asserting exact (snapshot-style) output.

Changes:

  • Added snapshot-style stdout tests for multiple prep target formats (show, sft, verl, eval, cls) and a clip fallback failure case.
  • Added snapshot-style tests for ppls (--list-format and table output).
  • Introduced shared CLI test fixtures to isolate environment variables and normalize Rich rendering.
File summaries
File Description
tests/cli/conftest.py Adds shared fixtures for CLI invocation and stdout snapshot assertions; attempts to normalize Rich output width.
tests/cli/test_clip.py Adds CLI test for prep clip fallback behavior and expected failure.
tests/cli/test_cls.py Adds slow CLI test for prep cls on CIFAR-10 with expected stdout snapshot.
tests/cli/test_eval.py Adds CLI test for prep eval with expected stdout snapshot.
tests/cli/test_ppls.py Adds CLI tests for ppls --list-format and ppls table output snapshots.
tests/cli/test_sft.py Adds CLI test for prep sft with expected stdout snapshot.
tests/cli/test_show.py Adds CLI test for prep show with expected stdout snapshot.
tests/cli/test_verl.py Adds CLI test for prep verl with expected stdout snapshot and custom --q-template.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/cli/conftest.py
if isinstance(handler, RichHandler):
console = handler.console
prev_size = (console._width, console._height)
console.size = (120, 25)
@Moenupa
Moenupa merged commit 4832030 into main Aug 31, 2026
5 checks passed
@Moenupa
Moenupa deleted the test/cli branch August 31, 2026 04:29
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