Jelajahi Sumber

add collect codecov report

max furman 8 tahun lalu
induk
melakukan
72693a549b
2 mengubah file dengan 7 tambahan dan 2 penghapusan
  1. 5 0
      .travis.yml
  2. 2 2
      Makefile

+ 5 - 0
.travis.yml

@@ -1,9 +1,14 @@
 language: go
 language: go
 go:
 go:
 - 1.11.x
 - 1.11.x
+env:
+  global:
+  - V=1
 before_script:
 before_script:
 - make bootstrap
 - make bootstrap
 script:
 script:
 - make
 - make
+after_success:
+- bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" || echo "Codecov did not collect coverage reports"
 notifications:
 notifications:
   email: false
   email: false

+ 2 - 2
Makefile

@@ -93,12 +93,12 @@ generate:
 # Test
 # Test
 #########################################
 #########################################
 test:
 test:
-	$Q $(GOFLAGS) go test -short -cover ./...
+	$Q $(GOFLAGS) go test -short -coverprofile=coverage.out ./...
 
 
 vtest:
 vtest:
 	$(Q)for d in $$(go list ./... | grep -v vendor); do \
 	$(Q)for d in $$(go list ./... | grep -v vendor); do \
     echo -e "TESTS FOR: for \033[0;35m$$d\033[0m"; \
     echo -e "TESTS FOR: for \033[0;35m$$d\033[0m"; \
-    $(GOFLAGS) go test -v -bench=. -run=. -short -coverprofile=profile.coverage.out -covermode=atomic $$d; \
+    $(GOFLAGS) go test -v -bench=. -run=. -short -coverprofile=coverage.out $$d; \
 	out=$$?; \
 	out=$$?; \
 	if [[ $$out -ne 0 ]]; then ret=$$out; fi;\
 	if [[ $$out -ne 0 ]]; then ret=$$out; fi;\
     rm -f profile.coverage.out; \
     rm -f profile.coverage.out; \