Skip to content

Add CLI smoke tests for all subcommands #397

Description

@dreamlessx

Description

Add smoke tests that verify all CLI subcommands parse arguments correctly and produce expected output without requiring GPU or model weights.

Target subcommands

  • python -m landmarkdiff --help — verify exit code 0 and usage text
  • python -m landmarkdiff predict --help — verify procedure/intensity flags shown
  • python -m landmarkdiff serve --help — verify host/port flags shown
  • python -m landmarkdiff evaluate --help — verify metric flags shown
  • python -m landmarkdiff export --help — verify format flags shown

Example test

import subprocess

def test_help_returns_zero():
    result = subprocess.run(
        ["python", "-m", "landmarkdiff", "--help"],
        capture_output=True, text=True,
    )
    assert result.returncode == 0
    assert "usage" in result.stdout.lower()

Motivation

CLI entry points at 61% coverage. Smoke tests are the cheapest way to cover argparse setup code and catch import errors.

Acceptance criteria

  • tests/test_cli_smoke.py created with tests for all subcommands
  • Tests run without GPU/models (help flags only)
  • Tests pass on Python 3.10, 3.11, 3.12

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions