File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 3030 run : go mod download
3131
3232 - name : Run tests with coverage
33- run : make test
33+ run : make test-coverage-and-junit
34+
35+ - name : Upload test results to Codecov
36+ uses : codecov/test-results-action@v1
37+ with :
38+ token : ${{ secrets.CODECOV_TOKEN }}
3439
3540 - name : Upload coverage to Codecov
3641 uses : codecov/codecov-action@v5
Original file line number Diff line number Diff line change 66# Claude Code
77.claude /
88
9- # Test coverage output
9+ # Test output
1010/* .out
11+ /* junit.xml
1112
1213# Build output
1314/stackrox-mcp
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ LDFLAGS=-ldflags "-X github.com/stackrox/stackrox-mcp/internal/server.version=$(
2020# Coverage files
2121COVERAGE_OUT =coverage.out
2222
23+ # JUnit files
24+ JUNIT_OUT =junit.xml
25+
2326# Lint files
2427LINT_OUT =report.xml
2528
@@ -33,8 +36,13 @@ build: ## Build the binary
3336 $(GOBUILD ) $(LDFLAGS ) -o $(BINARY_NAME ) ./cmd/stackrox-mcp
3437
3538.PHONY : test
36- test : # # Run unit tests with coverage
37- $(GOTEST ) -v -cover -coverprofile=$(COVERAGE_OUT ) ./...
39+ test : # # Run unit tests
40+ $(GOTEST ) -v ./...
41+
42+ .PHONY : test-coverage-and-junit
43+ test-coverage-and-junit : # # Run unit tests with coverage and junit output
44+ go install github.com/jstemmer/go-junit-report/
[email protected] 45+ $(GOTEST ) -v -cover -race -coverprofile=$(COVERAGE_OUT ) ./... -json 2>&1 | go-junit-report -parser gojson > $(JUNIT_OUT )
3846
3947.PHONY : coverage-html
4048coverage-html : test # # Generate and open HTML coverage report
You can’t perform that action at this time.
0 commit comments