mirror of
https://github.com/restic/restic.git
synced 2026-06-27 02:54:19 +00:00
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:
@@ -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) {
|
||||
|
||||
@@ -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))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user