[NOD-687] Remove -gcflags='-l' from all tests (#616)

This commit is contained in:
Ori Newman 2020-02-02 15:26:26 +02:00 committed by GitHub
parent f7800eb5c4
commit aa74b51e6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -28,7 +28,7 @@ RUN golint -set_exit_status ./...
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o kaspad .
# Remove the line below and uncomment the line after it for testing with coverage
RUN go test -gcflags='-l' ./...
RUN go test ./...
# RUN ./test.sh
# --- multistage docker build: stage #2: runtime image

View File

@ -1,10 +1,9 @@
#!/bin/sh
# Test each package separately
# Function inlining messes with monkey patching so we disable it by passing -gcflags='-l'
# Running tests with -covermode=atomic saves us from race conditions unique to the testing environment
go list ./... | \
xargs -n1 -I{} sh -c "go test -gcflags='-l' -timeout 60s -covermode=atomic -cover {}"
xargs -n1 -I{} sh -c "go test -timeout 60s -covermode=atomic -cover {}"
retVal=$?
if [ $retVal -ne 0 ]