diff --git a/ci/test.sh b/ci/test.sh index 1d4a8b072879de9a3cced7b1256b29ed323faaae..3c476d93edb11cda154f1e0a661c06cfd27b0cf8 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -10,18 +10,16 @@ argv=( "--junitfile=ci/out/websocket/testReport.xml" "--format=short-verbose" -- - -race "-vet=off" - "-bench=." ) -# Interactive usage probably does not want to enable benchmarks, race detection -# turn off vet or use gotestsum by default. +# Interactive usage does not want to turn off vet or use gotestsum by default. if [[ $# -gt 0 ]]; then argv=(go test "$@") fi -# We always want coverage. +# We always want coverage and race detection. argv+=( + -race "-coverprofile=ci/out/coverage.prof" "-coverpkg=./..." ) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index f003e7438219c8f3fe71004a2300491dadedd724..74a25540ec45885ec5baa3aadf69af98c293072c 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -43,12 +43,10 @@ For coverage details locally, please see `ci/out/coverage.html` after running `c See [ci/image/Dockerfile](ci/image/Dockerfile) for the installation of the CI dependencies on Ubuntu. -You can also run tests normally with `go test`. -`ci/test.sh` just passes a default set of flags to `go test` to collect coverage, -enable the race detector, run benchmarks and also prettifies the output. +You can also run tests normally with `go test`. `ci/test.sh` just passes a default set of flags to +`go test` to collect coverage, enable the race detector and also prettifies the output. -If you pass flags to `ci/test.sh`, it will pass those flags directly to `go test` but will also -collect coverage for you. This is nice for when you don't want to wait for benchmarks -or the race detector but want to have coverage. +You can pass flags to `ci/test.sh` if you want to run a specific test or otherwise +control the behaviour of `go test`. Coverage percentage from codecov and the CI scripts will be different because they are calculated differently.