repository: run version sub-tests of TestAllVersions in parallel

TestRepositoryIncrementalIndex no longer modified index.Full as this
modified global state and also had no effect on the test result.
This commit is contained in:
Michael Eischer
2026-06-15 22:31:11 +02:00
parent a1420ea6c7
commit 072305c5b3
2 changed files with 1 additions and 3 deletions
-3
View File
@@ -412,8 +412,6 @@ func TestRepositoryIncrementalIndex(t *testing.T) {
func testRepositoryIncrementalIndex(t *testing.T, version uint) {
repo, _, _ := repository.TestRepositoryWithVersion(t, version)
index.Full = func(*index.Index) bool { return true }
// add a few rounds of packs
for j := 0; j < 5; j++ {
// add some packs and write index
@@ -445,7 +443,6 @@ func testRepositoryIncrementalIndex(t *testing.T, version uint) {
t.Errorf("pack %v listed in %d indexes\n", packID, len(ids))
}
}
}
func TestInvalidCompression(t *testing.T) {
+1
View File
@@ -148,6 +148,7 @@ type VersionedTest func(t *testing.T, version uint)
func TestAllVersions(t *testing.T, test VersionedTest) {
for version := restic.MinRepoVersion; version <= restic.MaxRepoVersion; version++ {
t.Run(fmt.Sprintf("v%d", version), func(t *testing.T) {
t.Parallel()
test(t, uint(version))
})
}