File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 99
99
export APP_ENV=test
100
100
# Run tests for the examples directory with coverage
101
101
go test gofr.dev/examples/... -v -short -coverprofile packageWithpbgo.cov -coverpkg=gofr.dev/examples/...
102
- # Filter out generated protobuf files from coverage report
103
- grep -vE '^gofr\.dev\/.*\.pb\.go' packageWithpbgo.cov > profile.cov
102
+ # Filter out auto- generated files by protobuf and gofr framework from coverage report
103
+ grep -vE '^gofr\.dev\/.*( \.pb\.go|hello\.proto|hello_grpc\.pb\.go|health_client\.go|hello_client\.go|hello_gofr\.go|health_gofr\.go) ' packageWithpbgo.cov > profile.cov
104
104
# Display coverage statistics
105
105
go tool cover -func profile.cov
106
106
@@ -147,11 +147,13 @@ jobs:
147
147
command : |
148
148
export APP_ENV=test
149
149
# Run tests for the pkg directory with coverage
150
- go test gofr.dev/pkg/... -v -short -coverprofile package.cov -coverpkg=gofr.dev/pkg/...
150
+ cd pkg
151
+ go test ./... -v -short -coverprofile package.cov -coverpkg=./...
151
152
# Filter out mock files from coverage report
152
153
grep -v '/mock_' package.cov > profile.cov
154
+ mv profile.cov ../profile.cov
153
155
# Display coverage statistics
154
- go tool cover -func profile.cov
156
+ go tool cover -func ../ profile.cov
155
157
156
158
# Upload coverage report for the 1.24 Go version only
157
159
- name : Upload Test Coverage
You can’t perform that action at this time.
0 commit comments