test(pykotor): regression coverage for JSON export CI progress and archive plaintext#263
Draft
cursor[bot] wants to merge 1 commit into
Draft
test(pykotor): regression coverage for JSON export CI progress and archive plaintext#263cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…lper Co-authored-by: Boden <th3w1zard1@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds focused regression tests around recently merged JSON export and archive serialization behavior.
Type of Change
Package(s) Affected
Risky behavior now covered
_supports_live_progress/_ExportProgressReporter(commitc7e573d1d)In CI or GitHub Actions, stderr can still look like a TTY, so the exporter must not use carriage-return live progress (which bypasses structured logging). New tests assert
CI/GITHUB_ACTIONSforce the non-TTY path, and that progress is emitted vialogger.infoso log capture and aggregators see percentage milestones while a hostile fake stream would fail if written to._resource_bytes_to_plaintext(restored ina7ee07bc5)When embedded serialization cannot produce structured or plaintext output and falls back to base64, the helper must return
Noneso callers can distinguish “no plaintext embedding” from a real payload. Covered with non-text binary WAV bytes.Test files added/updated
Libraries/PyKotor/tests/cli/test_json_commands.pyLibraries/PyKotor/tests/resource/formats/test_archive_serializer_regressions.pyWhy these tests materially reduce regression risk
\r-only updates breaks observability and downstream tooling._resource_bytes_to_plaintextfor readable ERF/RIM/BIF dumps; returningNonevs a payload is a contract for whetherembed_plaintextcan inline content—wrong behavior silently bloats JSON or drops readability.Testing
Ran (scoped):
PYTHONPATH=Libraries/PyKotor/src python3 -m pytest --import-mode=importlib -m "not gui and not slow" --timeout=120on the four new test nodes; all passed.Test Results
Checklist
Related Issues
N/A (cron coverage automation)
Additional Notes
Full
uv runsync was not available in this environment (workspace resolution for optional packages); verification usedPYTHONPATH=Libraries/PyKotor/srcwith pip-installed pytest and core PyKotor dependencies, matching the exercised code paths.