Browse Source

improve test coverage

Jackson Tian 7 years ago
parent
commit
12c7110bba
3 changed files with 4 additions and 4 deletions
  1. 2 2
      .travis.yml
  2. 1 1
      Makefile
  3. 1 1
      sdk/utils/debug_test.go

+ 2 - 2
.travis.yml

@@ -27,8 +27,8 @@ script:
   - go vet ./services/...
   - go vet ./services/...
   - go build ./sdk
   - go build ./sdk
   - go build ./services/...
   - go build ./services/...
-  - bash ./test.sh
-  - go test -v -timeout 60m ./integration/...
+  - go test -race -coverprofile=coverage.txt -covermode=atomic ./sdk/...
+  - go test -v -timeout 60s ./integration/...
 
 
 after_success:
 after_success:
   - bash <(curl -s https://codecov.io/bash)
   - bash <(curl -s https://codecov.io/bash)

+ 1 - 1
Makefile

@@ -5,5 +5,5 @@ fmt:
 	go fmt ./sdk ./integration ./services/...
 	go fmt ./sdk ./integration ./services/...
 
 
 test:
 test:
-	go test -coverprofile=coverage.txt -covermode=atomic ./sdk
+	go test -race -coverprofile=coverage.txt -covermode=atomic ./sdk/...
 	go tool cover -html=coverage.txt -o coverage.html
 	go tool cover -html=coverage.txt -o coverage.html

+ 1 - 1
sdk/utils/debug_test.go

@@ -5,7 +5,7 @@ import (
   // "fmt"
   // "fmt"
 )
 )
 
 
-func TestMain(m *testing.M) {
+func TestMain(t *testing.T) {
   debug := Init("sdk")
   debug := Init("sdk")
   debug("%s", "testing")
   debug("%s", "testing")
 }
 }