From b02bae9d73cd74b42bfd1f5e3589102ce75e821b Mon Sep 17 00:00:00 2001 From: Anmol Sethi <hi@nhooyr.io> Date: Sat, 31 Aug 2019 00:50:27 -0500 Subject: [PATCH] Remove -bench from ./ci/test.sh Testing should not run benchmarks by default, it takes too long. --- ci/test.sh | 8 +++----- docs/CONTRIBUTING.md | 10 ++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ci/test.sh b/ci/test.sh index 1d4a8b0..3c476d9 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 f003e74..74a2554 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. -- GitLab