From 67c0315dbcfa2e0a2a5f779870a3a7427d8c1d55 Mon Sep 17 00:00:00 2001 From: Victor Farazdagi Date: Wed, 28 Sep 2016 11:07:30 +0300 Subject: [PATCH] Travis CI tests pass now --- .travis.yml | 16 ++++++++++++++++ Makefile | 5 +++++ data/static-nodes.json | 2 +- geth/node_test.go | 3 ++- geth/utils.go | 4 ++-- 5 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..038100163 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: go + +go: + - 1.7.1 + +sudo: false + +install: + - go get golang.org/x/tools/cmd/cover + +script: + - make ci + +cache: + directories: + - .ethereumtest diff --git a/Makefile b/Makefile index ec1270029..4dbaf99a7 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,11 @@ xgo: build/env.sh docker pull farazdagi/xgo build/env.sh go get github.com/karalabe/xgo +ci: + build/env.sh go test -v -cover ./geth + build/env.sh go test -v -cover ./jail + build/env.sh go test -v -cover ./extkeys + test-all: @build/env.sh echo "mode: set" > coverage-all.out build/env.sh go test -coverprofile=coverage.out -covermode=set ./geth diff --git a/data/static-nodes.json b/data/static-nodes.json index 8bb1b83fa..0f6b4b642 100644 --- a/data/static-nodes.json +++ b/data/static-nodes.json @@ -1,3 +1,3 @@ [ - "enode://1bd9b8a8063810e91cd1ebcf2995ac867542d5c90dc74a6f2ada7ecd399da356d18abf3af4c84788808abde8891a75bcde4ace5a741a2ba9efe9b59dd09d5b33@46.101.97.80:30303" + "enode://4e2bb6b09aa34375ae2df23fa063edfe7aaec952dba972449158ae0980a4abd375aca3c06a519d4f562ff298565afd288a0ed165944974b2557e6ff2c31424de@138.68.73.175:30303" ] diff --git a/geth/node_test.go b/geth/node_test.go index 819591e58..5ef437994 100644 --- a/geth/node_test.go +++ b/geth/node_test.go @@ -4,6 +4,7 @@ import ( "os" "testing" "time" + "path/filepath" "github.com/status-im/status-go/geth" ) @@ -22,7 +23,7 @@ const ( func TestMain(m *testing.M) { syncRequired := false - if _, err := os.Stat(geth.TestDataDir); os.IsNotExist(err) { + if _, err := os.Stat(filepath.Join(geth.TestDataDir, "testnet")); os.IsNotExist(err) { syncRequired = true } // make sure you panic if node start signal is not received diff --git a/geth/utils.go b/geth/utils.go index 821b22517..f466619ac 100644 --- a/geth/utils.go +++ b/geth/utils.go @@ -23,7 +23,7 @@ var muPrepareTestNode sync.Mutex const ( TestDataDir = "../.ethereumtest" - TestNodeSyncSeconds = 300 + TestNodeSyncSeconds = 480 ) type NodeNotificationHandler func(jsonEvent string) @@ -90,7 +90,7 @@ func PrepareTestNode() (err error) { } syncRequired := false - if _, err := os.Stat(TestDataDir); os.IsNotExist(err) { + if _, err := os.Stat(filepath.Join(TestDataDir, "testnet")); os.IsNotExist(err) { syncRequired = true }