diff --git a/.travis.yml b/.travis.yml index e53f16bb0..25d0a808c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,8 @@ script: - bash build.sh - go test -v -race -failfast -parallel 16 -cpu 16 $(go list ./... | grep -v "/vendor/") -coverprofile cover.out - cd rpc && go test -test.bench ^BenchmarkPersistentCaller_Call$ -test.run ^$ && cd - + - bash cleanupDB.sh || true + - cd cmd/cql-minerd && go test -bench=^BenchmarkMinerTwo$ -benchtime=5s -run ^$ && cd - - gocovmerge cover.out $(find cmd -name "*.cover.out") | grep -F -v '_gen.go' > coverage.txt && rm -f cover.out - bash <(curl -s https://codecov.io/bash) - >- diff --git a/cmd/cql-minerd/integration_test.go b/cmd/cql-minerd/integration_test.go index c479d8c5b..c4cf9ed27 100644 --- a/cmd/cql-minerd/integration_test.go +++ b/cmd/cql-minerd/integration_test.go @@ -487,18 +487,18 @@ func benchDB(b *testing.B, db *sql.DB, createDB bool) { func benchMiner(b *testing.B, minerCount uint16, bypassSign bool) { log.Warnf("Benchmark for %d Miners, BypassSignature: %v", minerCount, bypassSign) asymmetric.BypassSignature = bypassSign - //if minerCount > 0 { - // startNodesProfile(bypassSign) - // utils.WaitToConnect(context.Background(), "127.0.0.1", []int{ - // 2144, - // 2145, - // 2146, - // 3122, - // 3121, - // 3120, - // }, 2*time.Second) - // time.Sleep(time.Second) - //} + if minerCount > 0 { + startNodesProfile(bypassSign) + utils.WaitToConnect(context.Background(), "127.0.0.1", []int{ + 2144, + 2145, + 2146, + 3122, + 3121, + 3120, + }, 2*time.Second) + time.Sleep(time.Second) + } // Create temp directory testDataDir, err := ioutil.TempDir(testWorkingDir, "covenantsql") @@ -506,9 +506,9 @@ func benchMiner(b *testing.B, minerCount uint16, bypassSign bool) { panic(err) } defer os.RemoveAll(testDataDir) - clientConf := FJ(testWorkingDir, "./service/node_c/config.yaml") + clientConf := FJ(testWorkingDir, "./integration/node_c/config.yaml") tempConf := FJ(testDataDir, "config.yaml") - clientKey := FJ(testWorkingDir, "./service/node_c/private.key") + clientKey := FJ(testWorkingDir, "./integration/node_c/private.key") tempKey := FJ(testDataDir, "private.key") utils.CopyFile(clientConf, tempConf) utils.CopyFile(clientKey, tempKey) @@ -536,7 +536,7 @@ func benchMiner(b *testing.B, minerCount uint16, bypassSign bool) { db, err := sql.Open("covenantsql", dsn) So(err, ShouldBeNil) - benchDB(b, db, true) + benchDB(b, db, minerCount > 0) err = client.Drop(dsn) So(err, ShouldBeNil)