testsuite: add UpgraderFrom12To20 unit tests, refs #9556#9675
Merged
ThomasWaldmann merged 2 commits intoMay 30, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9675 +/- ##
==========================================
+ Coverage 83.82% 83.99% +0.16%
==========================================
Files 93 93
Lines 15592 15592
Branches 2337 2337
==========================================
+ Hits 13070 13096 +26
+ Misses 1786 1771 -15
+ Partials 736 725 -11 ☔ View full report in Codecov by Sentry. |
ThomasWaldmann
requested changes
May 29, 2026
Member
ThomasWaldmann
left a comment
There was a problem hiding this comment.
Thanks for adding these.
BTW, it's not correct there were no test for the upgrader, there is a quite big and quite practical one inside the transfer_cmd tests, do a real repository upgrade from 1.2 to 2.
This was referenced May 30, 2026
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
Unit tests for
UpgraderFrom12To20, refs #9556.UpgraderFrom12To20(legacy/upgrade.py) shipped in earlier phases without any test coverage. This PR addssrc/borg/testsuite/legacy_upgrade_test.pycovering all three public methods.src/borg/testsuite/legacy_upgrade_test.py-- 20 tests forUpgraderFrom12To20:upgrade_item(8 tests):acl,chunks_healthy,hardlink_master)user/groupset toNoneare droppedsourcerenamed totargethlidassigned andhardlink_masterkey removedhlidand reuses chunks viacache.reuse_chunkhlidREQUIRED_ITEM_KEYSalways present in outputupgrade_archive_metadata(9 tests):cmdlinelist becomescommand_linestringrecreate_cmdlinelist becomesrecreate_command_linestringtimegets+00:00UTC offset appendedchunker_paramsgetsbuzhashprefixchunker_paramspasses through unchangedchunker_paramsrecreate_source_id,recreate_args,recreate_partial_chunks) droppedtagsalways set to[]upgrade_compressed_chunk(3 tests):ctypepromoted toZLIB.IDObfuscateSizebig-endiancsizeheader re-parsed correctly; inner payload and padding preservedAlso fixes
src/borg/compress.pyi:CompressorBase.IDwas typed asbytesbut isintat runtime in every subclass.No production code changes.
Refs #9556
Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)