refact
This commit is contained in:
parent
6ba6356777
commit
3bf29d8352
7
.github/workflows/coverage.yml
vendored
7
.github/workflows/coverage.yml
vendored
@ -19,15 +19,16 @@ jobs:
|
|||||||
|
|
||||||
- name: deps
|
- name: deps
|
||||||
run: make deps
|
run: make deps
|
||||||
- name: vet
|
|
||||||
run: make vet
|
|
||||||
- name: unit tests
|
- name: unit tests
|
||||||
run: make test-coverage
|
run: make test
|
||||||
|
|
||||||
- name: Quality Gate - Test coverage shall be above threshold
|
- name: Quality Gate - Test coverage shall be above threshold
|
||||||
env:
|
env:
|
||||||
TESTCOVERAGE_THRESHOLD: 0
|
TESTCOVERAGE_THRESHOLD: 0
|
||||||
run: |
|
run: |
|
||||||
|
go test ./... -coverprofile coverage.out -covermode count
|
||||||
|
go tool cover -func coverage.out
|
||||||
echo "Quality Gate: checking test coverage is above threshold ..."
|
echo "Quality Gate: checking test coverage is above threshold ..."
|
||||||
echo "Threshold : $TESTCOVERAGE_THRESHOLD %"
|
echo "Threshold : $TESTCOVERAGE_THRESHOLD %"
|
||||||
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
|
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
|
||||||
|
|||||||
16
Makefile
16
Makefile
@ -1,4 +1,4 @@
|
|||||||
.PHONY: proto test test-coverage vet deps
|
.PHONY: proto test deps
|
||||||
export GOPRIVATE=github.com/anytypeio
|
export GOPRIVATE=github.com/anytypeio
|
||||||
export PATH:=deps:$(PATH)
|
export PATH:=deps:$(PATH)
|
||||||
|
|
||||||
@ -16,17 +16,11 @@ proto:
|
|||||||
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. commonspace/spacesyncproto/protos/*.proto
|
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. commonspace/spacesyncproto/protos/*.proto
|
||||||
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. commonfile/fileproto/protos/*.proto
|
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. commonfile/fileproto/protos/*.proto
|
||||||
|
|
||||||
vet:
|
|
||||||
go vet ./...
|
|
||||||
|
|
||||||
test:
|
|
||||||
go test ./... --cover
|
|
||||||
|
|
||||||
test-coverage:
|
|
||||||
go test ./... -coverprofile coverage.out -covermode count
|
|
||||||
go tool cover -func coverage.out
|
|
||||||
|
|
||||||
deps:
|
deps:
|
||||||
go mod download
|
go mod download
|
||||||
go build -o deps storj.io/drpc/cmd/protoc-gen-go-drpc
|
go build -o deps storj.io/drpc/cmd/protoc-gen-go-drpc
|
||||||
go build -o deps github.com/gogo/protobuf/protoc-gen-gogofaster
|
go build -o deps github.com/gogo/protobuf/protoc-gen-gogofaster
|
||||||
|
|
||||||
|
test:
|
||||||
|
go test ./... --cover
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user