diff --git a/Makefile b/Makefile index 61adee45a..303756f4a 100644 --- a/Makefile +++ b/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: diff --git a/config/tendermint_test/config.go b/config/tendermint_test/config.go index 9820ba24a..12bf36699 100644 --- a/config/tendermint_test/config.go +++ b/config/tendermint_test/config.go @@ -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") diff --git a/rpc/test/config.go b/rpc/test/config.go index 787690974..2fe20981c 100644 --- a/rpc/test/config.go +++ b/rpc/test/config.go @@ -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 } diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index 21de52fa9..904fa00e1 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -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