diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-09-08 17:13:30 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-09-25 09:09:41 +0200 |
commit | f108fd2236ad7d61f0c4ee824b265653ef1d8dad (patch) | |
tree | c89d1bfa6397d397f1aadfeb4876b159d03db2d7 /cmd | |
parent | 8081b59a02fee986a04c359b43b5100cce36756f (diff) |
Support -race arg when running integration tests to turn on go's race detector
For the "cli" and "tui" modes of the test runner there's a "-race" parameter to
turn it on; for running tests on CI with go test, you turn it on by setting the
environment variable LAZYGIT_RACE_DETECTOR to a non-empty value.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/integration_test/main.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd/integration_test/main.go b/cmd/integration_test/main.go index c7952e51a..711ce8b33 100644 --- a/cmd/integration_test/main.go +++ b/cmd/integration_test/main.go @@ -61,14 +61,23 @@ func main() { slow := false sandbox := false waitForDebugger := false + raceDetector := false testNames := parseFlags(os.Args[2:], []flagInfo{ {"slow", &slow}, {"sandbox", &sandbox}, {"debug", &waitForDebugger}, + {"race", &raceDetector}, }) - clients.RunCLI(testNames, slow, sandbox, waitForDebugger) + clients.RunCLI(testNames, slow, sandbox, waitForDebugger, raceDetector) case "tui": - clients.RunTUI() + raceDetector := false + remainingArgs := parseFlags(os.Args[2:], []flagInfo{ + {"race", &raceDetector}, + }) + if len(remainingArgs) > 0 { + log.Fatal("tui only supports the -race argument.") + } + clients.RunTUI(raceDetector) default: log.Fatal(usage) } |