use fastest compression in integration tests

This commit is contained in:
Michael Eischer
2026-06-20 19:46:11 +02:00
parent 5683224a3c
commit d5267f03e0
2 changed files with 10 additions and 5 deletions
@@ -13,6 +13,7 @@ import (
"github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/fs"
"github.com/restic/restic/internal/global"
"github.com/restic/restic/internal/repository"
"github.com/restic/restic/internal/restic"
rtest "github.com/restic/restic/internal/test"
)
@@ -49,6 +50,9 @@ func testBackup(t *testing.T, useFsSnapshot bool) {
env, cleanup := withTestEnvironment(t)
defer cleanup()
// Use auto compression to ensure coverage in the integration tests
// All other tests use fastest compression for faster execution
env.gopts.Compression = repository.CompressionAuto
testSetupBackupData(t, env)
opts := BackupOptions{UseFsSnapshot: useFsSnapshot}
+6 -5
View File
@@ -212,11 +212,12 @@ func withTestEnvironment(t testing.TB) (env *testEnvironment, cleanup func()) {
rtest.OK(t, os.MkdirAll(env.repo, 0700))
env.gopts = global.Options{
Repo: env.repo,
Quiet: true,
CacheDir: env.cache,
Password: rtest.TestPassword,
Extended: make(options.Options),
Repo: env.repo,
Quiet: true,
CacheDir: env.cache,
Password: rtest.TestPassword,
Extended: make(options.Options),
Compression: repository.CompressionFastest,
// replace this hook with "nil" if listing a filetype more than once is necessary
BackendTestHook: func(r backend.Backend) (backend.Backend, error) { return newOrderedListOnceBackend(r), nil },