Skip to content

test(pykotor): regression coverage for JSON export CI progress and GFF_JSON roundtrip#258

Draft
cursor[bot] wants to merge 2 commits into
masterfrom
cursor/regression-test-coverage-f446
Draft

test(pykotor): regression coverage for JSON export CI progress and GFF_JSON roundtrip#258
cursor[bot] wants to merge 2 commits into
masterfrom
cursor/regression-test-coverage-f446

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 17, 2026

Description

Adds focused regression tests for recently merged behavior: installation JSON export progress reporting under CI-like environments, and GFF toolset JSON serialization after the GFFJSONWriter refactor.

Type of Change

  • ✅ Test addition or update

Package(s) Affected

  • PyKotor (core library)

Changes Made

  • Libraries/PyKotor/tests/test_resource_json_progress.py: Asserts _supports_live_progress returns False when CI or GITHUB_ACTIONS is set to common truthy strings, even if the stream reports a TTY, so percentage milestones stay on the logger path (matches the fix in resource_json.py).
  • Libraries/PyKotor/tests/resource/formats/test_gff_json_roundtrip.py: Writes a minimal GFF with bytes_gff(..., ToolsetFormat.GFF_JSON), validates JSON structure, and round-trips through read_gff to guard the write_gffGFFJSONWriter integration.

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

cd /workspace/Libraries/PyKotor && uv run python -m pytest --import-mode=importlib -m "not gui and not slow" \
  tests/test_resource_json_progress.py tests/resource/formats/test_gff_json_roundtrip.py -v
======================== 3 passed in 0.13s ========================

Risky behavior now covered

  • JSON tree export in CI: Prevents regressions where pseudo-TTY stderr would enable live \r progress and drop structured log lines relied on by tests and aggregators.
  • GFF JSON interchange: Ensures GFFJSONWriter output remains valid JSON that read_gff can load, reducing risk of silent breakage in toolset/CLI GFF_JSON paths.

Why this reduces regression risk

Both areas are shared infrastructure with high blast radius (all GFF JSON consumers; installation/CLI JSON export). The tests are deterministic, environment-independent except for explicit monkeypatch of env vars, and assert observable contracts rather than snapshots.

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

Related Issues

Related to regression-test-coverage automation (cron).

Additional Notes

Full-repo uv sync at workspace root may fail on optional kotordiff resolution in this environment; tests were run with uv sync scoped to Libraries/PyKotor only.

Open in Web View Automation 

cursoragent and others added 2 commits May 17, 2026 10:05
Co-authored-by: Boden <th3w1zard1@users.noreply.github.com>
Co-authored-by: Boden <th3w1zard1@users.noreply.github.com>
@github-actions github-actions Bot added python Pull requests that update python code libraries size/S Small PR (30-100 lines) labels May 17, 2026
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/S Small PR (30-100 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant