test(regression): CI JSON progress and BIF-sliced MDL reads#254
Draft
cursor[bot] wants to merge 1 commit into
Draft
test(regression): CI JSON progress and BIF-sliced MDL reads#254cursor[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 regression tests for two recently merged high-risk areas: JSON export progress reporting under CI-like environment variables, and binary MDL loading when the resource lives at a non-zero offset inside a larger buffer (BIF / chitin slice semantics).
Type of Change
Package(s) Affected
Risky behavior now covered
_supports_live_progressinresource_json: WhenCIorGITHUB_ACTIONSis set to a truthy string, live\rprogress is disabled even if stderr claims to be a TTY, so log-based assertions and aggregators still see percentage milestones vialogger.info.MDLBinaryReaderoffset handling: Reading the same binary MDL from a padded buffer withoffset/size(simulating a BIF entry) must match reading the standalone file—guards against double-countingoffset+12and bogus seeks.Test files added/updated
Libraries/PyKotor/tests/test_resource_json_progress_regressions.py(new)Libraries/PyKotor/tests/resource/formats/test_mdl_bif_slice_offset.py(new)Why these tests materially reduce regression risk
chitin.key/ BIFs; comparing slice vs file is a minimal end-to-end proof without depending on fullmodels.bifroundtrips.Testing
Command (from
Libraries/PyKotor,uvwithdevextra):QT_QPA_PLATFORM=offscreen uv run python -m pytest --rootdir=/workspace/Libraries/PyKotor --import-mode=importlib -m "not gui and not slow" tests/test_resource_json_progress_regressions.py tests/resource/formats/test_mdl_bif_slice_offset.py -vResult: 5 passed (0.13s). Tests are deterministic (temp env via
monkeypatch, in-repo binary fixture).Checklist
Related Issues
Related to recent fixes on
resource_jsonCI progress andMDLBinaryReaderBIF offset handling.