Skip to content

Commit

Permalink
Merge pull request #200 from ruflin/coverage-implementation
Browse files Browse the repository at this point in the history
Proposal for coverage report implementation
  • Loading branch information
tsg committed Aug 13, 2015
2 parents 485f368 + 239096d commit 56a23e5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 32 deletions.
22 changes: 14 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
language: go

go:
- 1.4
- 1.4

sudo: false

services:
- redis-server
- elasticsearch

addons:
apt:
packages:
Expand All @@ -17,14 +13,24 @@ addons:
- geoip-database

before_install:
- ln -s $TRAVIS_BUILD_DIR $HOME/gopath/src/packetbeat
# Redo the travis setup but with the elastic/packetbeat path. This is needed so the package path is correct
- mkdir -p $HOME/gopath/src/github.com/elastic/packetbeat
- rsync -az ${TRAVIS_BUILD_DIR}/ $HOME/gopath/src/github.com/elastic/packetbeat/
- export TRAVIS_BUILD_DIR=$HOME/gopath/src/github.com/elastic/packetbeat
- cd $HOME/gopath/src/github.com/elastic/packetbeat

install:
- make
- make

script: make testlong
script:
- make testlong

notifications:
email:
- tudor@elastic.co
- monica@elastic.co

after_success:
# Copy profile.cov to coverage.txt because codecov.io requires this file
- cp profile.cov coverage.txt
- bash <(curl -s https://codecov.io/bash)
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,18 @@ autotest:
.PHONY: testlong
testlong:
go vet ./...
$(GODEP) go test ./...
make cover
make -C tests test

.PHONY: cover
cover:
# gotestcover is needed to fetch coverage for multiple packages
go get github.com/pierrre/gotestcover
GOPATH=$(shell $(GODEP) path):$(GOPATH) gotestcover -coverprofile=profile.cov -covermode=count github.com/elastic/packetbeat/...
mkdir -p cover
GOPATH=$(shell $(GODEP) path):$(GOPATH) ./scripts/coverage.sh
$(GODEP) go tool cover -html=profile.cov -o cover/coverage.html


.PHONY: benchmark
benchmark:
$(GODEP) go test -short -bench=. ./...
Expand Down
22 changes: 0 additions & 22 deletions scripts/coverage.sh

This file was deleted.

0 comments on commit 56a23e5

Please sign in to comment.