testsuite: add Archives and LegacyArchives unit tests, refs #9556#9648
Open
mr-raj12 wants to merge 2 commits into
Open
testsuite: add Archives and LegacyArchives unit tests, refs #9556#9648mr-raj12 wants to merge 2 commits into
mr-raj12 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9648 +/- ##
==========================================
+ Coverage 83.08% 83.84% +0.76%
==========================================
Files 90 90
Lines 15653 15653
Branches 2356 2356
==========================================
+ Hits 13006 13125 +119
+ Misses 1887 1788 -99
+ Partials 760 740 -20 ☔ View full report in Codecov by Sentry. |
ca6ff9b to
dad3f58
Compare
dad3f58 to
fdc00d9
Compare
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 unit tests for
ArchivesandLegacyArchives, refs #9556.Phase 3 (#9644) merged without test coverage for the new
Archives-only code paths and without any tests forLegacyArchives. This PR adds both.src/borg/testsuite/archives_test.py— 70+ tests forArchives(Borg 2.x,manifest.py):_set_raw_dict/_get_raw_dict)ids,count,names,exists,exists_id,exists_name_and_id,exists_name_and_tscreate(str ts, datetime ts, duplicate guard,overwrite=True)get/get_by_id(happy path, missing →None,raw=True)delete_by_id,undelete_by_id,nuke_by_id_get_archive_meta(ObjectNotFound path, success path, bad version)list()— sort, reverse, first/last pagination, date filters (older/newer/oldest/newest), all match prefixes (name:,user:,host:,tags:,aid:, ambiguousaid:)get_one(exact match, zero matches, multiple matches)list_considering(name-conflict guard, full delegation)_matching_info_tuplesmust materialise_info_tuples()vialist()before returning — if removed, the raw generator reaches.sort()and raisesAttributeErrorsrc/borg/testsuite/legacy_archives_test.py— 50+ tests forLegacyArchives(legacy/archives.py), same coverage plus:prepare/finishround-tripNotImplementedErrorstubs (exists_id,exists_name_and_id,exists_name_and_ts,delete_by_id,undelete_by_id,nuke_by_id)isinstance(la, ArchivesInterface)ManifestpicksLegacyArchivesfor aLegacyRepositoryNo production code changes.
Refs #9556
Checklist