From 6c6b27a9d9a318f380d19c85f7cd453476646bbb Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Wed, 13 Aug 2014 16:49:39 +0300 Subject: [PATCH] fix for local init it test files --- general_tests/tutorial_local_test.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/general_tests/tutorial_local_test.go b/general_tests/tutorial_local_test.go index deec1f466..c252c3a5d 100644 --- a/general_tests/tutorial_local_test.go +++ b/general_tests/tutorial_local_test.go @@ -19,15 +19,17 @@ along with this program. If not, see package general_tests import ( - "github.com/cgrates/cgrates/config" - "github.com/cgrates/cgrates/engine" - "github.com/cgrates/cgrates/utils" + "log" "net/rpc" "net/rpc/jsonrpc" "os/exec" "path" "testing" "time" + + "github.com/cgrates/cgrates/config" + "github.com/cgrates/cgrates/engine" + "github.com/cgrates/cgrates/utils" ) var tutCfgPath string @@ -35,8 +37,15 @@ var tutCfg *config.CGRConfig var tutRpc *rpc.Client func init() { + if !*testLocal { + return + } tutCfgPath = path.Join(*dataDir, "conf", "samples", "tutorial_local_test.cfg") - tutCfg, _ = config.NewCGRConfigFromFile(&tutCfgPath) + var err error + tutCfg, err = config.NewCGRConfigFromFile(&tutCfgPath) + if err != nil { + log.Print("ERROR: ", err) + } tutCfg.DataFolderPath = *dataDir // Share DataFolderPath through config towards StoreDb for Flush() config.SetCgrConfig(tutCfg) }