Skip to content

Commit

Permalink
Add coverage flag to tests
Browse files Browse the repository at this point in the history
Add flag to include coverage in tests.

Add snippet to upload coverage data.
  • Loading branch information
HeavyWombat committed Dec 27, 2019
1 parent 219e4fd commit bb758c6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ script:
- go mod verify
- make test

after_success:
- for FILE in $(find . -type f -name "*.coverprofile" 2>/dev/null); do echo >>$FILE; done
- gover . coverage.txt
- bash <(curl -s https://codecov.io/bash)

before_deploy:
- make build

Expand Down
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ verify:
@GO111MODULE=on go mod verify

test: $(sources)
@GO111MODULE=on ginkgo -r \
-randomizeAllSpecs \
-randomizeSuites \
-failOnPending \
-trace \
-race \
-nodes=2 \
-compilers=2
@GO111MODULE=on ginkgo \
-r \
-randomizeAllSpecs \
-randomizeSuites \
-failOnPending \
-trace \
-race \
-nodes=4 \
-compilers=2 \
-cover

binaries/ytbx-linux-amd64: $(sources)
@GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![License](https://img.shields.io/github/license/homeport/ytbx.svg)](https://github.com/homeport/ytbx/blob/master/LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/homeport/ytbx)](https://goreportcard.com/report/github.com/homeport/ytbx)
[![Build Status](https://travis-ci.org/homeport/ytbx.svg?branch=master)](https://travis-ci.org/homeport/ytbx)
[![Codecov](https://img.shields.io/codecov/c/github/homeport/ytbx/master.svg)](https://codecov.io/gh/homeport/ytbx)
[![GoDoc](https://godoc.org/github.com/homeport/ytbx/pkg?status.svg)](https://godoc.org/github.com/homeport/ytbx/pkg)
[![Release](https://img.shields.io/github/release/homeport/ytbx.svg)](https://github.com/homeport/ytbx/releases/latest)

Expand Down

0 comments on commit bb758c6

Please sign in to comment.