test(cli): JSON installation export progress under CI#253
Draft
cursor[bot] wants to merge 1 commit into
Draft
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 regression tests for
pykotor.tools.resource_json._supports_live_progressand for installation JSON export progress whenCI/GITHUB_ACTIONSforce the non-TTY (logger-based) path. This matches the recentfix(json-export)behavior so CI and log aggregators still receive milestone lines instead of relying only on carriage-return stderr updates.Type of Change
Package(s) Affected
Risky behavior now covered
CIorGITHUB_ACTIONSis set,_supports_live_progressmust return false so_ExportProgressReporterlogs percent milestones vialogger.inforather than only live\rstderr rendering (which caplog and many CI UIs miss).casefold()so Windows path casing differences do not hide a failed last milestone.Test files added/updated
Libraries/PyKotor/tests/cli/test_json_commands.pyWhy these tests materially reduce regression risk
The JSON tree export path is used for bulk tooling and automation. A regression that only updated the TTY progress bar would silently break observability in CI while still looking fine locally. The new tests pin the environment gate (
CI/GITHUB_ACTIONS) and prove that a full export still emits the same percentage log lines when TTY live updates are disabled.Testing
Ran (environment without full
uvworkspace sync):PYTHONPATH=Libraries/PyKotor/src python3 -m pytest Libraries/PyKotor/tests/cli/test_json_commands.py::test_supports_live_progress_is_false_when_ci_env_set Libraries/PyKotor/tests/cli/test_json_commands.py::test_supports_live_progress_is_false_when_github_actions_set Libraries/PyKotor/tests/cli/test_json_commands.py::test_supports_live_progress_is_true_for_tty_like_stream Libraries/PyKotor/tests/cli/test_json_commands.py::test_export_installation_to_json_tree_logs_percentage_when_ci_disables_live_progress -q --timeout=120All four tests passed.
Test Results
Checklist
Related Issues
Related to recent
fix(json-export): log progress when automated; casefold stream path assertonmaster.Additional Notes
Not flaky: tests use
tmp_path,monkeypatchfor env vars, and a tiny fake stream withisatty() -> Truefor the positive branch. No production code changes.AgentDecompile status: Skipped - no game-engine or binary format behavior changes :(