Skip to content

Commit

Permalink
Travis-CI: Update and separate to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
gima committed May 9, 2017
1 parent 5e91832 commit c290e5f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
language: go
sudo: false
go:
- 1.4
- 1
install:
- go get -v -d -t ./v1/...
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
- ./script/download_deps
- go get -v github.com/mattn/goveralls
script:
- go test -v -covermode=count -coverprofile=cover.prof -cover -coverpkg ./v1 ./v1/tests
- ./script/testcoverage
- cat cover.prof
after_success:
# goveralls associates test coverage with correct branch by (default) reading travis-ci envvars
- goveralls -coverprofile=cover.prof -repotoken=$COVERALLS_TOKEN
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ Run `go fmt` before committing.

Test all reasonable code paths.

go test ./tests/
./script/test

#### Run code coverage

Try to cover the necessary cases.

go test -cover -coverpkg . -coverprofile cover.prof ./tests
go tool cover -html=cover.prof -o coverage.html
./script/testcoverage

---

Expand Down
2 changes: 2 additions & 0 deletions script/download_deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh -xe
go get -v -d -t ./v1/...
2 changes: 2 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh -xe
go test -v ./v1/tests/
3 changes: 3 additions & 0 deletions script/testcoverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -xe
go test -v -cover -coverprofile=cover.prof -covermode=count -coverpkg ./v1/ ./v1/tests/
go tool cover -html=cover.prof -o coverage.html

0 comments on commit c290e5f

Please sign in to comment.