Skip to content

Commit

Permalink
codecov: closes #334
Browse files Browse the repository at this point in the history
  • Loading branch information
ebuchman committed Jan 18, 2018
1 parent fdc7316 commit 8c6a2d7
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

#
# This codecov.yml is the default configuration for
# all repositories on Codecov. You may adjust the settings
# below in your own codecov.yml in your repository.
#
coverage:
precision: 2
round: down
range: 70...100

status:
# Learn more at https://codecov.io/docs#yaml_default_commit_status
project:
default:
threshold: 1% # allow this much decrease on project
changes: false

comment:
layout: "header, diff"
behavior: default # update if exists else create new

ignore:
- "docs"
- "*.md"
- "*.rst"
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ BUILD_FLAGS = -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=`git r

all: check_tools get_vendor_deps build test

########################################
### CI

ci: get_tools get_vendor_deps build test_cover

########################################
### Build

Expand Down Expand Up @@ -44,6 +49,9 @@ test: test_unit # test_cli
test_unit:
@go test $(PACKAGES)

test_cover:
@bash test_cover.sh

test_tutorial:
@shelldown ${TUTORIALS}
@for script in docs/guide/*.sh ; do \
Expand Down
4 changes: 3 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ dependencies:

test:
override:
- "cd $REPO && make get_tools && make all"
- "cd $REPO && make ci"
- ls $GOPATH/bin
- bash <(curl -s https://codecov.io/bash) -f coverage.txt

14 changes: 14 additions & 0 deletions test_cover.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -e

PKGS=$(go list ./... | grep -v /vendor/)

set -e
echo "mode: atomic" > coverage.txt
for pkg in ${PKGS[@]}; do
go test -v -timeout 30m -race -coverprofile=profile.out -covermode=atomic "$pkg"
if [ -f profile.out ]; then
tail -n +2 profile.out >> coverage.txt;
rm profile.out
fi
done

0 comments on commit 8c6a2d7

Please sign in to comment.