Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

servetest: add -sub-run flag for running a subset of the backend tests

Nick Craig-Woode204f896850d
diff --git a/cmd/serve/servetest/servetest.go b/cmd/serve/servetest/servetest.go
index 40f23222b..f0f246335 100644
--- a/cmd/serve/servetest/servetest.go
+++ b/cmd/serve/servetest/servetest.go
@@ -5,6 +5,7 @@ package servetest
import (
"context"
+ "flag"
"fmt"
"os"
"os/exec"
@@ -20,6 +21,8 @@ import (
"github.com/stretchr/testify/require"
)
+var subRun = flag.String("sub-run", "", "pass this to the -run command of the backend tests")
+
// StartFn describes the callback which should start the server with
// the Fs passed in.
// It should return a config for the backend used to connect to the
@@ -74,6 +77,9 @@ func run(t *testing.T, name string, start StartFn, useProxy bool) {
args = append(args, "-verbose")
}
remoteName := name + "test:"
+ if *subRun != "" {
+ args = append(args, "-run", *subRun)
+ }
args = append(args, "-remote", remoteName)
args = append(args, "-list-retries", fmt.Sprint(*fstest.ListRetries))
cmd := exec.Command("go", args...)