mirror of
https://github.com/restic/restic.git
synced 2026-06-27 02:54:19 +00:00
use fastest compression in integration tests
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user