upd(all): produce an accurate code coverage (#120)
Signed-off-by: Tit Petric <black@scene-si.org>
This commit is contained in:
parent
537a8d2060
commit
ccc50012ce
@ -15,7 +15,6 @@ steps:
|
||||
GOARCH: amd64
|
||||
CI: circleci
|
||||
commands:
|
||||
- make codegen
|
||||
- make test
|
||||
|
||||
- name: api-system
|
||||
@ -100,14 +99,13 @@ steps:
|
||||
COMPOSE_DB_DSN: crust:crust@tcp(crust-db:3306)/crust?collation=utf8mb4_general_ci
|
||||
MESSAGING_DB_DSN: crust:crust@tcp(crust-db:3306)/crust?collation=utf8mb4_general_ci
|
||||
commands:
|
||||
- make codegen
|
||||
- go build ./cmd/...
|
||||
- wait-for-it.sh -t 60 --strict crust-db:3306 -- echo "Crust DB1 is up"
|
||||
- gotest -v --tags="migrations" ./system/db/...
|
||||
- gotest -v --tags="migrations" ./compose/db/...
|
||||
- gotest -v --tags="migrations" ./messaging/db/...
|
||||
- go test -run=^$ --tags="integration" ./cmd/... ./internal/... ./compose/... ./messaging/... ./system/...
|
||||
- gotest -failfast --coverprofile=coverage.txt -v --tags="integration" ./internal/... ./system/... ./compose/... ./messaging/...
|
||||
- make test-coverage
|
||||
|
||||
- name: coverage
|
||||
image: plugins/codecov
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,6 +4,8 @@
|
||||
/.env*
|
||||
/.dev*
|
||||
/.cover*
|
||||
/overalls*
|
||||
profile.coverprofile
|
||||
/public_html
|
||||
/build
|
||||
/var
|
||||
|
||||
@ -3,6 +3,7 @@ FROM golang:1.12-alpine
|
||||
ENV CGO_ENABLED=0
|
||||
|
||||
RUN apk add --no-cache git make bash && \
|
||||
echo "installing overalls" && go get -u github.com/go-playground/overalls && \
|
||||
echo "installing gomock" && go get -u github.com/golang/mock/gomock && \
|
||||
echo "installing mockgen" && go get -u github.com/golang/mock/mockgen && \
|
||||
echo "installing gotest" && go get -u github.com/rakyll/gotest && \
|
||||
|
||||
4
Makefile
4
Makefile
@ -68,6 +68,10 @@ test:
|
||||
# Run basic unit tests
|
||||
$(GO) test ./cmd/... ./internal/... ./compose/... ./messaging/... ./system/...
|
||||
|
||||
test-coverage:
|
||||
overalls -project=github.com/crusttech/crust -covermode=count -debug -- -coverpkg=./... --tags=integration
|
||||
mv overalls.coverprofile coverage.txt
|
||||
|
||||
test.internal: $(GOTEST)
|
||||
$(GOTEST) -covermode count -coverprofile .cover.out -v ./internal/...
|
||||
$(GO) tool cover -func=.cover.out
|
||||
|
||||
2
codecov.yml
Normal file
2
codecov.yml
Normal file
@ -0,0 +1,2 @@
|
||||
ignore:
|
||||
- vendor/.*
|
||||
Loading…
x
Reference in New Issue
Block a user