Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report more accurate code coverage #723

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 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,9 +65,8 @@ 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 tool cover -html=coverage_all.txt -o coverage.html
$(GO_ACC) $(ALL_PKGS)
go tool cover -html=coverage.txt -o coverage.html

.PHONY: addlicense
addlicense:
Expand Down Expand Up @@ -124,7 +123,7 @@ install-tools:
go install github.com/pavius/impi/cmd/impi
go install github.com/securego/gosec/cmd/gosec
go install honnef.co/go/tools/cmd/staticcheck
go install github.com/wadey/gocovmerge
go install github.com/ory/go-acc

.PHONY: otelcol
otelcol:
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