Explorar o código

Improve test coverage

Jackson Tian %!s(int64=7) %!d(string=hai) anos
pai
achega
fd370f09fc
Modificáronse 2 ficheiros con 13 adicións e 1 borrados
  1. 1 1
      .travis.yml
  2. 12 0
      test.sh

+ 1 - 1
.travis.yml

@@ -27,7 +27,7 @@ script:
   - go vet ./services/...
   - go build ./sdk
   - go build ./services/...
-  - go test -race -coverprofile=coverage.txt -covermode=atomic ./sdk/...
+  - bash ./test.sh
   #- go test -v -timeout 60s ./integration/...
 
 after_success:

+ 12 - 0
test.sh

@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+set -e
+echo "" > coverage.txt
+
+for d in $(go list ./sdk/... | 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