Skip to content

Commit

Permalink
Merge pull request #304 from simelo/stdevRulo_t279_improve_coverage
Browse files Browse the repository at this point in the history
refs #279 Improve coverage
  • Loading branch information
olemis committed Jan 23, 2020
2 parents d9032fd + a991a70 commit 291b8d7
Show file tree
Hide file tree
Showing 46 changed files with 3,352 additions and 391 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ nosetests.xml
coverage.xml
coverage.html
coverage.out
coverage.tmp.out
*.cover
.hypothesis/

Expand Down
86 changes: 18 additions & 68 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 22 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ DEFAULT_ARCH ?= linux
## In future use as a parameter tu make command.
COIN ?= skycoin
COVERAGEPATH = src/coin/$(COIN)
COVERAGEFILE = $(COVERAGEPATH)/coverage.out
COVERAGEHTML = $(COVERAGEPATH)/coverage.html
COVERAGEPREFIX = $(COVERAGEPATH)/coverage
COVERAGEFILE = $(COVERAGEPREFIX).out
COVERAGETEMP = $(COVERAGEPREFIX).tmp.out
COVERAGEHTML = $(COVERAGEPREFIX).html

# Icons
APP_ICON_PATH := resources/images/icons/appIcon
Expand Down Expand Up @@ -224,6 +226,7 @@ prepare-release: ## Change the resources in the app and prepare to release the a

clean-test: ## Remove temporary test files
rm -f $(COVERAGEFILE)
rm -f $(COVERAGETEMP)
rm -f $(COVERAGEHTML)

clean-build: ## Remove temporary files
Expand All @@ -250,35 +253,41 @@ gen-mocks: ## Generate mocks for interface types
mockery -all -output src/coin/mocks -outpkg mocks -dir src/core
find src/coin/mocks/ -name '*.go' -type f -print0 | xargs -0 -I PATH sed -i '' -e 's/fibercryptowallet/fibercryptowallet/g' PATH

$(COVERAGEFILE):
echo 'mode: set' > $(COVERAGEFILE)

test-sky: ## Run Skycoin plugin test suite
go test -cover -timeout 30s github.com/fibercrypto/fibercryptowallet/src/coin/skycoin
go test -coverprofile=$(COVERAGEFILE) -timeout 30s github.com/fibercrypto/fibercryptowallet/src/coin/skycoin/models
go test -coverprofile=$(COVERAGETEMP) -timeout 30s github.com/fibercrypto/fibercryptowallet/src/coin/skycoin
cat $(COVERAGETEMP) | grep -v '^mode: set$$' >> $(COVERAGEFILE)
go test -coverprofile=$(COVERAGETEMP) -timeout 30s github.com/fibercrypto/fibercryptowallet/src/coin/skycoin/models
cat $(COVERAGETEMP) | grep -v '^mode: set$$' >> $(COVERAGEFILE)

test-core: ## Run tests for API core and helpers
go test -cover -timeout 30s github.com/fibercrypto/fibercryptowallet/src/util
go test -coverprofile=$(COVERAGETEMP) -timeout 30s github.com/fibercrypto/fibercryptowallet/src/util
cat $(COVERAGETEMP) | grep -v '^mode: set$$' >> $(COVERAGEFILE)

test-data: ## Run tests for data package
go test -coverprofile=src/data/coverage.out -timeout 30s github.com/fibercrypto/fibercryptowallet/src/data
go test -coverprofile=$(COVERAGETEMP) -timeout 30s github.com/fibercrypto/fibercryptowallet/src/data
cat $(COVERAGETEMP) | grep -v '^mode: set$$' >> $(COVERAGEFILE)

test-html-cover:
go tool cover -html=$(COVERAGEFILE) -o $(COVERAGEPREFIX).html

test-sky-launch-html-cover:
go test -cover -timeout 30s github.com/fibercrypto/fibercryptowallet/src/coin/skycoin
go test -coverprofile=$(COVERAGEFILE) -timeout 30s github.com/fibercrypto/fibercryptowallet/src/coin/skycoin/models
go tool cover -html=$(COVERAGEFILE) -o $(COVERAGEHTML)

test-cover-travis:

test-cover-travis: clean-test
go test -covermode=count -coverprofile=$(COVERAGEFILE) -timeout 30s github.com/fibercrypto/fibercryptowallet/src/util
$(GOPATH)/bin/goveralls -coverprofile=$(COVERAGEFILE) -service=travis-ci -repotoken 1zkcSxi8TkcxpL2zTQOK9G5FFoVgWjceP
go test -coverprofile=$(COVERAGEFILE) -timeout 30s github.com/fibercrypto/fibercryptowallet/src/coin/skycoin/models
$(GOPATH)/bin/goveralls -coverprofile=$(COVERAGEFILE) -service=travis-ci -repotoken 1zkcSxi8TkcxpL2zTQOK9G5FFoVgWjceP
go test -cover -covermode=count -coverprofile=$(COVERAGEFILE) -timeout 30s github.com/fibercrypto/fibercryptowallet/src/coin/skycoin
$(GOPATH)/bin/goveralls -coverprofile=$(COVERAGEFILE) -service=travis-ci -repotoken 1zkcSxi8TkcxpL2zTQOK9G5FFoVgWjceP

test-cover: test test-html-cover ## Show more details of test coverage

test-cover: clean-test test-sky-launch-html-cover ## Show more details of test coverage
test: clean-test $(COVERAGEFILE) test-core test-sky ## Run project test suite

test: clean-test test-core test-sky test-data## Run project test suite

run-docker: DOCKER_GOPATH=$(shell docker inspect $(DOCKER_QT):$(DEFAULT_ARCH) | grep '"GOPATH=' | head -n1 | cut -d = -f2 | cut -d '"' -f1)
run-docker: install-docker-deps ## Run CMD inside Docker container
@echo "Docker container GOPATH found at $(DOCKER_GOPATH)"
Expand Down
Loading

0 comments on commit 291b8d7

Please sign in to comment.