diff --git a/cmd/restic/cmd_backup_integration_test.go b/cmd/restic/cmd_backup_integration_test.go index 840ef65b9..712476c3b 100644 --- a/cmd/restic/cmd_backup_integration_test.go +++ b/cmd/restic/cmd_backup_integration_test.go @@ -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} diff --git a/cmd/restic/integration_helpers_test.go b/cmd/restic/integration_helpers_test.go index 54ad884d6..c9b287415 100644 --- a/cmd/restic/integration_helpers_test.go +++ b/cmd/restic/integration_helpers_test.go @@ -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 },