Skip to content

Commit c0f8ce4

Browse files
committed
Merge pull request socketplane#123 from dave-tucker/coverage
Experimentation with coverage
2 parents ff50c1f + b58d4cf commit c0f8ce4

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ _testmain.go
2929
*.iml
3030

3131
# Project-Specific
32+
*.cover.out
3233
*.coverprofile
3334

3435
#Vagrant

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
.PHONY: build test test-all test-local test-all-local
1+
.PHONY: build coverage test test-all test-local test-all-local
22

33
build:
44
docker build -t socketplane/socketplane .
55

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

1010
test:
1111
fig up -d
@@ -18,11 +18,11 @@ test-all:
1818
fig stop
1919

2020
test-local:
21-
go test -covermode=count -test.short -coverprofile=daemon.coverprofile -coverpkg=./... ./daemon
22-
go test -covermode=count -test.short -coverprofile=datastore.coverprofile -coverpkg=./... ./ipam
23-
go test -covermode=count -test.short -coverprofile=socketplane.coverprofile
21+
go test -covermode=count -test.short -coverprofile=daemon.cover.out -coverpkg=./... ./daemon
22+
go test -covermode=count -test.short -coverprofile=datastore.cover.out -coverpkg=./... ./ipam
23+
go test -covermode=count -test.short -coverprofile=socketplane.cover.out
2424

2525
test-all-local:
26-
go test -covermode=count -coverprofile=daemon.coverprofile -coverpkg=./... ./daemon
27-
go test -covermode=count -coverprofile=datastore.coverprofile -coverpkg=./... ./ipam
28-
go test -covermode=count -coverprofile=socketplane.coverprofile
26+
go test -covermode=count -coverprofile=daemon.cover.out -coverpkg=./... ./daemon
27+
go test -covermode=count -coverprofile=datastore.cover.out -coverpkg=./... ./ipam
28+
go test -covermode=count -coverprofile=socketplane.cover.out

tools/combine-coverage.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

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

0 commit comments

Comments
 (0)