diff --git a/backend/protondrive/budget_test.go b/backend/protondrive/budget_test.go index 98d8207cc..f1527ad6e 100644 --- a/backend/protondrive/budget_test.go +++ b/backend/protondrive/budget_test.go @@ -11,6 +11,7 @@ import ( "github.com/rclone/rclone/backend/protondrive/protontest" "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fs/config" "github.com/rclone/rclone/fs/object" "github.com/rclone/rclone/fs/operations" fssync "github.com/rclone/rclone/fs/sync" @@ -31,7 +32,17 @@ const ( // TestMain runs the tests, then fails the run if any of them, through // any fake server, requested a removed share-scoped route. +// +// The config file is RCLONE_CONFIG's, as on rclone's command line, +// whichever tests run: only fstest.Initialise would apply it, so the +// default config, which may hold a real Proton remote, would be read. func TestMain(m *testing.M) { + if path, ok := os.LookupEnv("RCLONE_CONFIG"); ok { + if err := config.SetConfigPath(path); err != nil { + fmt.Fprintf(os.Stderr, "FAIL: RCLONE_CONFIG: %v\n", err) + os.Exit(1) + } + } code := m.Run() if legacy := protontest.LegacyRequests(); len(legacy) > 0 { fmt.Fprintf(os.Stderr, "FAIL: TestBudgetNoLegacyRoutes: removed share-scoped routes were requested: %v\n", legacy)