Skip to content

Commit b60e814

Browse files
typeless6543lunny
authored
Enable race detector for CI (#1441)
* Enable race detector by default Set RACE_ENABLED=0 to disable it when release * Disable race detector for release builds * use `true` * fix * debug issue * fix * verbose * clean * Fix wrong merge * Fix coverage merge Co-authored-by: Mura Li <[email protected]> Co-authored-by: 6543 <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
1 parent c446901 commit b60e814

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.drone.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ steps:
214214
environment:
215215
GOPROXY: off
216216
TAGS: bindata sqlite sqlite_unlock_notify
217+
RACE_ENABLED: true
217218
GITHUB_READ_TOKEN:
218219
from_secret: github_read_token
219220

@@ -236,6 +237,7 @@ steps:
236237
environment:
237238
GOPROXY: off
238239
TAGS: bindata gogit sqlite sqlite_unlock_notify
240+
RACE_ENABLED: true
239241
GITHUB_READ_TOKEN:
240242
from_secret: github_read_token
241243

@@ -246,6 +248,7 @@ steps:
246248
environment:
247249
GOPROXY: off
248250
TAGS: bindata
251+
RACE_ENABLED: true
249252
TEST_LDAP: 1
250253
USE_REPO_TEST_DIR: 1
251254
TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
@@ -259,6 +262,7 @@ steps:
259262
environment:
260263
GOPROXY: off
261264
TAGS: bindata
265+
RACE_ENABLED: true
262266
TEST_LDAP: 1
263267
USE_REPO_TEST_DIR: 1
264268
depends_on:
@@ -271,6 +275,7 @@ steps:
271275
environment:
272276
GOPROXY: off
273277
TAGS: bindata
278+
RACE_ENABLED: true
274279
TEST_LDAP: 1
275280
USE_REPO_TEST_DIR: 1
276281
depends_on:
@@ -366,6 +371,7 @@ steps:
366371
environment:
367372
GOPROXY: off
368373
TAGS: bindata gogit sqlite sqlite_unlock_notify
374+
RACE_ENABLED: true
369375
TEST_TAGS: gogit sqlite sqlite_unlock_notify
370376
USE_REPO_TEST_DIR: 1
371377
depends_on:
@@ -378,6 +384,7 @@ steps:
378384
environment:
379385
GOPROXY: off
380386
TAGS: bindata gogit
387+
RACE_ENABLED: true
381388
TEST_TAGS: gogit
382389
TEST_LDAP: 1
383390
USE_REPO_TEST_DIR: 1

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ test\#%:
385385

386386
.PHONY: coverage
387387
coverage:
388-
GO111MODULE=on $(GO) run -mod=vendor build/gocovmerge.go integration.coverage.out $(shell find . -type f -name "coverage.out") > coverage.all
388+
GO111MODULE=on $(GO) run -mod=vendor build/gocovmerge.go integration.coverage.out coverage.out > coverage.all
389389

390390
.PHONY: unit-test-coverage
391391
unit-test-coverage:

build/gocovmerge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func main() {
109109
for _, file := range flag.Args() {
110110
profiles, err := cover.ParseProfiles(file)
111111
if err != nil {
112-
log.Fatalf("failed to parse profiles: %v", err)
112+
log.Fatalf("failed to parse profile '%s': %v", file, err)
113113
}
114114
for _, p := range profiles {
115115
merged = addProfile(merged, p)

0 commit comments

Comments
 (0)