Skip to content

Commit

Permalink
add coveralls integration
Browse files Browse the repository at this point in the history
  • Loading branch information
jdef committed Feb 25, 2017
1 parent 3d0197f commit 2c7cfb1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -13,7 +13,8 @@ before_install:
- if [[ "$SrcDir" != "$DestDir" ]]; then mv "$SrcDir" "$DestDir"; cd ../../mesos/$RepoName; export TRAVIS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/$RepoName; fi
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
- go get github.com/mattn/goveralls
install:
- make install
script:
- make test
- rm -rf $HOME/gopath/pkg && make coverage && $HOME/gopath/bin/goveralls -service=travis-ci -coverprofile=_output/coverage.out
8 changes: 8 additions & 0 deletions Makefile
Expand Up @@ -10,6 +10,7 @@ PACKAGES ?= $(shell go list ${API_PKG}/...|grep -v vendor)
TEST_DIRS ?= $(sort $(dir $(shell find ${API_PKG} -name '*_test.go' | grep -v vendor)))
BINARIES ?= $(shell go list -f "{{.Name}} {{.ImportPath}}" ${CMD_PKG}/...|grep -v -e vendor|grep -e ^main|cut -f2 -d' ')
TEST_FLAGS ?= -race
COVERAGE_TARGETS = ${TEST_DIRS:%/=%.cover}

.PHONY: all
all: test
Expand All @@ -26,6 +27,13 @@ test:
test-verbose: TEST_FLAGS += -v
test-verbose: test

.PHONY: coverage $(COVERAGE_TARGETS)
coverage: TEST_FLAGS = -v -cover -race
coverage: $(COVERAGE_TARGETS)
cat _output/*.cover | sed -e '2,$$ s/^mode:.*$$//' -e '/^$$/d' >_output/coverage.out
$(COVERAGE_TARGETS):
mkdir -p _output && go test ./$(@:%.cover=%) $(TEST_FLAGS) -coverprofile=_output/$(subst /,___,$@)

.PHONY: vet
vet:
go $@ $(PACKAGES)
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -6,6 +6,7 @@ One of the objectives of this project is to provide an idiomatic Go API that mak

[![Build Status](https://travis-ci.org/mesos/mesos-go.svg)](https://travis-ci.org/mesos/mesos-go)
[![GoDoc] (https://godoc.org/github.com/mesos/mesos-go?status.png)](https://godoc.org/github.com/mesos/mesos-go)
[![Coverage Status](https://coveralls.io/repos/github/mesos/mesos-go/badge.svg?branch=master)](https://coveralls.io/github/mesos/mesos-go?branch=master)

## Status
New projects should use the Mesos v1 API bindings, located in `api/v1`.
Expand Down

0 comments on commit 2c7cfb1

Please sign in to comment.