diff --git a/bchain/coins/bch/bcashparser_test.go b/bchain/coins/bch/bcashparser_test.go index 5ef506f7..1d042b9f 100644 --- a/bchain/coins/bch/bcashparser_test.go +++ b/bchain/coins/bch/bcashparser_test.go @@ -1,3 +1,5 @@ +// +build unittest + package bch import ( diff --git a/bchain/coins/bch/bcashrpc_test.go b/bchain/coins/bch/bcashrpc_test.go index 4fd6e376..4fdabb6c 100644 --- a/bchain/coins/bch/bcashrpc_test.go +++ b/bchain/coins/bch/bcashrpc_test.go @@ -1,3 +1,5 @@ +// +build integration + package bch import ( @@ -230,11 +232,7 @@ func init() { } } -func TestRPC_GetBlockHash(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestBCashRPC_GetBlockHash(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -251,11 +249,7 @@ func TestRPC_GetBlockHash(t *testing.T) { } } -func TestRPC_GetBlockRaw(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestBCashRPC_GetBlockRaw(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -274,11 +268,7 @@ func TestRPC_GetBlockRaw(t *testing.T) { } } -func TestRPC_GetBlock(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestBCashRPC_GetBlock(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -302,11 +292,7 @@ func TestRPC_GetBlock(t *testing.T) { } -func TestRPC_GetTransaction(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestBCashRPC_GetTransaction(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) diff --git a/bchain/coins/btc/bitcoinparser_test.go b/bchain/coins/btc/bitcoinparser_test.go index 669a4927..46490f6c 100644 --- a/bchain/coins/btc/bitcoinparser_test.go +++ b/bchain/coins/btc/bitcoinparser_test.go @@ -1,3 +1,5 @@ +// +build unittest + package btc import ( diff --git a/bchain/coins/btc/bitcoinrpc_test.go b/bchain/coins/btc/bitcoinrpc_test.go index a3377a67..c7920bad 100644 --- a/bchain/coins/btc/bitcoinrpc_test.go +++ b/bchain/coins/btc/bitcoinrpc_test.go @@ -1,3 +1,5 @@ +// +build integration + package btc import ( @@ -208,11 +210,7 @@ func init() { } } -func TestRPC_GetBlockHash(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestBitcoinRPC_GetBlockHash(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -229,11 +227,7 @@ func TestRPC_GetBlockHash(t *testing.T) { } } -func TestRPC_GetBlockRaw(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestBitcoinRPC_GetBlockRaw(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -252,11 +246,7 @@ func TestRPC_GetBlockRaw(t *testing.T) { } } -func TestRPC_GetBlock(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestBitcoinRPC_GetBlock(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -280,11 +270,7 @@ func TestRPC_GetBlock(t *testing.T) { } -func TestRPC_GetTransaction(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestBitcoinRPC_GetTransaction(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) diff --git a/bchain/coins/btg/bgoldparser_test.go b/bchain/coins/btg/bgoldparser_test.go index f308aced..8834cfc0 100644 --- a/bchain/coins/btg/bgoldparser_test.go +++ b/bchain/coins/btg/bgoldparser_test.go @@ -1,3 +1,5 @@ +// +build unittest + package btg import ( diff --git a/bchain/coins/dash/dashrpc_test.go b/bchain/coins/dash/dashrpc_test.go index 00c933a7..e90de99a 100644 --- a/bchain/coins/dash/dashrpc_test.go +++ b/bchain/coins/dash/dashrpc_test.go @@ -1,3 +1,5 @@ +// +build integration + package dash import ( @@ -193,11 +195,7 @@ func init() { } } -func TestRPC_GetBlockHash(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestDashRPC_GetBlockHash(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -214,11 +212,7 @@ func TestRPC_GetBlockHash(t *testing.T) { } } -func TestRPC_GetBlockRaw(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestDashRPC_GetBlockRaw(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -237,11 +231,7 @@ func TestRPC_GetBlockRaw(t *testing.T) { } } -func TestRPC_GetBlock(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestDashRPC_GetBlock(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -265,11 +255,7 @@ func TestRPC_GetBlock(t *testing.T) { } -func TestRPC_GetTransaction(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestDashRPC_GetTransaction(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) diff --git a/bchain/coins/eth/ethparser_test.go b/bchain/coins/eth/ethparser_test.go index 08958b7f..c1f4620f 100644 --- a/bchain/coins/eth/ethparser_test.go +++ b/bchain/coins/eth/ethparser_test.go @@ -1,3 +1,5 @@ +// +build unittest + package eth import ( diff --git a/bchain/coins/eth/ethrpc_test.go b/bchain/coins/eth/ethrpc_test.go index 41f75338..1fec9032 100644 --- a/bchain/coins/eth/ethrpc_test.go +++ b/bchain/coins/eth/ethrpc_test.go @@ -1,3 +1,5 @@ +// +build integration + package eth import ( @@ -36,9 +38,6 @@ func setupEthRPC() *EthereumRPC { } func TestEthRPC_getBestHeader(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } type fields struct { b *EthereumRPC } @@ -68,9 +67,6 @@ func TestEthRPC_getBestHeader(t *testing.T) { } func TestEthRPC_GetBestBlockHash(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } type fields struct { b *EthereumRPC } @@ -104,9 +100,6 @@ func TestEthRPC_GetBestBlockHash(t *testing.T) { } func TestEthRPC_GetBestBlockHeight(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } type fields struct { b *EthereumRPC } @@ -139,9 +132,6 @@ func TestEthRPC_GetBestBlockHeight(t *testing.T) { } func TestEthRPC_GetBlockHash(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } type fields struct { b *EthereumRPC } @@ -202,9 +192,6 @@ func TestEthRPC_GetBlockHash(t *testing.T) { } func TestEthRPC_GetBlockHeader(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } bh, err := setupEthRPC().getBestHeader() if err != nil { panic(err) @@ -262,9 +249,6 @@ func TestEthRPC_GetBlockHeader(t *testing.T) { } func TestEthRPC_GetBlock(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } bh, err := setupEthRPC().getBestHeader() if err != nil { panic(err) @@ -372,9 +356,6 @@ func TestEthRPC_GetTransaction(t *testing.T) { panic(err) } - if testing.Short() { - t.Skip("skipping test in short mode.") - } bh, err := setupEthRPC().getBestHeader() if err != nil { panic(err) @@ -466,9 +447,6 @@ func TestEthRPC_GetTransaction(t *testing.T) { } func TestEthRPC_EstimateFee(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } type fields struct { b *EthereumRPC } @@ -508,9 +486,6 @@ func TestEthRPC_EstimateFee(t *testing.T) { } func TestEthRPC_GetMempool(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } type fields struct { b *EthereumRPC } diff --git a/bchain/coins/litecoin/litecoinparser_test.go b/bchain/coins/litecoin/litecoinparser_test.go index 2d8cd90e..a28a4a35 100644 --- a/bchain/coins/litecoin/litecoinparser_test.go +++ b/bchain/coins/litecoin/litecoinparser_test.go @@ -1,3 +1,5 @@ +// +build unittest + package litecoin import ( diff --git a/bchain/coins/zec/zcashparser_test.go b/bchain/coins/zec/zcashparser_test.go index 7b8db889..0bb61fe1 100644 --- a/bchain/coins/zec/zcashparser_test.go +++ b/bchain/coins/zec/zcashparser_test.go @@ -1,3 +1,5 @@ +// +build unittest + package zec import ( diff --git a/bchain/coins/zec/zcashrpc_test.go b/bchain/coins/zec/zcashrpc_test.go index 2ead0536..0d9f2664 100644 --- a/bchain/coins/zec/zcashrpc_test.go +++ b/bchain/coins/zec/zcashrpc_test.go @@ -1,3 +1,5 @@ +// +build integration + package zec import ( @@ -167,11 +169,7 @@ func init() { } } -func TestRPC_GetBlockHash(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestZCashRPC_GetBlockHash(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -188,11 +186,7 @@ func TestRPC_GetBlockHash(t *testing.T) { } } -func TestRPC_GetBlockRaw(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestZCashRPC_GetBlockRaw(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -211,11 +205,7 @@ func TestRPC_GetBlockRaw(t *testing.T) { } } -func TestRPC_GetBlock(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestZCashRPC_GetBlock(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) @@ -239,11 +229,7 @@ func TestRPC_GetBlock(t *testing.T) { } -func TestRPC_GetTransaction(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode.") - } - +func TestZCashRPC_GetTransaction(t *testing.T) { cli, err := getRPCClient() if err != nil { t.Fatal(err) diff --git a/build/bin/Makefile b/build/bin/Makefile index 635cb047..5a55cd7e 100644 --- a/build/bin/Makefile +++ b/build/bin/Makefile @@ -23,10 +23,10 @@ tools: chown $(PACKAGER) /out/{ldb,sst_dump} test: prepare-sources - cd $(GOPATH)/src/blockbook && go test -short ./... $(ARGS) + cd $(GOPATH)/src/blockbook && go test -tags unittest ./... $(ARGS) test-all: prepare-sources - cd $(GOPATH)/src/blockbook && go test ./... $(ARGS) + cd $(GOPATH)/src/blockbook && go test -tags 'unittest integration' ./... $(ARGS) prepare-sources: @ [ -n "`ls /src 2> /dev/null`" ] || (echo "/src doesn't exist or is empty" 1>&2 && exit 1) diff --git a/db/rocksdb_test.go b/db/rocksdb_test.go index 100a7b08..52be1c5d 100644 --- a/db/rocksdb_test.go +++ b/db/rocksdb_test.go @@ -1,3 +1,5 @@ +// +build unittest + package db import ( diff --git a/server/socketio_test.go b/server/socketio_test.go index c7a6ce53..108815cd 100644 --- a/server/socketio_test.go +++ b/server/socketio_test.go @@ -1,3 +1,5 @@ +// +build unittest + package server import (