소스 검색

chore: travis CI and coverall integration

bigeagle 9 년 전
부모
커밋
66df20cb1d
4개의 변경된 파일54개의 추가작업 그리고 4개의 파일을 삭제
  1. 31 0
      .testandcover.bash
  2. 2 0
      .testpackages.txt
  3. 16 0
      .travis.yml
  4. 5 4
      README.md

+ 31 - 0
.testandcover.bash

@@ -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 - 0
.testpackages.txt

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

+ 16 - 0
.travis.yml

@@ -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

+ 5 - 4
README.md

@@ -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