mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-30 19:51:58 +00:00
Fix rpc/test import; Remove ~/.tendermint_test on each test
This commit is contained in:
4
Makefile
4
Makefile
@@ -18,13 +18,9 @@ build_race:
|
||||
go build -race -o build/tendermint github.com/tendermint/tendermint/cmd/tendermint
|
||||
|
||||
test: build
|
||||
-rm -rf ~/.tendermint_test_bak
|
||||
-mv ~/.tendermint_test ~/.tendermint_test_bak && true
|
||||
go test github.com/tendermint/tendermint/...
|
||||
|
||||
test_novendor: build
|
||||
-rm -rf ~/.tendermint_test_bak
|
||||
-mv ~/.tendermint_test ~/.tendermint_test_bak && true
|
||||
go test $$(glide novendor)
|
||||
|
||||
draw_deps:
|
||||
|
@@ -26,6 +26,18 @@ func getTMRoot(rootDir string) string {
|
||||
|
||||
func initTMRoot(rootDir string) {
|
||||
rootDir = getTMRoot(rootDir)
|
||||
|
||||
// Remove ~/.tendermint_test_bak
|
||||
err := os.RemoveAll(rootDir + "_bak")
|
||||
if err != nil {
|
||||
PanicSanity(err.Error())
|
||||
}
|
||||
// Move ~/.tendermint_test to ~/.tendermint_test_bak
|
||||
err = os.Rename(rootDir, rootDir+"_bak")
|
||||
if err != nil {
|
||||
PanicSanity(err.Error())
|
||||
}
|
||||
// Create new dir
|
||||
EnsureDir(rootDir, 0700)
|
||||
|
||||
configFilePath := path.Join(rootDir, "config.toml")
|
||||
|
@@ -1,18 +1,13 @@
|
||||
package rpctest
|
||||
|
||||
import (
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
tmcfg "github.com/tendermint/tendermint/config/tendermint_test"
|
||||
cfg "github.com/tendermint/go-config"
|
||||
)
|
||||
|
||||
var config cfg.Config = nil
|
||||
|
||||
func initConfig() {
|
||||
|
||||
func init() {
|
||||
cfg.OnConfig(func(newConfig cfg.Config) {
|
||||
config = newConfig
|
||||
})
|
||||
|
||||
c := tmcfg.GetConfig("")
|
||||
cfg.ApplyConfig(c) // Notify modules of new config
|
||||
}
|
||||
|
@@ -31,8 +31,6 @@ var (
|
||||
|
||||
// initialize config and create new node
|
||||
func init() {
|
||||
initConfig()
|
||||
|
||||
chainID = config.GetString("chain_id")
|
||||
rpcAddr = config.GetString("rpc_laddr")
|
||||
requestAddr = "http://" + rpcAddr
|
||||
|
Reference in New Issue
Block a user