Skip to content

Commit

Permalink
Add support for coveralls.io
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe committed Dec 14, 2017
1 parent 626a2f7 commit 1a03e11
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
*.test
*.coverprofile
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
before_install:
- go get -u github.com/stretchr/testify/require

# Install code coverage / coveralls tooling
- go get -u golang.org/x/tools/cmd/cover
- go get -u github.com/modocache/gover
- go get -u github.com/mattn/goveralls

# Unpack and start the Stripe API stub so that the test suite can talk to it
- |
if [ ! -d "stripe-mock/stripe-mock_${STRIPE_MOCK_VERSION}" ]; then
Expand Down Expand Up @@ -35,5 +40,12 @@ matrix:

script:
- make
- make coverage

after_script:
# Merge all coverage reports located in subdirectories and put them under: gover.coverprofile
- gover
# Send code coverage report to coveralls.io
- goveralls -service=travis-ci -coverprofile=gover.coverprofile

sudo: false
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ test:

vet:
go vet ./...

coverage:
# go currently cannot create coverage profiles when testing multiple packages, so we test each package
# independently. This issue should be fixed in Go 1.10 (https://github.com/golang/go/issues/6909).
go list ./... | xargs -n1 -I {} -P 4 go test -covermode=count -coverprofile=../../../{}/profile.coverprofile {}

clean:
find . -name \*.coverprofile -delete
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Go Stripe [![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/stripe/stripe-go) [![Build Status](https://travis-ci.org/stripe/stripe-go.svg?branch=master)](https://travis-ci.org/stripe/stripe-go)
# Go Stripe

[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/stripe/stripe-go)
[![Build Status](https://travis-ci.org/stripe/stripe-go.svg?branch=master)](https://travis-ci.org/stripe/stripe-go)
[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-go/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-go?branch=master)

## Summary

Expand Down

0 comments on commit 1a03e11

Please sign in to comment.