"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
fstest/test_all: add oneonly flag to only run one test per backend if required
Nick Craig-Wood1bfd07567ecc
diff --git a/fstest/test_all/config.go b/fstest/test_all/config.goindex ecffb2753..d906c0926 100644--- a/fstest/test_all/config.go+++ b/fstest/test_all/config.go@@ -28,6 +28,7 @@ type Backend struct {Remote string // name of the test remoteSubDir bool // set to test with -sub-dirFastList bool // set to test with -fast-list+ OneOnly bool // set to run only one backend test at once}// MakeRuns creates Run objects the Backend and Test@@ -52,6 +53,7 @@ func (b *Backend) MakeRuns(t *Test) (runs []*Run) {SubDir: subdir,FastList: fastlist,NoRetries: t.NoRetries,+ OneOnly: b.OneOnly,}if t.AddBackend {run.Path = path.Join(run.Path, b.Backend)diff --git a/fstest/test_all/config.yaml b/fstest/test_all/config.yamlindex 25738416a..89d523263 100644--- a/fstest/test_all/config.yaml+++ b/fstest/test_all/config.yaml@@ -77,6 +77,7 @@ backends:remote: "TestQingStor:"subdir: falsefastlist: false+ oneonly: true- backend: "azureblob"remote: "TestAzureBlob:"subdir: truediff --git a/fstest/test_all/run.go b/fstest/test_all/run.goindex a3d51fbf5..a9de44370 100644--- a/fstest/test_all/run.go+++ b/fstest/test_all/run.go@@ -14,6 +14,7 @@ import ("regexp""runtime""strings"+ "sync""time""github.com/ncw/rclone/fs"@@ -21,6 +22,12 @@ import (const testBase = "github.com/ncw/rclone/"+// Control concurrency per backend if required+var (+ oneOnlyMu sync.Mutex+ oneOnly = map[string]*sync.Mutex{}+)+// Run holds info about a running test//// A run just runs one command line, but it can be run multiple times@@ -33,6 +40,7 @@ type Run struct {SubDir bool // add -sub-dir to testsFastList bool // add -fast-list to testsNoRetries bool // don't retry if set+ OneOnly bool // only run test for this backend at once// InternalscmdLine []stringcmdString string@@ -300,6 +308,17 @@ func (r *Run) FailedTests() string {// Run runs all the trials for this testfunc (r *Run) Run(logDir string, result chan<- *Run) {+ if r.OneOnly {+ oneOnlyMu.Lock()+ mu := oneOnly[r.Backend]+ if mu == nil {+ mu = new(sync.Mutex)+ oneOnly[r.Backend] = mu+ }+ oneOnlyMu.Unlock()+ mu.Lock()+ defer mu.Unlock()+ }r.Init()r.logDir = logDirfor r.try = 1; r.try <= *maxTries; r.try++ {