@ -5,7 +5,7 @@ PACKAGES=$(shell go list ./... | grep -v '/vendor/')
BUILD_TAGS ?= tendermint
BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short=8 HEAD`"
all : check build test install
all : check build test_integrations install
check : check_tools ensure_deps
@ -73,16 +73,56 @@ get_deps_bin_size:
########################################
### Testing
test :
@echo "--> Running go test"
@go test $( PACKAGES)
test_race :
@echo "--> Running go test --race"
@go test -race $( PACKAGES)
## required to be run first by most tests
build_docker_test_image :
docker build -t tester -f ./test/docker/Dockerfile .
### coverage, app, persistence, and libs tests
test_cover :
# run the go unit tests with coverage
bash test/test_cover.sh
test_apps :
# run the app tests using bash
# requires `abci-cli` and `tendermint` binaries installed
bash test/app/test.sh
test_persistence :
# run the persistence tests using bash
# requires `abci-cli` installed
docker run --name run_persistence -t tester bash test/persist/test_failure_indices.sh
# TODO undockerize
# bash test/persist/test_failure_indices.sh
test_p2p :
docker rm -f rsyslog || true
rm -rf test/logs || true
mkdir test/logs
cd test/
docker run -d -v "logs:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
cd ..
# requires 'tester' the image from above
bash test/p2p/test.sh tester
need_abci :
bash scripts/install_abci_apps.sh
test_integrations :
@bash ./test/test.sh
make build_docker_test_image
make get_tools
make get_vendor_deps
make install
make need_abci
make test_cover
make test_apps
make test_persistence
make test_p2p
test_libs :
# checkout every github.com/tendermint dir and run its tests
# NOTE: on release-* or master branches only (set by Jenkins)
docker run --name run_libs -t tester bash test/test_libs.sh
test_release :
@go test -tags release $( PACKAGES)
@ -92,10 +132,17 @@ test100:
vagrant_test :
vagrant up
vagrant ssh -c 'make install'
vagrant ssh -c 'make test_race'
vagrant ssh -c 'make test_integrations'
### go tests
test :
@echo "--> Running go test"
@go test $( PACKAGES)
test_race :
@echo "--> Running go test --race"
@go test -v -race $( PACKAGES)
########################################
### Formatting, linting, and vetting
@ -136,8 +183,7 @@ metalinter_all:
@echo "--> Running linter (all)"
gometalinter.v2 --vendor --deadline= 600s --enable-all --disable= lll ./...
# To avoid unintended conflicts with file names, always add to .PHONY
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY : check build build_race dist install check_tools get_tools update_tools get_vendor_deps draw_deps get_deps_bin_size test test_race test_integrations test_release test 100 vagrant_test fmt metalinter metalinter_all
.PHONY : check build build_race dist install check_tools get_tools update_tools get_vendor_deps draw_depsbuild_test_docker_image test_cover test_apps test_persistence test_p 2p test test_race test_libs test_integrations test_release test 100 vagrant_test fmt