diff --git a/core/config.go b/core/config.go index 8a39f9208f75ca85b03c5f9c690d6f78c94de925..941b5b54d636d373092073e549385b8c30a49b99 100644 --- a/core/config.go +++ b/core/config.go @@ -54,7 +54,6 @@ func loadModuleConfigFromDo(do *definitions.Do, module string) (*config.ModuleCo func LoadModuleConfig(conf *viper.Viper, rootWorkDir, rootDataDir, genesisFile, chainId, module string) (*config.ModuleConfig, error) { moduleName := conf.GetString("chain." + module + ".name") - fmt.Println(conf) majorVersion := conf.GetInt("chain." + module + ".major_version") minorVersion := conf.GetInt("chain." + module + ".minor_version") minorVersionString := version.MakeMinorVersionString(moduleName, majorVersion, diff --git a/rpc/tendermint/test/common_test.go b/rpc/tendermint/test/common_test.go index bc0ca59bbb293dbc999324142a46e936f44e71da..871df79e363807479e227746f6d80a6e00e6fadb 100644 --- a/rpc/tendermint/test/common_test.go +++ b/rpc/tendermint/test/common_test.go @@ -4,12 +4,14 @@ import ( "testing" "github.com/eris-ltd/eris-db/test/fixtures" "os" + "fmt" ) // Needs to be in a _test.go file to be picked up func TestMain(m *testing.M) { - ffs := fixtures.NewFileFixtures() + ffs := fixtures.NewFileFixtures("Eris-DB") defer ffs.RemoveAll() + fmt.Println("Defered!!") initGlobalVariables(ffs) diff --git a/rpc/tendermint/test/shared.go b/rpc/tendermint/test/shared.go index 20c996fc10c7276dab9a3b31b4fc43349e1ada33..b60445445cab393a519de972241e737ac5b7152b 100644 --- a/rpc/tendermint/test/shared.go +++ b/rpc/tendermint/test/shared.go @@ -48,6 +48,11 @@ func initGlobalVariables(ffs *fixtures.FileFixtures) { testConfig := viper.New() testConfig.SetConfigFile(testConfigFile) + err := testConfig.ReadInConfig() + + if err != nil { + panic(err) + } chainID = testConfig.GetString("chain.assert_chain_id") rpcAddr := testConfig.GetString("erismint.tendermint_host") diff --git a/test/fixtures/file_fixtures.go b/test/fixtures/file_fixtures.go index 67fa040568d7fad6fbd9266024e4f036bf5c0545..a17933e46889f336aa10caabcff6521e23c6bb22 100644 --- a/test/fixtures/file_fixtures.go +++ b/test/fixtures/file_fixtures.go @@ -4,6 +4,7 @@ import ( "github.com/docker/docker/pkg/ioutils" "path" "os" + "fmt" ) // FileFixtures writes files to a temporary location for use in testing. @@ -17,8 +18,8 @@ type FileFixtures struct { // and file contents. The file names will be interpreted as relative to some // temporary root directory that is fixed when allocate() is called on the // FileFixtures struct. -func NewFileFixtures() *FileFixtures { - dir, err := ioutils.TempDir("", "FileFixtures") +func NewFileFixtures(identifyingPrefix string) *FileFixtures { + dir, err := ioutils.TempDir("", identifyingPrefix) return &FileFixtures{ tempDir: dir, Error: err, @@ -53,6 +54,7 @@ func (ffs *FileFixtures) AddDir(name string) string { // Cleans up the the temporary files (with fire) func (ffs *FileFixtures) RemoveAll() { + fmt.Println("cleanup!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") if err := os.RemoveAll(ffs.tempDir); err != nil { // Since we expect to be called from being deferred in a test it's // better if we panic here so that the caller finds