Skip to content

Commit

Permalink
chore: imporve test cover
Browse files Browse the repository at this point in the history
  • Loading branch information
qloog committed Jan 21, 2025
1 parent d84928b commit acb9a0b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ jobs:
with:
ref: ${{ github.ref }}

# - name: Run Unit tests
# run: |
# make test
# make cover
- name: Run Unit tests
run: |
make test
make cover
- name: Upload Coverage to CodeCov
uses: codecov/codecov-action@v3
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ logs
eagle-layout
cmd/consumer/consumer
cmd/server/server
coverage.txt
coverage.out
internal/dal/db/dao/gen_test.db
bin
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ vet:
.PHONY: cover
# make cover
cover:
@go test -short -coverprofile=coverage.txt -covermode=atomic ${PKG_LIST}
@go test -short -coverprofile=coverage.out -covermode=atomic ${PKG_LIST}

.PHONY: view-cover
# make view-cover preview coverage
view-cover:
go tool cover -html=coverage.txt -o coverage.html
# make view-cover preview coverage report
view-cover: cover
go tool cover -html=coverage.out

.PHONY: image
# make image 生成docker镜像, eg: make image GIT_TAG=v1.0.0
Expand Down

0 comments on commit acb9a0b

Please sign in to comment.