Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
ci: add code coverage as part of CI (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest Wong committed Jul 24, 2020
1 parent 56d3a6b commit 9d3ac2f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -323,3 +323,6 @@ __pycache__/

# Go tools
.tools/

# cover profile
coverage.txt
4 changes: 4 additions & 0 deletions .pipelines/unit-tests-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
displayName: Build
- script: make unit-test
displayName: Run unit tests
- script: bash <(curl -s https://codecov.io/bash)
displayName: Upload coverage to codecov
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- script: make lint
displayName: Run lint
- script: make helm-lint
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ e2e:

.PHONY: unit-test
unit-test:
GOOS=$(TEST_GOOS) go test -race -count=1 $(shell go list ./... | grep -v /test/e2e) -v
GOOS=$(TEST_GOOS) CGO_ENABLED=1 go test -race -coverprofile=coverage.txt -covermode=atomic -count=1 $(shell go list ./... | grep -v /test/e2e) -v

.PHONY: validate-version
validate-version: validate-version-NMI validate-version-MIC validate-version-IDENTITY_VALIDATOR validate-version-DEMO
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# AAD Pod Identity

[![Build Status](https://dev.azure.com/azure/aad-pod-identity/_apis/build/status/aad-pod-identity-nightly?branchName=master)](https://dev.azure.com/azure/aad-pod-identity/_build/latest?definitionId=77&branchName=master)
[![codecov](https://codecov.io/gh/Azure/aad-pod-identity/branch/master/graph/badge.svg)](https://codecov.io/gh/Azure/aad-pod-identity)
[![GoDoc](https://godoc.org/github.com/Azure/aad-pod-identity?status.svg)](https://godoc.org/github.com/Azure/aad-pod-identity)
[![Go Report Card](https://goreportcard.com/badge/github.com/Azure/aad-pod-identity)](https://goreportcard.com/report/github.com/Azure/aad-pod-identity)

Expand Down
32 changes: 32 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
codecov:
notify:
require_ci_to_pass: no

coverage:
precision: 2
round: down
range: "50...100"
status:
project:
default:
threshold: 0.5
patch:
default:
threshold: 0.5
changes: no

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "header, diff"
behavior: default
require_changes: no

ignore:
- "test/**/*.go"

0 comments on commit 9d3ac2f

Please sign in to comment.