From 36965bee5ef35ab2d001bb62352a4fd2e9ff59dc Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Mon, 6 Aug 2018 23:58:21 -0400 Subject: [PATCH] Testing Codecov (#375) --- .gitignore | 4 ++++ .travis.yml | 6 ++++++ coverage.sh | 12 ++++++++++++ 3 files changed, 22 insertions(+) create mode 100755 coverage.sh diff --git a/.gitignore b/.gitignore index 29ce9bf8b54..5093239a4fa 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ bazel-* # delve debugger output (not sure how to get rid of these) **/debug.test + +# Coverage outputs +coverage.txt +profile.out diff --git a/.travis.yml b/.travis.yml index 8749fa70421..53a04a7b1e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,12 @@ matrix: script: - go get github.com/alecthomas/gometalinter && gometalinter --install && gometalinter ./... --deadline=10m --exclude=client/internal/client_helper.go + - os: linux + env: + - coverage + script: + - ./coverage.sh + - bash <(curl -s https://codecov.io/bash) - os: linux env: V=0.15.0 before_install: diff --git a/coverage.sh b/coverage.sh new file mode 100755 index 00000000000..494b176ba10 --- /dev/null +++ b/coverage.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e +echo "" > coverage.txt + +for d in $(go list ./... | grep -v vendor); do + go test -coverprofile=profile.out -covermode=atomic $d + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done