mirror of
https://github.com/luscis/openlan.git
synced 2025-10-28 11:11:45 +08:00
fea: make: output coverage html
This commit is contained in:
2
.github/workflows/codecov.yml
vendored
2
.github/workflows/codecov.yml
vendored
@@ -24,6 +24,6 @@ jobs:
|
|||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
files: ./coverage.cov
|
files: ./coverage.out
|
||||||
name: codecov
|
name: codecov
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -11,7 +11,8 @@
|
|||||||
# Test binary, build with `go test -c`
|
# Test binary, build with `go test -c`
|
||||||
*.test
|
*.test
|
||||||
*.idea
|
*.idea
|
||||||
*.cov
|
coverage.out
|
||||||
|
coverage.html
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
*.out
|
*.out
|
||||||
|
|||||||
14
Makefile
14
Makefile
@@ -64,7 +64,6 @@ vendor: update
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
@mkdir -p $(BD)
|
@mkdir -p $(BD)
|
||||||
@mkdir -p $(CD)
|
|
||||||
@go version
|
@go version
|
||||||
@gofmt -w -s ./pkg ./cmd ./misc
|
@gofmt -w -s ./pkg ./cmd ./misc
|
||||||
|
|
||||||
@@ -197,9 +196,12 @@ test: ## execute unit test
|
|||||||
|
|
||||||
## coverage
|
## coverage
|
||||||
cover: env ## execute unit test and output coverage
|
cover: env ## execute unit test and output coverage
|
||||||
go test -mod=vendor github.com/luscis/openlan/pkg/access -coverprofile=$(CD)/access.txt -race -covermode=atomic
|
@rm -rvf $(CD)
|
||||||
go test -mod=vendor github.com/luscis/openlan/pkg/libol -coverprofile=$(CD)/libol.txt -race -covermode=atomic
|
@mkdir -p $(CD)
|
||||||
go test -mod=vendor github.com/luscis/openlan/pkg/models -coverprofile=$(CD)/models.txt -race -covermode=atomic
|
go test -mod=vendor github.com/luscis/openlan/pkg/access -coverprofile=$(CD)/access.out -race -covermode=atomic
|
||||||
|
go test -mod=vendor github.com/luscis/openlan/pkg/libol -coverprofile=$(CD)/libol.out -race -covermode=atomic
|
||||||
|
go test -mod=vendor github.com/luscis/openlan/pkg/models -coverprofile=$(CD)/models.out -race -covermode=atomic
|
||||||
|
|
||||||
echo 'mode: atomic' > $(SD)/coverage.cov
|
echo 'mode: atomic' > $(SD)/coverage.out
|
||||||
tail -q -n +2 $(CD)/*.txt >> $(SD)/coverage.cov
|
tail -q -n +2 $(CD)/*.out >> $(SD)/coverage.out
|
||||||
|
go tool cover -html=coverage.out -o coverage.html
|
||||||
|
|||||||
Reference in New Issue
Block a user