test(diff): extend merge-to-TSLPatcher regression coverage - #179
Merged
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 recent diff/merge-to-TSLPatcher behavior: default conflict artifact location, ambiguous base resource resolution, and merge conflict policy normalization.
Type of Change
Package(s) Affected
Risky behavior now covered
--merge-sourceis a folder tree containing two copies of the sameresname.dlg, the merge workflow must fail withMergeConflictError(message mentions ambiguity) instead of silently picking one file. This guards against wrong patches when modders mirror resources under multiple subfolders.merge_conflict_policy="artifact"and nomerge_conflict_output_path, artifacts must land under{tslpatchdata}/merge_conflicts/(README.txt,conflicts.json), matching_write_merge_conflict_artifactsinmerge.py._normalize_merge_conflict_policymaps known policies and defaults unknown/empty values to"mod-a", so CLI typos do not produce undefined behavior.Test files added/updated
Libraries/PyKotor/tests/tslpatcher/diff/test_diff_tslpatcher.pyWhy these tests materially reduce regression risk
changes.inifor end users). The ambiguity test pins the explicit failure mode.Testing
uv run pytest --import-mode=importlib -m "not gui and not slow" --timeout=120 Libraries/PyKotor/tests/tslpatcher/diff/test_diff_tslpatcher.py -k "test_merge_tslpatcher_artifact_writes or test_merge_tslpatcher_raises_when_base or test_normalize_merge"Note: On a fresh Linux agent,
libegl1was required for PyQt6 import during pytest; CI images that already ship EGL/Qt deps are unaffected.Checklist
Fixes #
Closes #
Related to #