From 9e60a065b43211e247fbe4bd2ddda9ba2164a80d Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 24 Jan 2024 11:25:47 +0000 Subject: [PATCH] build: add -race flag to integration tester test_all --- fstest/test_all/run.go | 3 +++ fstest/test_all/test_all.go | 1 + 2 files changed, 4 insertions(+) diff --git a/fstest/test_all/run.go b/fstest/test_all/run.go index ce8688d6e..2c45c73d2 100644 --- a/fstest/test_all/run.go +++ b/fstest/test_all/run.go @@ -286,6 +286,9 @@ func (r *Run) MakeTestBinary() { binaryName := r.BinaryName() log.Printf("%s: Making test binary %q", r.Path, binaryName) CmdLine := []string{"go", "test", "-c"} + if *race { + CmdLine = append(CmdLine, "-race") + } if *dryRun { log.Printf("Not executing: %v", CmdLine) return diff --git a/fstest/test_all/test_all.go b/fstest/test_all/test_all.go index d536b83dd..79263f0e4 100644 --- a/fstest/test_all/test_all.go +++ b/fstest/test_all/test_all.go @@ -35,6 +35,7 @@ var ( clean = flag.Bool("clean", false, "Instead of testing, clean all left over test directories") runOnly = flag.String("run", "", "Run only those tests matching the regexp supplied") timeout = flag.Duration("timeout", 60*time.Minute, "Maximum time to run each test for before giving up") + race = flag.Bool("race", false, "If set run the tests under the race detector") configFile = flag.String("config", "fstest/test_all/config.yaml", "Path to config file") outputDir = flag.String("output", path.Join(os.TempDir(), "rclone-integration-tests"), "Place to store results") emailReport = flag.String("email", "", "Set to email the report to the address supplied")