Skip to content

test: unit tests for CLI pure-logic helpers (decompose, eval) #861

Closed

Description

@planetf1

Unit tests for the pure-logic helpers in the CLI modules that currently have zero test coverage.

Scope

cli/decompose/ (19 tests)

Function What it does Tests
reorder_subtasks() Topological sort of subtask graph by depends_on 6 (no deps, chain, circular, renumbering, invalid deps)
verify_user_variables() Validate input vars exist and deps are valid, trigger reorder 6 (valid, missing var, missing dep, reorder, already sorted, None input)
validate_filename() Safe filename validation (alphanumeric, length) 7 (valid, extension, hyphen, spaces, slash, empty, too long, dot prefix)

cli/eval/ (17 tests)

Function/Class What it does Tests
InputEvalResult.to_dict() Serialize single input result 2 (pass, fail)
TestEvalResult properties passed_count, total_count, pass_rate 5 (count, rate, empty, all pass)
TestEvalResult.to_dict() Serialize full test result with summary 1
parse_judge_output() Extract score/justification from JSON or regex fallback 6 (JSON, embedded JSON, plain text, no score, invalid JSON fallback, zero score)

Not in scope

Area Reason
cli/decompose/pipeline.py Tightly coupled to MelleaSession; needs refactoring for DI
cli/eval/run_evaluations() Same — orchestration loop over real sessions
cli/alora/ Config creation already tested in existing test_alora_train.py; upload/readme_generator are HF Hub I/O
cli/serve/ Already well-tested (5 test files)
cli/fix/ Already excellent coverage (1,864 lines of tests)
cli/m.py 44 lines of Typer wiring, no logic

Total: 36 new tests. Tests are written and passing locally (stashed on test/coverage-gaps-813).

Part of #813. Parent epic: #726.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions