Commit 4f38c88c authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #3460 from ipfs/feat/test/coveralls

Report coverage to coveralls
parents 433d0b5f 6696b01c
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
*.swp *.swp
.ipfsconfig .ipfsconfig
*.out *.out
*.coverprofile
*.test *.test
*.orig *.orig
*~ *~
......
...@@ -3,10 +3,19 @@ IPFS_MIN_GO_VERSION = 1.7 ...@@ -3,10 +3,19 @@ IPFS_MIN_GO_VERSION = 1.7
IPFS_MIN_GX_VERSION = 0.6 IPFS_MIN_GX_VERSION = 0.6
IPFS_MIN_GX_GO_VERSION = 1.1 IPFS_MIN_GX_GO_VERSION = 1.1
ifeq ($(TEST_NO_FUSE),1)
go_test=IPFS_REUSEPORT=false go test -tags nofuse export IPFS_REUSEPORT=false
ifneq ($(COVERALLS_TOKEN), )
covertools_rule = covertools
GOT = overalls -project=github.com/ipfs/go-ipfs -covermode atomic -ignore=.git,Godeps,thirdparty,test -- $(GOTFLAGS)
else else
go_test=IPFS_REUSEPORT=false go test covertools_rule = $()
GOT = go test $(GOTFLAGS) ./...
endif
ifeq ($(TEST_NO_FUSE),1)
GOTFLAGS += -tags nofuse
endif endif
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
...@@ -48,9 +57,14 @@ gx_check: ${gx_bin} ${gx-go_bin} ...@@ -48,9 +57,14 @@ gx_check: ${gx_bin} ${gx-go_bin}
path_check: path_check:
@bin/check_go_path $(realpath $(shell pwd)) $(realpath $(addsuffix /src/github.com/ipfs/go-ipfs,$(subst $(GOPATH_DELIMITER), ,$(GOPATH)))) @bin/check_go_path $(realpath $(shell pwd)) $(realpath $(addsuffix /src/github.com/ipfs/go-ipfs,$(subst $(GOPATH_DELIMITER), ,$(GOPATH))))
deps: go_check gx_check path_check deps: go_check gx_check path_check $(covertools_rule)
${gx_bin} --verbose install --global ${gx_bin} --verbose install --global
covertools:
go get -u github.com/mattn/goveralls
go get -u golang.org/x/tools/cmd/cover
go get -u github.com/Kubuxu/overalls
# saves/vendors third-party dependencies to Godeps/_workspace # saves/vendors third-party dependencies to Godeps/_workspace
# -r flag rewrites import paths to use the vendored path # -r flag rewrites import paths to use the vendored path
# ./... performs operation on all packages in tree # ./... performs operation on all packages in tree
...@@ -67,7 +81,7 @@ clean: ...@@ -67,7 +81,7 @@ clean:
uninstall: uninstall:
$(MAKE) -C cmd/ipfs uninstall $(MAKE) -C cmd/ipfs uninstall
PHONY += all help godep gx_check PHONY += all help godep gx_check covertools
PHONY += go_check deps vendor install build nofuse clean uninstall PHONY += go_check deps vendor install build nofuse clean uninstall
############################################################## ##############################################################
...@@ -85,14 +99,14 @@ test_3node: ...@@ -85,14 +99,14 @@ test_3node:
test_go_fmt: test_go_fmt:
bin/test-go-fmt bin/test-go-fmt
test_go_short:
$(go_test) -test.short ./...
test_go_expensive: test_go_short: GOTFLAGS += -test.short
$(go_test) ./... test_go_race: GOTFLAGS += -race
test_go_expensive test_go_short test_go_race:
test_go_race: $(GOT)
$(go_test) ./... -race ifneq ($(COVERALLS_TOKEN), )
goveralls -coverprofile=overalls.coverprofile -service $(SERVICE)
endif
test_sharness_short: test_sharness_short:
$(MAKE) -j1 -C test/sharness/ $(MAKE) -j1 -C test/sharness/
......
...@@ -7,6 +7,8 @@ machine: ...@@ -7,6 +7,8 @@ machine:
CIRCLE: 1 CIRCLE: 1
IMPORT_PATH: "github.com/ipfs/go-ipfs" IMPORT_PATH: "github.com/ipfs/go-ipfs"
GOPATH: "$HOME/.go_workspace" GOPATH: "$HOME/.go_workspace"
GOBIN: "$GOPATH/bin"
SERVICE: "circle-ci"
post: post:
- sudo rm -rf /usr/local/go - sudo rm -rf /usr/local/go
...@@ -35,5 +37,7 @@ test: ...@@ -35,5 +37,7 @@ test:
override: override:
- make test_go_expensive: - make test_go_expensive:
pwd: "../.go_workspace/src/$IMPORT_PATH" pwd: "../.go_workspace/src/$IMPORT_PATH"
parallel: true
- make test_sharness_expensive: - make test_sharness_expensive:
pwd: "../.go_workspace/src/$IMPORT_PATH" pwd: "../.go_workspace/src/$IMPORT_PATH"
parallel: true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment