From e60fc8cb96dd3ec6762dc95806cea19a5dfa96a2 Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 18 Feb 2014 09:25:10 +0100 Subject: [PATCH] Capturing the output of the engine in tests --- apier/tutfscsv_local_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apier/tutfscsv_local_test.go b/apier/tutfscsv_local_test.go index 63bb64b32..e24086020 100644 --- a/apier/tutfscsv_local_test.go +++ b/apier/tutfscsv_local_test.go @@ -88,10 +88,11 @@ func TestFsCsvStartEngine(t *testing.T) { t.Fatal("Cannot find cgr-engine executable") } exec.Command("pkill", "cgr-engine").Run() // Just to make sure another one is not running, bit brutal maybe we can fine tune it - engine := exec.Command(enginePath, "-rater", "-scheduler", "-cdrs", "-mediator", "-config", path.Join(*dataDir, "conf", "cgrates.cfg")) - if err := engine.Start(); err != nil { - t.Fatal("Cannot start cgr-engine: ", err.Error()) - } + go func() { + eng := exec.Command(enginePath, "-rater", "-scheduler", "-cdrs", "-mediator", "-config", path.Join(*dataDir, "conf", "cgrates.cfg")) + out, _ := eng.CombinedOutput() + engine.Logger.Info(fmt.Sprintf("CgrEngine-TestFsCsv: %s", out)) + }() time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Give time to rater to fire up }