fix(tests): replace gocovmerge with a simple bash script

This commit is contained in:
Łukasz Mierzwa
2020-04-09 09:17:15 +01:00
parent 277b24db0d
commit 25413fb769
5 changed files with 7 additions and 8 deletions
-1
View File
@@ -22,7 +22,6 @@ require (
github.com/go-openapi/validate v0.19.7
github.com/golangci/golangci-lint v1.24.0
github.com/google/go-cmp v0.4.0
github.com/hansboder/gocovmerge v0.0.0-20190813150856-3552c2006da5
github.com/hansrodtang/randomcolor v0.0.0-20160512071917-d27108b3d7a5
github.com/jarcoal/httpmock v1.0.5
github.com/knadh/koanf v0.9.1
-2
View File
@@ -263,8 +263,6 @@ github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.m
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hansboder/gocovmerge v0.0.0-20190813150856-3552c2006da5 h1:PKFOvrFdBuYn8F0GD0itonb8M/DFiSrDYfF54DUIE3M=
github.com/hansboder/gocovmerge v0.0.0-20190813150856-3552c2006da5/go.mod h1:YuynvyiaysiM6eitHFN8mL+lRHEbZFTHG+hVXX1xZf8=
github.com/hansrodtang/randomcolor v0.0.0-20160512071917-d27108b3d7a5 h1:9WT/rQ2tZI0TBZhBsA/dYU1bdI2QKaUzQ3X6YDwaLUY=
github.com/hansrodtang/randomcolor v0.0.0-20160512071917-d27108b3d7a5/go.mod h1:XvzgNvkcPBKMxeywFlPioejZ5ulXi/GMLZDoBw915FA=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
+1 -3
View File
@@ -21,10 +21,8 @@ cmd/karma/bindata_assetfs.go: $(GOBIN)/go-bindata-assetfs $(SOURCES_JS) ui/build
$(NAME): go.mod go.sum cmd/karma/bindata_assetfs.go $(SOURCES_GO)
$(GO) build -ldflags "-X main.version=$(VERSION)" ./cmd/karma
$(GOBIN)/gocovmerge: go.mod go.sum
$(GO) install github.com/hansboder/gocovmerge
.PHONY: test-go
test-go: $(GOBIN)/gocovmerge
test-go:
@rm -f profile.*
$(ENV) ./scripts/test-unit.sh
$(ENV) ./scripts/test-main.sh
+6 -1
View File
@@ -3,7 +3,12 @@
set -o errexit
set -o pipefail
gocovmerge profile.* | grep -vE '^github.com/prymitive/karma/cmd/karma/bindata_assetfs.go:' > coverage.txt
echo "mode: set" > coverage.txt
cat profile.* \
| grep -v mode: \
| grep -vE '^github.com/prymitive/karma/cmd/karma/bindata_assetfs.go:' \
| sort -r \
| awk '{if($1 != last) {print $0;last=$1}}' >> coverage.txt
rm -f profile.*
go tool cover -func coverage.txt | tail -n 1 | awk '{print $3}'
-1
View File
@@ -10,5 +10,4 @@ import (
_ "github.com/elazarl/go-bindata-assetfs"
_ "github.com/go-bindata/go-bindata/v3"
_ "github.com/golangci/golangci-lint/pkg/commands"
_ "github.com/hansboder/gocovmerge"
)