From d13141ce6e5c805f7c5696d13528c9a50d967507 Mon Sep 17 00:00:00 2001 From: Cesar Gimenes Date: Thu, 8 Dec 2016 10:57:25 -0200 Subject: [PATCH 1/4] Add codecov.io call to Travis file --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5a556d9fd..5e0b94acc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,3 +25,6 @@ before_script: script: - go test -v -race ./... + +after_success: + - bash <(curl -s https://codecov.io/bash) From f8e8092118c545f9f7c352779b602b5e367b10d4 Mon Sep 17 00:00:00 2001 From: Cesar Gimenes Date: Thu, 8 Dec 2016 11:17:14 -0200 Subject: [PATCH 2/4] add coverprofile and covermode --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5e0b94acc..3df71d13f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: - psql prest -c 'create table test(name text);' -U postgres script: - - go test -v -race ./... + - go test -v -race ./... -coverprofile=coverage.txt -covermode=atomic after_success: - bash <(curl -s https://codecov.io/bash) From db47fbf482227379f23bbe8a6695cc9cb83a5eb5 Mon Sep 17 00:00:00 2001 From: Cesar Gimenes Date: Thu, 8 Dec 2016 11:31:45 -0200 Subject: [PATCH 3/4] add test.sh and update travis config file. --- .travis.yml | 2 +- coverage.txt | 1 + test.sh | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 coverage.txt create mode 100755 test.sh diff --git a/.travis.yml b/.travis.yml index 3df71d13f..82ad32ae3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: - psql prest -c 'create table test(name text);' -U postgres script: - - go test -v -race ./... -coverprofile=coverage.txt -covermode=atomic + - sh test.sh after_success: - bash <(curl -s https://codecov.io/bash) diff --git a/coverage.txt b/coverage.txt new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/coverage.txt @@ -0,0 +1 @@ + diff --git a/test.sh b/test.sh new file mode 100755 index 000000000..34dbbfb31 --- /dev/null +++ b/test.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 -race -coverprofile=profile.out -covermode=atomic $d + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done From e0ac8374cd8742c380550f09269b950894d7b89e Mon Sep 17 00:00:00 2001 From: Cesar Gimenes Date: Thu, 8 Dec 2016 11:45:37 -0200 Subject: [PATCH 4/4] add https://codecov.io link to README file --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 551f234bd..93023843c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://travis-ci.org/nuveo/prest.svg?branch=master)](https://travis-ci.org/nuveo/prest) [![GoDoc](https://godoc.org/github.com/nuveo/prest?status.png)](https://godoc.org/github.com/nuveo/prest) [![Go Report Card](https://goreportcard.com/badge/github.com/nuveo/prest)](https://goreportcard.com/report/github.com/nuveo/prest) +[![codecov](https://codecov.io/gh/nuveo/prest/branch/master/graph/badge.svg)](https://codecov.io/gh/nuveo/prest) Serve a RESTful API from any PostgreSQL database