test(tslpatcher): strengthen merge-tslpatcher conflict artifact coverage - #182
Merged
Merged
Conversation
…ormalization 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
--merge-tslpatcherconflict artifact mode when no custom output directory is set, and for_normalize_merge_conflict_policyso invalid or missing policy values safely default tomod-a.Type of Change
Package(s) Affected
Changes Made
test_merge_tslpatcher_artifact_default_output_dir_and_report: Asserts artifacts land in<tslpatchdata>/merge_conflicts/, exit code1, nochanges.ini, andconflicts.jsoncontains expected keys, non-empty conflicts, and on-disk artifact paths.test_normalize_merge_conflict_policy_defaults_unknown: Locks behavior of_normalize_merge_conflict_policyforNone, empty string, unknown strings, and valid policies.Risky behavior now covered
artifactmode write to the wrong directory or skipREADME.txt/conflicts.json.conflicts.jsonremains parseable and includes conflict entries and artifact paths (downstream tooling and triage).mod-a(consistent withrun_merge_tslpatcher_workflow).Test files added/updated
Libraries/PyKotor/tests/tslpatcher/diff/test_diff_tslpatcher.pyWhy these tests materially reduce regression risk
The prior artifact test only covered a custom
merge_conflict_output_path. The new test covers the default branch in_write_merge_conflict_artifacts, which users rely on when they omit--merge-conflict-output. Policy normalization had no direct tests; a bad default could silently change conflict resolution across merges.Testing
Test Results
Note:
uvwas not available in this automation environment; tests were run withpython3 -m pytestafterpip installof the localLibraries/PyKotorpackage and test deps.Checklist
Related Issues
Related to merge-tslpatcher / diff conflict artifact behavior (recent
fix(diff): add conflict artifacts and unique ini sections).Additional Notes
Tests are deterministic (temp dirs, synthetic DLG + fake install) and do not depend on game assets.