repository: default to fastest compression in tests

This commit is contained in:
Michael Eischer
2026-06-14 21:27:13 +02:00
parent af64caf5d9
commit 440d925467
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ func TestPruneSmall(t *testing.T) {
t.Logf("rand initialized with seed %d", seed)
be := repository.TestBackend(t)
repo, _ := repository.TestRepositoryWithBackend(t, be, 0, repository.Options{PackSize: repository.MinPackSize})
repo, _ := repository.TestRepositoryWithBackend(t, be, 0, repository.Options{PackSize: repository.MinPackSize, Compression: repository.CompressionOff})
const blobSize = 1000 * 1000
const numBlobsCreated = 55
+5 -1
View File
@@ -54,6 +54,10 @@ func TestRepositoryWithBackend(t testing.TB, be backend.Backend, version uint, o
if be == nil {
be = TestBackend(t)
}
// Speed up tests by default
if opts.Compression == CompressionAuto {
opts.Compression = CompressionFastest
}
repo, err := New(be, opts)
if err != nil {
@@ -126,7 +130,7 @@ func TestOpenLocal(t testing.TB, dir string) (*Repository, backend.Backend) {
}
func TestOpenBackend(t testing.TB, be backend.Backend) *Repository {
repo, err := New(be, Options{})
repo, err := New(be, Options{Compression: CompressionFastest})
if err != nil {
t.Fatal(err)
}