test(resource-json): regression coverage for CI JSON export progress#265
Draft
cursor[bot] wants to merge 1 commit into
Draft
test(resource-json): regression coverage for CI JSON export progress#265cursor[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 focused unit tests for
_supports_live_progressand_ExportProgressReporterinresource_json.py, matching the recentfix(json-export)behavior where CI and GitHub Actions force structuredlogger.infomilestones instead of carriage-return live stderr updates.Type of Change
Package(s) Affected
Changes Made
Libraries/PyKotor/tests/test_tools/test_resource_json_progress.py(undertest_tools/so collection does not depend ontests/cli/conftest.py).CI/GITHUB_ACTIONSenv disabling live TTY progress, non-TTY streams, TTY outside automation, and integration that_ExportProgressReporterlogs percentage lines to the logger whenCI=truewithout writing\rspam to the stream.Risky behavior now covered
CI/GITHUB_ACTIONStruthy values disable_supports_live_progresseven when stderr reports as a TTY, so log aggregators andcaplogreceivelogger.infoprogress lines instead of missing live-only updates._format_progress_barclamps negative and over-100 percentages so export UI cannot produce malformed bars.Test files added/updated
Libraries/PyKotor/tests/test_tools/test_resource_json_progress.pyWhy these tests materially reduce regression risk
The JSON installation/directory export path processes large trees; regressions that switch CI back to live
\rupdates silently drop progress from structured logs and break assertions that depend on milestone messages. These tests pin the environment gating and the logger-vs-stream contract with minimal, deterministic fixtures (noRobustLoggersubclassing, which hits singleton/metaclass behavior).Testing
cd Libraries/PyKotor && uv sync --extra dev && uv pip install pytest-timeoutQT_QPA_PLATFORM=offscreen uv run pytest --import-mode=importlib -m "not gui and not slow" --timeout=120 tests/test_tools/test_resource_json_progress.py tests/cli/test_json_commands.py -v(37 passed)Note: Running
pytest testsfromLibraries/PyKotorwithout the full workspace optional extras (e.g.glm,qtpy) produced collection errors for GL and Qt utility modules; CI uses a fuller install. The new tests only require the default PyKotor dev sync.Checklist
Fixes #
Closes #
Related to #