Skip to content

test: add regressions for case-aware install detection and CI progress reporting#335

Draft
cursor[bot] wants to merge 2 commits into
masterfrom
impl/missing-test-coverage-b8a1
Draft

test: add regressions for case-aware install detection and CI progress reporting#335
cursor[bot] wants to merge 2 commits into
masterfrom
impl/missing-test-coverage-b8a1

Conversation

@cursor

@cursor cursor Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds targeted regression tests for recently merged production changes where coverage was thin and business risk is meaningful.

Risky behavior now covered

  • Case-aware KOTOR install detection (is_kotor_install_dir in diff_tool/cli_utils.py and tslpatcher/diff/engine.py): verifies chitin.key is found even when the install path casing does not match the filesystem (POSIX). Prevents diff/TSLPatcher flows from misclassifying valid installs as plain folders.
  • PowerShell path normalization (normalize_path_arg): covers quote stripping, trailing-slash cleanup, and the mangled-path pattern where a trailing backslash escapes the closing quote in PowerShell.
  • CI-safe JSON export progress (_supports_live_progress / _ExportProgressReporter): locks in the fix from fix(json-export): log progress when automated so CI / GITHUB_ACTIONS force logger-based progress instead of TTY \r updates that bypass log capture.

Test files added/updated

  • Libraries/PyKotor/tests/diff_tool/test_cli_utils.py (new, 11 tests)
  • Libraries/PyKotor/tests/cli/test_resource_json_progress.py (new, 10 tests)

Why these tests materially reduce regression risk

  • Install detection gates core diff and patching workflows; a regression would silently compare folders instead of full game installs.
  • Path normalization bugs surface as "invalid path" failures for common Windows/PowerShell invocations.
  • Progress reporting regressions break CI observability for long installation-to-json exports without failing the command.

Validation

QT_QPA_PLATFORM=offscreen uv run pytest --import-mode=importlib -m "not gui and not slow" \
  Libraries/PyKotor/tests/diff_tool/test_cli_utils.py \
  Libraries/PyKotor/tests/cli/test_resource_json_progress.py

All 21 tests pass on Linux (Python 3.13).

Open in Web View Automation 

cursoragent and others added 2 commits June 12, 2026 10:07
…sions

Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
Co-authored-by: PuritanWizard <th3w1zard1@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Message that will be displayed on users' first pull request

@github-actions github-actions Bot added python Pull requests that update python code libraries size/M Medium PR (100-300 lines) labels Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔨 Build Validation Summary

Version Check: Passed

Tool Builds

⚠️ HoloPatcher: cancelled
⚠️ HoloPazaak: cancelled
⚠️ HolocronToolset: cancelled
⚠️ KotorDiff: cancelled
⚠️ KotorMCP: cancelled


🎉 All builds validated successfully! This PR is ready for merge.

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.

1 participant