Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion .github/workflows/build-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ jobs:

- name: Run tests
run: |-
go test -v ./...
go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...

- name: Check test coverage
uses: vladopajic/go-test-coverage@cc5012c2cfa84542e02b079141958a885861d326 # v2.17.0
with:
config: ./.testcoverage.yml

- name: Build
run: |-
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ result-*
dist/

# Go
go.work
go.work
cover.out
cover.html
22 changes: 22 additions & 0 deletions .testcoverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# (mandatory)
# Path to coverage profile file (output of `go test -coverprofile` command).
#
# For cases where there are many coverage profiles, such as when running
# unit tests and integration tests separately, you can combine all those
# profiles into one. In this case, the profile should have a comma-separated list
# of profile files, e.g., 'cover_unit.out,cover_integration.out'.
profile: cover.out

# Holds coverage thresholds percentages, values should be in range [0-100].
threshold:
# (optional; default 0)
# Minimum coverage percentage required for individual files.
file: 70

# (optional; default 0)
# Minimum coverage percentage required for each package.
package: 80

# (optional; default 0)
# Minimum overall project coverage percentage required.
total: 95
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.PHONY: check-coverage
check-coverage:
go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
go tool cover -html=cover.out -o=cover.html
echo now open cover.html
1 change: 1 addition & 0 deletions cmd/multigres-operator/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ import (

func TestNothing(t *testing.T) {
// TODO: write real tests
main()
}
Loading