]> source.dussan.org Git - gitea.git/commitdiff
Enable race detector for CI (#1441)
authorMura Li <2606021+typeless@users.noreply.github.com>
Thu, 26 Aug 2021 08:50:04 +0000 (16:50 +0800)
committerGitHub <noreply@github.com>
Thu, 26 Aug 2021 08:50:04 +0000 (16:50 +0800)
* 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 <typeless@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
.drone.yml
Makefile
build/gocovmerge.go

index 26726873b9f4174e451dc40d7ce683e9875feb77..62c0366406860c10420d52d60a18be898def61b1 100644 (file)
@@ -214,6 +214,7 @@ steps:
     environment:
       GOPROXY: off
       TAGS: bindata sqlite sqlite_unlock_notify
+      RACE_ENABLED: true
       GITHUB_READ_TOKEN:
         from_secret: github_read_token
 
@@ -236,6 +237,7 @@ steps:
     environment:
       GOPROXY: off
       TAGS: bindata gogit sqlite sqlite_unlock_notify
+      RACE_ENABLED: true
       GITHUB_READ_TOKEN:
         from_secret: github_read_token
 
@@ -246,6 +248,7 @@ steps:
     environment:
       GOPROXY: off
       TAGS: bindata
+      RACE_ENABLED: true
       TEST_LDAP: 1
       USE_REPO_TEST_DIR: 1
       TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200"
@@ -259,6 +262,7 @@ steps:
     environment:
       GOPROXY: off
       TAGS: bindata
+      RACE_ENABLED: true
       TEST_LDAP: 1
       USE_REPO_TEST_DIR: 1
     depends_on:
@@ -271,6 +275,7 @@ steps:
     environment:
       GOPROXY: off
       TAGS: bindata
+      RACE_ENABLED: true
       TEST_LDAP: 1
       USE_REPO_TEST_DIR: 1
     depends_on:
@@ -366,6 +371,7 @@ steps:
     environment:
       GOPROXY: off
       TAGS: bindata gogit sqlite sqlite_unlock_notify
+      RACE_ENABLED: true
       TEST_TAGS: gogit sqlite sqlite_unlock_notify
       USE_REPO_TEST_DIR: 1
     depends_on:
@@ -378,6 +384,7 @@ steps:
     environment:
       GOPROXY: off
       TAGS: bindata gogit
+      RACE_ENABLED: true
       TEST_TAGS: gogit
       TEST_LDAP: 1
       USE_REPO_TEST_DIR: 1
index 3cc9ff0cd3f9fd76bc09bcdfc35fef1776b698cb..8339e77f4fd74ae49997af079d111c02fd55cda9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -385,7 +385,7 @@ test\#%:
 
 .PHONY: coverage
 coverage:
-       GO111MODULE=on $(GO) run -mod=vendor build/gocovmerge.go integration.coverage.out $(shell find . -type f -name "coverage.out") > coverage.all
+       GO111MODULE=on $(GO) run -mod=vendor build/gocovmerge.go integration.coverage.out coverage.out > coverage.all
 
 .PHONY: unit-test-coverage
 unit-test-coverage:
index b38cf5ea3d5cec4bfd41444b624b37661346eed5..6a1af5b58f79c15dc35562187e377f127ce21981 100644 (file)
@@ -109,7 +109,7 @@ func main() {
        for _, file := range flag.Args() {
                profiles, err := cover.ParseProfiles(file)
                if err != nil {
-                       log.Fatalf("failed to parse profiles: %v", err)
+                       log.Fatalf("failed to parse profile '%s': %v", file, err)
                }
                for _, p := range profiles {
                        merged = addProfile(merged, p)