-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #61
- Loading branch information
Showing
4 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
language: go | ||
go: | ||
- 1.5 | ||
|
||
before_install: | ||
- go get -u github.com/axw/gocov/gocov | ||
- go get -u github.com/mattn/goveralls | ||
- go get golang.org/x/tools/cmd/cover | ||
|
||
before_script: | ||
- ./scripts/travis/get-thrift.sh | ||
- ./scripts/travis/get-thrift-gen.sh | ||
- go get github.com/vektra/mockery/.../ | ||
|
||
env: | ||
- RUN="make test_ci" | ||
- RUN="test/update-coveralls" | ||
|
||
matrix: | ||
allow_failures: | ||
- env: RUN="test/update-coveralls" | ||
fast_finish: true | ||
|
||
script: | ||
- make test_ci | ||
- test/travis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
# | ||
# Run Travis CI scripts from an environment variable. | ||
# | ||
# This script evaluates and executes the command string from the RUN | ||
# environment variable. | ||
# | ||
# It allows you to execute different commands in a test matrix on Travis CI, | ||
# based on env vars in your .travis.yml. | ||
# | ||
declare RUN_DEFAULT="" | ||
|
||
# Perform default action if none specified | ||
if [ -z "$RUN" ]; then | ||
RUN=$RUN_DEFAULT | ||
fi | ||
|
||
# Exit with error if there's nothing to do | ||
if [ -z "$RUN" ]; then | ||
echo "ERROR: No actions specified and no default actions. Exiting." >&2 | ||
exit 1 | ||
fi | ||
|
||
# Execute the command string; echo the commands as they run | ||
eval "set -x; $RUN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
# | ||
# Send coverage data to coveralls.io | ||
# | ||
# `go test -coverprofile=` only supports generating a coverage profile for one | ||
# package at a time. This script combines coverage data from multiple packages | ||
# and then sends the coverage data to coveralls.io | ||
# | ||
echo "mode: set" > acc.out | ||
FAIL=0 | ||
|
||
packages="$(find . -type d -maxdepth 3 \ | ||
! -path './.git*' \ | ||
! -path '*/_*' \ | ||
! -path './Godeps*' \ | ||
! -path './test*' \ | ||
)" | ||
|
||
# Standard go tooling behavior is to ignore dirs with leading underscores | ||
for dir in $packages; | ||
do | ||
if ls $dir/*.go &> /dev/null; then | ||
go test -coverprofile=profile.out $dir || FAIL=$? | ||
if [ -f profile.out ] | ||
then | ||
cat profile.out | grep -v "mode: set" | grep -v "mocks.go" >> acc.out | ||
rm profile.out | ||
fi | ||
fi | ||
done | ||
|
||
# Failures have incomplete results, so don't send | ||
if [ "$FAIL" -eq 0 ]; then | ||
goveralls -service=travis-ci -v -coverprofile=acc.out | ||
fi | ||
|
||
rm -f acc.out | ||
|
||
exit $FAIL |