race flag to tests

This commit is contained in:
Umputun
2018-03-12 21:05:07 -05:00
parent 667d07636c
commit 18dae24694
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ FROM umputun/baseimage:buildgo-latest as build-backend
ADD . /go/src/github.com/umputun/remark
WORKDIR /go/src/github.com/umputun/remark
RUN cd app && go test -v $(go list -e ./... | grep -v vendor)
RUN cd app && go test -v -race $(go list -e ./... | grep -v vendor)
RUN gometalinter --disable-all --deadline=300s --vendor --enable=vet --enable=vetshadow --enable=golint \
--enable=staticcheck --enable=ineffassign --enable=goconst --enable=errcheck --enable=unconvert \
+3 -3
View File
@@ -23,7 +23,7 @@ import (
)
var testDb = "/tmp/test-remark.db"
var testHtml = "/tmp/test-remark.html"
var testHTML = "/tmp/test-remark.html"
func TestServer_Ping(t *testing.T) {
srv, port := prep(t)
@@ -426,7 +426,7 @@ func prep(t *testing.T) (srv *Rest, port int) {
WebRoot: "/tmp",
}
ioutil.WriteFile(testHtml, []byte("some html"), 0700)
ioutil.WriteFile(testHTML, []byte("some html"), 0700)
portSetCh := make(chan bool)
go func() {
port = rand.Intn(50000) + 1025
@@ -469,7 +469,7 @@ func cleanup(srv *Rest) {
srv.httpServer.Close()
srv.httpServer.Shutdown(context.Background())
os.Remove(testDb)
os.Remove(testHtml)
os.Remove(testHTML)
}
type mockCache struct{}