Skip to content

Commit

Permalink
Add race-check target to Makefile. Closes #710 (#769)
Browse files Browse the repository at this point in the history
* Add `race-check` and `test-unit-race` target to Makefile. Closes #710
  • Loading branch information
Pedro Pombeiro authored Mar 27, 2018
1 parent 8b26419 commit c4d7a61
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
27 changes: 17 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ XGOIMAGE = statusteam/xgo:$(XGOVERSION)
XGOIMAGEIOSSIM = statusteam/xgo-ios-simulator:$(XGOVERSION)

networkid ?= StatusChain
gotest_extraflags =

DOCKER_IMAGE_NAME ?= statusteam/status-go

Expand Down Expand Up @@ -122,23 +123,29 @@ docker-test: ##@tests Run tests in a docker container with golang.
test: test-unit-coverage ##@tests Run basic, short tests during development

test-unit: ##@tests Run unit and integration tests
go test $(UNIT_TEST_PACKAGES)
go test $(UNIT_TEST_PACKAGES) $(gotest_extraflags)

test-unit-coverage: ##@tests Run unit and integration tests with coverage
go test -coverpkg= $(UNIT_TEST_PACKAGES)
go test -coverpkg= $(UNIT_TEST_PACKAGES) $(gotest_extraflags)

test-unit-race: gotest_extraflags=-race
test-unit-race: test-unit ##@tests Run unit and integration tests with -race flag

test-e2e: ##@tests Run e2e tests
# order: reliability then alphabetical
# TODO(tiabc): make a single command out of them adding `-p 1` flag.
go test -timeout 5m ./t/e2e/accounts/... -network=$(networkid)
go test -timeout 5m ./t/e2e/api/... -network=$(networkid)
go test -timeout 5m ./t/e2e/node/... -network=$(networkid)
go test -timeout 50m ./t/e2e/jail/... -network=$(networkid)
go test -timeout 20m ./t/e2e/rpc/... -network=$(networkid)
go test -timeout 20m ./t/e2e/whisper/... -network=$(networkid)
go test -timeout 10m ./t/e2e/transactions/... -network=$(networkid)
go test -timeout 5m ./t/e2e/accounts/... -network=$(networkid) $(gotest_extraflags)
go test -timeout 5m ./t/e2e/api/... -network=$(networkid) $(gotest_extraflags)
go test -timeout 5m ./t/e2e/node/... -network=$(networkid) $(gotest_extraflags)
go test -timeout 50m ./t/e2e/jail/... -network=$(networkid) $(gotest_extraflags)
go test -timeout 20m ./t/e2e/rpc/... -network=$(networkid) $(gotest_extraflags)
go test -timeout 20m ./t/e2e/whisper/... -network=$(networkid) $(gotest_extraflags)
go test -timeout 10m ./t/e2e/transactions/... -network=$(networkid) $(gotest_extraflags)
# e2e_test tag is required to include some files from ./lib without _test suffix
go test -timeout 40m -tags e2e_test ./lib -network=$(networkid)
go test -timeout 40m -tags e2e_test ./lib -network=$(networkid) $(gotest_extraflags)

race-check: gotest_extraflags=-race
race-check: test-e2e ##@tests Run e2e tests with -race flag

lint-install:
go get -u github.com/alecthomas/gometalinter
Expand Down
2 changes: 1 addition & 1 deletion geth/params/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ var loadConfigTestCases = []struct {
require.True(t, nodeConfig.ClusterConfig.Enabled, "cluster configuration is expected to be enabled after loading file")

enodes := nodeConfig.ClusterConfig.StaticNodes
require.True(t, len(enodes) == 2)
require.Len(t, enodes, 2)
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions t/e2e/whisper/whisper_mailbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ func (s *WhisperMailboxSuite) TestRequestMessageFromMailboxAsync() {
//Create message filter
messageFilterID := s.createPrivateChatMessageFilter(rpcClient, keyID, topic.String())

//Threre are no messages at filter
//There are no messages at filter
messages := s.getMessagesByMessageFilterID(rpcClient, messageFilterID)
s.Require().Equal(0, len(messages))

//Post message matching with filter (key and token)
//Post message matching with filter (key and topic)
s.postMessageToPrivate(rpcClient, pubkey.String(), topic.String(), hexutil.Encode([]byte("Hello world!")))

//Get message to make sure that it will come from the mailbox later
Expand Down

0 comments on commit c4d7a61

Please sign in to comment.