Skip to content

Commit da3da7c

Browse files
ci: enable race tests as cron job on travis (#23480)
1 parent cf8a6d6 commit da3da7c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,15 @@ jobs:
263263
submodules: false # avoid cloning ethereum/tests
264264
script:
265265
- go run build/ci.go purge -store gethstore/builds -days 14
266+
267+
# This builder executes race tests
268+
- stage: build
269+
if: type = cron
270+
os: linux
271+
dist: bionic
272+
go: 1.17.x
273+
env:
274+
- GO111MODULE=on
275+
script:
276+
- go run build/ci.go test -race -coverage $TEST_PACKAGES
277+

build/ci.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ func doTest(cmdline []string) {
282282
cc = flag.String("cc", "", "Sets C compiler binary")
283283
coverage = flag.Bool("coverage", false, "Whether to record code coverage")
284284
verbose = flag.Bool("v", false, "Whether to log verbosely")
285+
race = flag.Bool("race", false, "Execute the race detector")
285286
)
286287
flag.CommandLine.Parse(cmdline)
287288

@@ -302,6 +303,9 @@ func doTest(cmdline []string) {
302303
if *verbose {
303304
gotest.Args = append(gotest.Args, "-v")
304305
}
306+
if *race {
307+
gotest.Args = append(gotest.Args, "-race")
308+
}
305309

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

0 commit comments

Comments
 (0)