Skip to content

test(pykotor): regression coverage for JSON export progress and stream roots#238

Open
cursor[bot] wants to merge 3 commits into
masterfrom
cursor/regression-test-coverage-3a04
Open

test(pykotor): regression coverage for JSON export progress and stream roots#238
cursor[bot] wants to merge 3 commits into
masterfrom
cursor/regression-test-coverage-3a04

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 11, 2026

Description

Adds focused unit and integration tests for resource_json installation export: CI/automation progress logging vs interactive TTY updates, and discovery of stream assets under StreamSounds and StreamWaves/StreamVoice (not only StreamMusic).

Type of Change

  • ✅ Test addition or update

Package(s) Affected

  • PyKotor (core library)

Changes Made

  • New module Libraries/PyKotor/tests/resource/test_resource_json_export_progress.py covering _supports_live_progress, _ExportProgressReporter (zero-total guard, CI bucket logging, TTY \r path), and an end-to-end export fixture that asserts all three stream folder types contribute resources and JSON outputs.

Risky behavior now covered

  • Automation-visible progress: When CI or GITHUB_ACTIONS is set, live stderr \r progress is disabled; percentage milestones must appear on the logger. A regression would silently break log aggregators and the existing CLI test expectations that match 100.00% stream paths.
  • Stream scan completeness: _iter_stream_resources walks streammusic_path, streamsounds_path, and streamvoice_path (K1 StreamWaves / K2 StreamVoice). Missing a root would under-export voice/SFX without failing loudly.

Test files added/updated

  • Added: Libraries/PyKotor/tests/resource/test_resource_json_export_progress.py

Why this reduces regression risk

  • Locks the CI vs TTY branch of _ExportProgressReporter so future refactors cannot drop structured logger.info milestones in automation.
  • Proves multi-folder stream iteration beyond the single-folder case already exercised in test_json_commands.py, catching omissions if iterators or folder resolution changes.

Testing

  • I have added tests that prove my fix is effective or that my feature works
PYTHONPATH=Libraries/PyKotor/src QT_QPA_PLATFORM=offscreen python3 -m pytest \
  --import-mode=importlib -m "not gui and not slow" --timeout=120 \
  Libraries/PyKotor/tests/resource/test_resource_json_export_progress.py -v
# 7 passed (Linux, Python 3.12)

Note: Full uv run workspace sync was not available in this environment (resolution failed on optional kotordiff); tests were run with PYTHONPATH=Libraries/PyKotor/src and minimal PyPI deps (pytest, pytest-timeout, bioware-kaitai-formats, kaitaistruct, defusedxml, ply, loggerplus). CI should run the standard PyKotor pytest job.

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 (new file only, command above)

Related Issues

Related to regression-test coverage automation for recent resource_json export 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 11, 2026
@th3w1zard1 th3w1zard1 marked this pull request as ready for review May 28, 2026 00:39
@th3w1zard1 th3w1zard1 self-requested a review as a code owner May 28, 2026 00:39
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added package: kotordiff Related to KotorDiff package: pykotor Related to PyKotor core labels May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔨 Build Validation Summary

Version Check: Passed

Tool Builds

⚠️ HoloPatcher: cancelled
⚠️ HoloPazaak: 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 package: kotordiff Related to KotorDiff package: pykotor Related to PyKotor core 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