Skip to content

Commit

Permalink
Report more accurate code coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Mar 27, 2020
1 parent 283d8c2 commit dcbb3d5
Show file tree
Hide file tree
Showing 4 changed files with 561 additions and 15 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ALL_DOC := $(shell find . \( -name "*.md" -o -name "*.yaml" \) \
ALL_PKGS := $(shell go list $(sort $(dir $(ALL_SRC))))

GOTEST_OPT?= -race -timeout 180s
GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -coverprofile=coverage.txt -covermode=atomic
GO_ACC=go-acc
GOTEST=go test
GOOS=$(shell go env GOOS)
GOARCH=$(shell go env GOARCH)
Expand Down Expand Up @@ -65,8 +65,7 @@ test-with-cover:
@scripts/check-test-files.sh $(subst github.com/open-telemetry/opentelemetry-collector/,./,$(ALL_PKGS))
@echo pre-compiling tests
@time go test -i $(ALL_PKGS)
echo "mode: atomic" > coverage_all.txt
echo $(ALL_PKGS) | xargs -n 10 bash -c 'mv coverage_all.txt coverage_old.txt; $(GOTEST) $(GOTEST_OPT_WITH_COVERAGE) "$$@"; gocovmerge coverage_old.txt coverage.txt > coverage_all.txt' ''
$(GO_ACC) $(ALL_PKGS)
go tool cover -html=coverage_all.txt -o coverage.html

.PHONY: addlicense
Expand Down
19 changes: 10 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/VividCortex/gohistogram v1.0.0 // indirect
github.com/apache/thrift v0.0.0-20161221203622-b2a4d4ae21c7
github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b // indirect
github.com/cenkalti/backoff v0.0.0-20181003080854-62661b46c409
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/census-instrumentation/opencensus-proto v0.2.1
github.com/client9/misspell v0.3.4
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect
Expand All @@ -27,35 +27,36 @@ require (
github.com/hashicorp/consul/api v1.2.0 // indirect
github.com/jaegertracing/jaeger v1.17.0
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
github.com/mitchellh/mapstructure v1.1.2
github.com/mitchellh/mapstructure v1.2.2
github.com/open-telemetry/opentelemetry-proto v0.3.0
github.com/openzipkin/zipkin-go v0.2.1
github.com/orijtech/prometheus-go-metrics-exporter v0.0.3-0.20190313163149-b321c5297f60
github.com/ory/go-acc v0.2.1 // indirect
github.com/ory/x v0.0.109 // indirect
github.com/pavius/impi v0.0.0-20180302134524-c1cbdcb8df2b
github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.9.1
github.com/prashantv/protectmem v0.0.0-20171002184600-e20412882b3a // indirect
github.com/prometheus/client_golang v1.1.0
github.com/prometheus/common v0.7.0
github.com/prometheus/procfs v0.0.3
github.com/prometheus/prometheus v1.8.2-0.20190924101040-52e0504f83ea
github.com/rs/cors v1.6.0
github.com/securego/gosec v0.0.0-20200316084457-7da9f46445fd
github.com/sirupsen/logrus v1.5.0 // indirect
github.com/soheilhy/cmux v0.1.4
github.com/spf13/cast v1.3.0
github.com/spf13/cobra v0.0.5
github.com/spf13/cast v1.3.1
github.com/spf13/cobra v0.0.6
github.com/spf13/viper v1.6.2
github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25 // indirect
github.com/stretchr/testify v1.4.0
github.com/uber-go/atomic v1.4.0 // indirect
github.com/uber/jaeger-client-go v2.16.0+incompatible // indirect
github.com/uber/jaeger-lib v2.2.0+incompatible
github.com/uber/tchannel-go v1.10.0
github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad
go.opencensus.io v0.22.1
go.uber.org/zap v1.10.0
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e
golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775
google.golang.org/api v0.10.0 // indirect
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55
google.golang.org/grpc v1.23.0
gopkg.in/yaml.v2 v2.2.8
honnef.co/go/tools v0.0.1-2020.1.3
Expand Down
Loading

0 comments on commit dcbb3d5

Please sign in to comment.