Merge pull request #1823 from cosmos/dev/cli_test_build_flag

tests: Move cli tests behind a build flag
This commit is contained in:
Rigel 2018-07-26 13:47:46 -04:00 committed by GitHub
commit 67d0c804b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,5 @@
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
PACKAGES_NOCLITEST=$(shell go list ./... | grep -v '/vendor/' | grep -v '/simulation' | grep -v github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test)
PACKAGES_SIMTEST=$(shell go list ./... | grep -v '/vendor/' | grep '/simulation')
PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation')
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
COMMIT_HASH := $(shell git rev-parse --short HEAD)
BUILD_TAGS = netgo ledger
BUILD_FLAGS = -tags "${BUILD_TAGS}" -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=${COMMIT_HASH}"
@ -123,13 +122,13 @@ godocs:
test: test_unit
test_cli:
@go test -count 1 -p 1 `go list github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test`
@go test -count 1 -p 1 `go list github.com/cosmos/cosmos-sdk/cmd/gaia/cli_test` -tags=cli_test
test_unit:
@go test $(PACKAGES_NOCLITEST)
@go test $(PACKAGES_NOSIMULATION)
test_race:
@go test -race $(PACKAGES_NOCLITEST)
@go test -race $(PACKAGES_NOSIMULATION)
test_sim:
@echo "Running individual module simulations."
@ -156,7 +155,7 @@ format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs misspell -w
benchmark:
@go test -bench=. $(PACKAGES_NOCLITEST)
@go test -bench=. $(PACKAGES_NOSIMULATION)
########################################

View File

@ -46,6 +46,7 @@ IMPROVEMENTS
* [x/gov] Votes on a proposal can now be queried
* [x/bank] Unit tests are now table-driven
* [tests] Fixes ansible scripts to work with AWS too
* [tests] \#1806 CLI tests are now behind the build flag 'cli_test', so go test works on a new repo
BUG FIXES
* \#1666 Add intra-tx counter to the genesis validators

View File

@ -1,3 +1,5 @@
// +build cli_test
package clitest
import (

3
cmd/gaia/cli_test/doc.go Normal file
View File

@ -0,0 +1,3 @@
package clitest
// package clitest runs integration tests which make use of CLI commands.