mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
- Remove code coverage from Travis and add it to a GitHub Action that will be run as a nightly. - Use tag builds to exclude some tests, such as the "norace" or JS tests. Since "go test" does not support "negative" regexs, there is no other way. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
27 lines
1.1 KiB
Bash
Executable File
27 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Run from directory above via ./scripts/cov.sh
|
|
|
|
# Do not set the -e flag because we don't a flapper to prevent the push to coverall.
|
|
|
|
export GO111MODULE="on"
|
|
|
|
go install github.com/wadey/gocovmerge@latest
|
|
|
|
rm -rf ./cov
|
|
mkdir cov
|
|
# Since it is difficult to get a full run without a flapper, do not use `-failfast`.
|
|
# It is better to have one flapper or two and still get the report than have
|
|
# to re-run the whole code coverage. One or two failed tests should not affect
|
|
# so much the code coverage.
|
|
go test -v -covermode=atomic -coverprofile=./cov/conf.out ./conf -timeout=20m -tags=skip_no_race_tests
|
|
go test -v -covermode=atomic -coverprofile=./cov/log.out ./logger -timeout=20m -tags=skip_no_race_tests
|
|
go test -v -covermode=atomic -coverprofile=./cov/server.out ./server -timeout=20m -tags=skip_no_race_tests
|
|
go test -v -covermode=atomic -coverprofile=./cov/test.out -coverpkg=./server ./test -timeout=20m -tags=skip_no_race_tests
|
|
gocovmerge ./cov/*.out > acc.out
|
|
rm -rf ./cov
|
|
|
|
# If no argument passed, launch a browser to see the results.
|
|
if [[ $1 == "" ]]; then
|
|
go tool cover -html=acc.out
|
|
fi
|