2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-26 14:56:29 +00:00

backend: test cleanup

This commit is contained in:
Michael Eischer 2023-04-21 22:02:43 +02:00
parent 32a6b66267
commit 18eb1d3ab0
2 changed files with 10 additions and 5 deletions

View File

@ -35,8 +35,11 @@ func newAzureTestSuite(t testing.TB) *test.Suite[azure.Config] {
return nil, err return nil, err
} }
cfg.AccountName = os.Getenv("RESTIC_TEST_AZURE_ACCOUNT_NAME") err = cfg.ApplyEnvironment("RESTIC_TEST_")
cfg.AccountKey = options.NewSecretString(os.Getenv("RESTIC_TEST_AZURE_ACCOUNT_KEY")) if err != nil {
return nil, err
}
cfg.Prefix = fmt.Sprintf("test-%d", time.Now().UnixNano()) cfg.Prefix = fmt.Sprintf("test-%d", time.Now().UnixNano())
return cfg, nil return cfg, nil
}, },

View File

@ -10,7 +10,6 @@ import (
"github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/backend"
"github.com/restic/restic/internal/backend/b2" "github.com/restic/restic/internal/backend/b2"
"github.com/restic/restic/internal/backend/test" "github.com/restic/restic/internal/backend/test"
"github.com/restic/restic/internal/options"
"github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/restic"
rtest "github.com/restic/restic/internal/test" rtest "github.com/restic/restic/internal/test"
@ -36,8 +35,11 @@ func newB2TestSuite(t testing.TB) *test.Suite[b2.Config] {
return nil, err return nil, err
} }
cfg.AccountID = os.Getenv("RESTIC_TEST_B2_ACCOUNT_ID") err = cfg.ApplyEnvironment("RESTIC_TEST_")
cfg.Key = options.NewSecretString(os.Getenv("RESTIC_TEST_B2_ACCOUNT_KEY")) if err != nil {
return nil, err
}
cfg.Prefix = fmt.Sprintf("test-%d", time.Now().UnixNano()) cfg.Prefix = fmt.Sprintf("test-%d", time.Now().UnixNano())
return cfg, nil return cfg, nil
}, },