Skip to content

test(cli): indoor-kit-migrate v1-to-v2 CLI regression coverage#234

Merged
th3w1zard1 merged 1 commit into
masterfrom
cursor/missing-test-coverage-8374
May 9, 2026
Merged

test(cli): indoor-kit-migrate v1-to-v2 CLI regression coverage#234
th3w1zard1 merged 1 commit into
masterfrom
cursor/missing-test-coverage-8374

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 6, 2026

Description

Adds focused cli_main tests for the indoor-kit-migrate-v1-to-v2 command: successful v1→v2 migration (including nested doorhooks), and failure paths (missing input, invalid JSON, already v2, empty kit id). This closes the gap between library migration tests (migrate_kit_json_v1_to_v2 in test_tilekit_v2.py) and the CLI entrypoint in dispatch.py / commands/indoor_kit_migrate.py.

Type of Change

  • ✅ Test addition or update

Package(s) Affected

  • PyKotor (core library)

Changes Made

  • New file: Libraries/PyKotor/tests/cli/test_indoor_kit_migrate_cli.py — five deterministic tests using tmp_path only.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Test Results

QT_QPA_PLATFORM=offscreen uv run pytest --import-mode=importlib -m "not gui and not slow" tests/cli/test_indoor_kit_migrate_cli.py -v --rootdir=/workspace/Libraries/PyKotor -c /dev/null
# 5 passed

Risky behavior now covered

  • Dispatch + CLI: cli_main([...]) for indoor-kit-migrate-v1-to-v2 ensures the subcommand stays wired in dispatch.py.
  • I/O and validation: Missing file, malformed JSON, double-migrate (format_version 2), and invalid v1 metadata (empty id) all return exit code 1 without writing partial output.
  • Migration fidelity (smoke): Output JSON has format_version: 2, preserved id, and floor templates with hooks copied from v1 components.

Why this reduces regression risk

The migrate command is the supported path for authors moving legacy kit JSON to tile templates; silent wiring breaks or swallowed errors would break modding workflows. These tests fail fast on regressions in argument parsing, dispatch routing, or error handling without requiring a game installation or slow integration fixtures.

Related Issues

Related to coverage automation / missing CLI tests for recently merged indoor tooling.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes
Open in Web View Automation 

Co-authored-by: Boden <th3w1zard1@users.noreply.github.com>
@github-actions github-actions Bot added python Pull requests that update python code libraries size/M Medium PR (100-300 lines) labels May 6, 2026
@th3w1zard1 th3w1zard1 marked this pull request as ready for review May 9, 2026 03:37
@th3w1zard1 th3w1zard1 self-requested a review as a code owner May 9, 2026 03:37
@th3w1zard1 th3w1zard1 merged commit 67762b5 into master May 9, 2026
30 of 43 checks passed
@th3w1zard1 th3w1zard1 deleted the cursor/missing-test-coverage-8374 branch May 9, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries python Pull requests that update python code size/M Medium PR (100-300 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants