Skip to content

test: cover case-aware install detection and CI json export progress - #332

Closed
cursor[bot] wants to merge 2 commits into
masterfrom
impl/missing-test-coverage-202e
Closed

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

Conversation

@cursor

@cursor cursor Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds regression tests for recently merged production changes that lacked direct coverage.

Risky behavior now covered

  • Case-aware KOTOR install detection (is_kotor_install_dir in diff_tool/cli_utils, tools/patching, and tslpatcher/diff/engine): verifies chitin.key is found even when directory or key casing differs on case-sensitive filesystems (the behavior introduced in Case-aware application #151).
  • PowerShell path normalization (normalize_path_arg): guards against quote-escape mangling and trailing-slash issues that break diff/CLI path inputs on Windows.
  • JSON export progress in CI (_supports_live_progress / _ExportProgressReporter): ensures automation env vars (CI, GITHUB_ACTIONS) disable live \r stderr updates and route progress through logger output instead (fix from json-export regression).

Test files added/updated

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

Why these tests materially reduce regression risk

Install-directory detection is on the critical path for diff, patch, and CLI workflows; a regression would silently treat valid game roots as invalid. Path normalization bugs are a common Windows support issue. CI progress behavior affects observability in GitHub Actions — live TTY updates bypass structured logging and break caplog-based tests.

Validation

QT_QPA_PLATFORM=offscreen uv run pytest --import-mode=importlib --timeout=120 \
  Libraries/PyKotor/tests/diff_tool/test_cli_utils.py \
  Libraries/PyKotor/tests/cli/test_resource_json_progress.py -v

All 18 tests pass.

Open in Web View Automation 

cursoragent and others added 2 commits June 9, 2026 10:05
…ation

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

github-actions Bot commented Jun 9, 2026

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 9, 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.

@ProjectSynchro
ProjectSynchro deleted the impl/missing-test-coverage-202e branch October 28, 2026 20:25
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