chore: travis CI and coverall integration

This commit is contained in:
bigeagle 2016-04-10 22:40:48 +08:00
parent ed896b16c1
commit 66df20cb1d
No known key found for this signature in database
GPG Key ID: 9171A4571C27920A
4 changed files with 54 additions and 4 deletions

31
.testandcover.bash Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
function die() {
echo $*
exit 1
}
export GOPATH=`pwd`:$GOPATH
# Initialize profile.cov
echo "mode: count" > profile.cov
# Initialize error tracking
ERROR=""
# Test each package and append coverage profile info to profile.cov
for pkg in `cat .testpackages.txt`
do
#$HOME/gopath/bin/
go test -v -covermode=count -coverprofile=profile_tmp.cov $pkg || ERROR="Error testing $pkg"
[ -f profile_tmp.cov ] && {
tail -n +2 profile_tmp.cov >> profile.cov || die "Unable to append coverage for $pkg"
}
done
if [ ! -z "$ERROR" ]
then
die "Encountered error, last error was: $ERROR"
fi

2
.testpackages.txt Normal file
View File

@ -0,0 +1,2 @@
github.com/tuna/tunasync/internal
github.com/tuna/tunasync/manager

16
.travis.yml Normal file
View File

@ -0,0 +1,16 @@
language: go
go:
- 1.6
before_install:
- go get golang.org/x/tools/cmd/cover
- go get -v github.com/mattn/goveralls
os:
- linux
script:
- ./.testandcover.bash
after_success:
- goveralls -coverprofile=profile.cov -service=travis-ci

View File

@ -1,9 +1,8 @@
tunasync
========
## Ideas
- use [etcd](https://github.com/coreos/etcd) to store configurations and state variables
[![Build Status](https://travis-ci.org/tuna/tunasync.svg?branch=dev)](https://travis-ci.org/tuna/tunasync)
[![Coverage Status](https://coveralls.io/repos/github/tuna/tunasync/badge.svg?branch=dev)](https://coveralls.io/github/tuna/tunasync?branch=dev)
## Design
@ -39,7 +38,9 @@ tunasync
## TODO
- [ ] split to `tunasync-manager` and `tunasync-worker` instances
- use HTTP as communication protocol
- [ ] use HTTP as communication protocol
- [ ] implement manager as status server first, and use python worker
- [ ] implement go worker
- Web frontend for `tunasync-manager`
- [ ] start/stop/restart job
- [ ] enable/disable mirror