Skip to content

Commit

Permalink
Merge pull request #123 from dave-tucker/coverage
Browse files Browse the repository at this point in the history
Experimentation with coverage
  • Loading branch information
mavenugo committed Feb 4, 2015
2 parents ff50c1f + b58d4cf commit c0f8ce4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ _testmain.go
*.iml

# Project-Specific
*.cover.out
*.coverprofile

#Vagrant
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.PHONY: build test test-all test-local test-all-local
.PHONY: build coverage test test-all test-local test-all-local

build:
docker build -t socketplane/socketplane .

coverage:
gover
goveralls -coverprofile=gover.coverprofile -service=$(CI_SERVICE) -repotoken=$(COVERALLS_TOKEN)
sh tools/combine-coverage.sh
goveralls -coverprofile=socketplane.coverprofile -service=$(CI_SERVICE) -repotoken=$(COVERALLS_TOKEN)

test:
fig up -d
Expand All @@ -18,11 +18,11 @@ test-all:
fig stop

test-local:
go test -covermode=count -test.short -coverprofile=daemon.coverprofile -coverpkg=./... ./daemon
go test -covermode=count -test.short -coverprofile=datastore.coverprofile -coverpkg=./... ./ipam
go test -covermode=count -test.short -coverprofile=socketplane.coverprofile
go test -covermode=count -test.short -coverprofile=daemon.cover.out -coverpkg=./... ./daemon
go test -covermode=count -test.short -coverprofile=datastore.cover.out -coverpkg=./... ./ipam
go test -covermode=count -test.short -coverprofile=socketplane.cover.out

test-all-local:
go test -covermode=count -coverprofile=daemon.coverprofile -coverpkg=./... ./daemon
go test -covermode=count -coverprofile=datastore.coverprofile -coverpkg=./... ./ipam
go test -covermode=count -coverprofile=socketplane.coverprofile
go test -covermode=count -coverprofile=daemon.cover.out -coverpkg=./... ./daemon
go test -covermode=count -coverprofile=datastore.cover.out -coverpkg=./... ./ipam
go test -covermode=count -coverprofile=socketplane.cover.out
4 changes: 2 additions & 2 deletions tools/combine-coverage.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

echo "mode: count" > coverage.out
cat *.cover.out | grep -v mode: | sort -r | awk '{if($1 != last) {print $0;last=$1}}' >> coverage.out
echo "mode: count" > socketplane.coverprofile
cat *.cover.out | grep -v mode: | sort -r | awk '{if($1 != last) {print $0;last=$1}}' >> socketplane.coverprofile

0 comments on commit c0f8ce4

Please sign in to comment.