Issue #657 - Use codecov to collect test coverage (#717)

This commit is contained in:
Alexander Matyushentsev 2018-10-23 14:42:41 -07:00 committed by GitHub
parent cb3656b45c
commit dca1996640
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 17 deletions

View file

@ -29,13 +29,7 @@ spec:
- name: cmd
value: "{{item}}"
withItems:
- dep ensure && make cli lint
- name: test-coverage
template: ci-builder
arguments:
parameters:
- name: cmd
value: "dep ensure && go get github.com/mattn/goveralls && make test-coverage"
- dep ensure && make cli lint test && bash <(curl -s https://codecov.io/bash) -f coverage.out
- name: test-e2e
template: ci-builder
arguments:
@ -55,15 +49,15 @@ spec:
revision: "{{workflow.parameters.revision}}"
container:
image: argoproj/argo-cd-ci-builder:latest
command: [sh, -c]
command: [bash, -c]
args: ["mkfifo pipe; tee /tmp/logs.txt < pipe & {{inputs.parameters.cmd}} > pipe"]
workingDir: /go/src/github.com/argoproj/argo-cd
env:
- name: COVERALLS_TOKEN
- name: CODECOV_TOKEN
valueFrom:
secretKeyRef:
name: coverall-token
key: coverall-token
name: codecov-token
key: codecov-token
resources:
requests:
memory: 1024Mi

2
.codecov.yml Normal file
View file

@ -0,0 +1,2 @@
ignore:
- "**/*.pb.go"

View file

@ -124,12 +124,7 @@ lint:
.PHONY: test
test:
go test -v `go list ./... | grep -v "github.com/argoproj/argo-cd/test/e2e"`
.PHONY: test-coverage
test-coverage:
go test -v -covermode=count -coverprofile=coverage.out `go list ./... | grep -v "github.com/argoproj/argo-cd/test/e2e"`
@if [ "$(COVERALLS_TOKEN)" != "" ] ; then goveralls -ignore `find . -name '*.pb*.go' | grep -v vendor/ | sed 's!^./!!' | paste -d, -s -` -coverprofile=coverage.out -service=argo-ci -repotoken "$(COVERALLS_TOKEN)"; else echo 'No COVERALLS_TOKEN env var specified. Skipping submission to Coveralls.io'; fi
.PHONY: test-e2e
test-e2e:

View file

@ -1,4 +1,4 @@
[![Coverage Status](https://coveralls.io/repos/github/argoproj/argo-cd/badge.svg?branch=master)](https://coveralls.io/github/argoproj/argo-cd?branch=master)
[![codecov](https://codecov.io/gh/argoproj/argo-cd/branch/master/graph/badge.svg)](https://codecov.io/gh/argoproj/argo-cd)
# Argo CD - Declarative Continuous Delivery for Kubernetes