Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ jobs:
run: go mod download

- name: Run tests with coverage
run: make test
run: make test-coverage-and-junit

- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
# Claude Code
.claude/

# Test coverage output
# Test output
/*.out
/*junit.xml

# Build output
/stackrox-mcp
Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ LDFLAGS=-ldflags "-X github.com/stackrox/stackrox-mcp/internal/server.version=$(
# Coverage files
COVERAGE_OUT=coverage.out

# JUnit files
JUNIT_OUT=junit.xml

# Lint files
LINT_OUT=report.xml

Expand All @@ -33,8 +36,13 @@ build: ## Build the binary
$(GOBUILD) $(LDFLAGS) -o $(BINARY_NAME) ./cmd/stackrox-mcp

.PHONY: test
test: ## Run unit tests with coverage
$(GOTEST) -v -cover -coverprofile=$(COVERAGE_OUT) ./...
test: ## Run unit tests
$(GOTEST) -v ./...

.PHONY: test-coverage-and-junit
test-coverage-and-junit: ## Run unit tests with coverage and junit output
go install github.com/jstemmer/go-junit-report/[email protected]
$(GOTEST) -v -cover -race -coverprofile=$(COVERAGE_OUT) ./... -json 2>&1 | tee go-junit-report -parser gojson > $(JUNIT_OUT)

.PHONY: coverage-html
coverage-html: test ## Generate and open HTML coverage report
Expand Down
Loading