Skip to content

Commit 9b6f2a9

Browse files
committed
setup junit output
Signed-off-by: Tomasz Janiszewski <[email protected]>
1 parent fe67e29 commit 9b6f2a9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ jobs:
3232
- name: Run tests with coverage
3333
run: make test
3434

35+
- name: Upload test results to Codecov
36+
if: ${{ !cancelled() }}
37+
uses: codecov/test-results-action@v1
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
3541
- name: Upload coverage to Codecov
3642
uses: codecov/codecov-action@v5
3743
with:

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ LDFLAGS=-ldflags "-X github.com/stackrox/stackrox-mcp/internal/server.version=$(
2020
# Coverage files
2121
COVERAGE_OUT=coverage.out
2222

23+
#jUnit files
24+
JUNIT_OUT=junit.xml
25+
2326
# Lint files
2427
LINT_OUT=report.xml
2528

@@ -34,7 +37,8 @@ build: ## Build the binary
3437

3538
.PHONY: test
3639
test: ## Run unit tests with coverage
37-
$(GOTEST) -v -cover -coverprofile=$(COVERAGE_OUT) ./...
40+
go install github.com/jstemmer/go-junit-report/[email protected]
41+
$(GOTEST) -v -cover -coverprofile=$(COVERAGE_OUT) ./... -json 2>&1 | go-junit-report -parser gojson > tests.xml
3842

3943
.PHONY: coverage-html
4044
coverage-html: test ## Generate and open HTML coverage report

0 commit comments

Comments
 (0)