Skip to content
Snippets Groups Projects
Commit a9b7c6d3 authored by Pierre Guilleminot's avatar Pierre Guilleminot Committed by GitHub
Browse files

Merge pull request #113 from nono/coverage

Code coverage with codecov.io
parents 5201830c a5194f90
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,12 @@ before_script: ...@@ -14,6 +14,12 @@ before_script:
- gometalinter --install --update - gometalinter --install --update
- gometalinter --deadline 120s --dupl-threshold 70 -D interfacer -D errcheck -D gocyclo -D dupl ./... - gometalinter --deadline 120s --dupl-threshold 70 -D interfacer -D errcheck -D gocyclo -D dupl ./...
script:
- ./coverage.sh
after_success:
- bash <(curl -s https://codecov.io/bash)
after_failure: after_failure:
- docker ps -a - docker ps -a
- docker logs couch - docker logs couch
...@@ -3,6 +3,7 @@ Cozy Cloud ...@@ -3,6 +3,7 @@ Cozy Cloud
[![GoDoc](https://godoc.org/github.com/cozy/cozy-stack?status.svg)](https://godoc.org/github.com/cozy/cozy-stack) [![GoDoc](https://godoc.org/github.com/cozy/cozy-stack?status.svg)](https://godoc.org/github.com/cozy/cozy-stack)
[![Build Status](https://travis-ci.org/cozy/cozy-stack.svg?branch=master)](https://travis-ci.org/cozy/cozy-stack) [![Build Status](https://travis-ci.org/cozy/cozy-stack.svg?branch=master)](https://travis-ci.org/cozy/cozy-stack)
[![codecov](https://codecov.io/gh/cozy/cozy-stack/branch/master/graph/badge.svg)](https://codecov.io/gh/cozy/cozy-stack)
## What is Cozy? ## What is Cozy?
......
#!/bin/sh #!/bin/bash
set -e set -e
COZY_ENV_DFL=production COZY_ENV_DFL=production
...@@ -15,24 +15,24 @@ if [ -r ${WORK_DIR}/local.env ]; then ...@@ -15,24 +15,24 @@ if [ -r ${WORK_DIR}/local.env ]; then
fi fi
usage() { usage() {
echo "Usage: ${1} [release]" echo -e "Usage: ${1} [release]"
echo "\nCommands:" echo -e "\nCommands:"
echo "\n release: builds a release of the current working-tree" echo -e "\n release: builds a release of the current working-tree"
echo "\nEnvironment variables:" echo -e "\nEnvironment variables:"
echo "\n COZY_ENV" echo -e "\n COZY_ENV"
echo " with release command, specify the environment of the release." echo -e " with release command, specify the environment of the release."
echo " can be \"production\" or \"development\". default: \"${COZY_ENV_DFL}\"" echo -e " can be \"production\" or \"development\". default: \"${COZY_ENV_DFL}\""
echo "\n COZY_DEPLOY_USER" echo -e "\n COZY_DEPLOY_USER"
echo " with deploy command, specify the user used to deploy." echo -e " with deploy command, specify the user used to deploy."
echo " default: \$USER (${USER})" echo -e " default: \$USER (${USER})"
echo "\n COZY_DEPLOY_SERVER" echo -e "\n COZY_DEPLOY_SERVER"
echo " with deploy command, specify the ssh server to deploy on." echo -e " with deploy command, specify the ssh server to deploy on."
echo "\n COZY_DEPLOY_PROXY" echo -e "\n COZY_DEPLOY_PROXY"
echo " with deploy command, specify an ssh proxy to go through." echo -e " with deploy command, specify an ssh proxy to go through."
echo "\n COZY_DEPLOY_POSTSCRIPT" echo -e "\n COZY_DEPLOY_POSTSCRIPT"
echo " with deploy command, specify an optional script to execute" echo -e " with deploy command, specify an optional script to execute"
echo " on the deploy server after deploying." echo -e " on the deploy server after deploying."
} }
# The version string is deterministic and reflects entirely the state # The version string is deterministic and reflects entirely the state
......
#!/usr/bin/env bash
set -e
echo "" > coverage.txt
for d in $(go list ./... | grep -v vendor); do
go test -coverprofile=profile.out -covermode=count $d
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment