OSDN Git Service

Skip p2p tests (#385)
authorLiu-Cheng Xu <xuliuchengxlc@gmail.com>
Tue, 27 Feb 2018 02:00:00 +0000 (10:00 +0800)
committerPaladz <yzhu101@uottawa.ca>
Tue, 27 Feb 2018 02:00:00 +0000 (10:00 +0800)
Skip all the tests in p2p when running `go test`.

Makefile
p2p/addrbook_test.go
p2p/connection_test.go
p2p/listener_test.go
p2p/netaddress_test.go
p2p/peer_set_test.go
p2p/peer_test.go
p2p/pex_reactor_test.go
p2p/secret_connection_test.go
p2p/switch_test.go

index fe59c39..b7ac1f2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -69,7 +69,7 @@ multi_platform:
 
 test:
        @echo "====> Running go test"
-       @go test $(PACKAGES)
+       @go test -tags "network" $(PACKAGES)
 
 benchmark:
        go test -bench $(PACKAGES)
index 9b83be1..a201a72 100644 (file)
@@ -1,3 +1,5 @@
+// +build !network
+
 package p2p
 
 import (
index 9d455ba..c994f5f 100644 (file)
@@ -1,3 +1,5 @@
+// +build !network
+
 package p2p_test
 
 import (
index c3d33a9..ee4853b 100644 (file)
@@ -1,3 +1,5 @@
+// +build !network
+
 package p2p
 
 import (
index 8c60da2..6b2d0e3 100644 (file)
@@ -1,3 +1,5 @@
+// +build !network
+
 package p2p
 
 import (
index 9214b2e..f6c0598 100644 (file)
@@ -1,3 +1,5 @@
+// +build !network
+
 package p2p
 
 import (
index f9074aa..709fdf5 100644 (file)
@@ -1,3 +1,5 @@
+// +build !network
+
 package p2p
 
 import (
@@ -5,9 +7,9 @@ import (
        "testing"
        "time"
 
+       log "github.com/sirupsen/logrus"
        "github.com/stretchr/testify/assert"
        "github.com/stretchr/testify/require"
-       log "github.com/sirupsen/logrus"
        crypto "github.com/tendermint/go-crypto"
 
        cfg "github.com/bytom/config"
index 2ce131a..bd03e54 100644 (file)
@@ -1,3 +1,5 @@
+// +build !network
+
 package p2p
 
 import (
index d0d0085..28db58a 100644 (file)
@@ -1,3 +1,5 @@
+// +build !network
+
 package p2p
 
 import (
index 818c210..f125dfd 100644 (file)
@@ -1,3 +1,5 @@
+// +build !network
+
 package p2p
 
 import (