test(resource_json): regression coverage for CI export progress logging#259
Draft
cursor[bot] wants to merge 1 commit into
Draft
test(resource_json): regression coverage for CI export progress logging#259cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
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 unit tests for
_supports_live_progressand_ExportProgressReporterinresource_json.py, covering the recent fix whereCI/GITHUB_ACTIONSforce logger-based progress instead of live\rstderr updates (so CI log aggregators andcaplogsee percentage milestones).Type of Change
Package(s) Affected
Risky behavior now covered
CIorGITHUB_ACTIONSis set to a truthy string (true,1,yes, case-normalized),_supports_live_progressreturnsFalseeven if the stream reports a TTY—matching containers where stderr is a pseudo-TTY but logs must not rely on carriage-return UI.CI=true,_ExportProgressReporteruseslogger.infofor milestones and does not write to the progress stream, preventing silent regressions where CI would again lose export progress in logs.Test files added/updated
Libraries/PyKotor/tests/test_resource_json_export_progress.py(new)Why these tests materially reduce regression risk
JSON installation/tree export is a long-running path with high blast radius. If
_supports_live_progressstops honoringCI/GITHUB_ACTIONS, exports would revert to\r-only stderr updates: CI logs and structured log capture would miss progress and failures would be harder to diagnose. The tests pin both the env parsing contract and the reporter’s branch under a fake TTY stream.Testing
Ran from
Libraries/PyKotorwithuv sync --extra dev:uv run pytest --import-mode=importlib --rootdir=/workspace/Libraries/PyKotor -c /dev/null tests/test_resource_json_export_progress.py -v(7 passed)uv run ruff check/ruff format --checkon the new file (clean).Checklist