Skip to content

Commit

Permalink
ci: enable race tests as cron job on travis (#23480)
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusVanDerWijden committed Oct 11, 2021
1 parent cf8a6d6 commit da3da7c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Expand Up @@ -263,3 +263,15 @@ jobs:
submodules: false # avoid cloning ethereum/tests
script:
- go run build/ci.go purge -store gethstore/builds -days 14

# This builder executes race tests
- stage: build
if: type = cron
os: linux
dist: bionic
go: 1.17.x
env:
- GO111MODULE=on
script:
- go run build/ci.go test -race -coverage $TEST_PACKAGES

4 changes: 4 additions & 0 deletions build/ci.go
Expand Up @@ -282,6 +282,7 @@ func doTest(cmdline []string) {
cc = flag.String("cc", "", "Sets C compiler binary")
coverage = flag.Bool("coverage", false, "Whether to record code coverage")
verbose = flag.Bool("v", false, "Whether to log verbosely")
race = flag.Bool("race", false, "Execute the race detector")
)
flag.CommandLine.Parse(cmdline)

Expand All @@ -302,6 +303,9 @@ func doTest(cmdline []string) {
if *verbose {
gotest.Args = append(gotest.Args, "-v")
}
if *race {
gotest.Args = append(gotest.Args, "-race")
}

packages := []string{"./..."}
if len(flag.CommandLine.Args()) > 0 {
Expand Down

0 comments on commit da3da7c

Please sign in to comment.