Skip to content
Permalink
Browse files

Merge pull request #1207 from camilamacedo86/coveralls

feat add coverage tests
  • Loading branch information
k8s-ci-robot committed Jan 14, 2020
2 parents 9c6b6f5 + 24d31be commit 6357643f1f6af00df6415927f6142c839e630706
Showing with 21 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +11 −0 .travis.yml
  3. +7 −0 Makefile
@@ -14,6 +14,9 @@ docs/book/book/
# skip bin
bin/*

# skip .out files (coverage tests)
*.out

# skip testdata gopath non-src
/testdata/gopath/bin
/testdata/gopath/pkg
@@ -58,6 +58,17 @@ script:
- ./test.sh
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then PATH=$PATH:$(pwd) ./test_e2e.sh; fi

jobs:
include:
- stage: Go Coverage
before_script:
# The following module is used to integrate the projct with coveralls.io. It allow us to easily sent the data.
# More info: https://github.com/mattn/goveralls
- go get github.com/mattn/goveralls@v0.0.4
script:
- make test-coverage
- $GOPATH/bin/goveralls -service=travis-ci -coverprofile=coverage-all.out -repotoken=$COVERALLS_TOKEN

# TBD. Suppressing for now.
notifications:
email: false
@@ -80,3 +80,10 @@ test-ci: ## Run the unit tests (used in the CI)
.PHONY: test-e2e
test-e2e: ## Run the integration tests (used in the CI)
./test_e2e.sh

.PHONY: test-coverage
test-coverage: ## Run coveralls
# remove all coverage files if exists
- rm -rf *.out
# run the go tests and gen the file coverage-all used to do the integration with coverrals.io
go test -failfast -tags=integration -coverprofile=coverage-all.out -covermode=count ./pkg/... ./cmd/...

0 comments on commit 6357643

Please sign in to comment.
You can’t perform that action at this time.