mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Updated tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
a64e58278d
commit
0b55bc7899
@@ -75,7 +75,6 @@ func newRPCClient(cfg *config.ListenCfg) (c *rpc.Client, err error) {
|
||||
|
||||
//Test start here
|
||||
func TestAnalyzerSIT(t *testing.T) {
|
||||
|
||||
for _, stest := range sTestsAlsPrf {
|
||||
t.Run("TestAnalyzerSIT", stest)
|
||||
}
|
||||
@@ -220,4 +219,7 @@ func testAnalyzerSKillEngine(t *testing.T) {
|
||||
if err := engine.KillEngine(100); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if err := os.RemoveAll(anzCfg.AnalyzerSCfg().DBPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,9 @@ func TestNewAnalyzerService(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
anz.db.Close()
|
||||
if err := os.RemoveAll(cfg.AnalyzerSCfg().DBPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAnalyzerSLogTraffic(t *testing.T) {
|
||||
@@ -116,6 +119,9 @@ func TestAnalyzerSLogTraffic(t *testing.T) {
|
||||
if err = anz.clenaUp(); err != bleve.ErrorIndexClosed {
|
||||
t.Errorf("Expected error: %v,received: %+v", bleve.ErrorIndexClosed, err)
|
||||
}
|
||||
if err := os.RemoveAll(cfg.AnalyzerSCfg().DBPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAnalyzersDeleteHits(t *testing.T) {
|
||||
@@ -138,6 +144,9 @@ func TestAnalyzersDeleteHits(t *testing.T) {
|
||||
if err = anz.deleteHits(search.DocumentMatchCollection{&search.DocumentMatch{}}); err != utils.ErrPartiallyExecuted {
|
||||
t.Errorf("Expected error: %v,received: %+v", utils.ErrPartiallyExecuted, err)
|
||||
}
|
||||
if err := os.RemoveAll(cfg.AnalyzerSCfg().DBPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAnalyzersListenAndServe(t *testing.T) {
|
||||
@@ -173,6 +182,9 @@ func TestAnalyzersListenAndServe(t *testing.T) {
|
||||
anz.db.Close()
|
||||
}()
|
||||
anz.ListenAndServe(make(chan bool))
|
||||
if err := os.RemoveAll(cfg.AnalyzerSCfg().DBPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAnalyzersV1Search(t *testing.T) {
|
||||
@@ -289,4 +301,7 @@ func TestAnalyzersV1Search(t *testing.T) {
|
||||
if err = anz.V1StringQuery("RequestEncoding:*gob", &reply); err != bleve.ErrorIndexClosed {
|
||||
t.Errorf("Expected error: %v,received: %+v", bleve.ErrorIndexClosed, err)
|
||||
}
|
||||
if err := os.RemoveAll(cfg.AnalyzerSCfg().DBPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,4 +97,7 @@ func TestNewServerCodec(t *testing.T) {
|
||||
} else if cnt != 1 {
|
||||
t.Errorf("Expected only one document received:%v", cnt)
|
||||
}
|
||||
if err := os.RemoveAll(cfg.AnalyzerSCfg().DBPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,4 +62,7 @@ func TestNewAnalyzeConnector(t *testing.T) {
|
||||
} else if cnt != 1 {
|
||||
t.Errorf("Expected only one document received:%v", cnt)
|
||||
}
|
||||
if err := os.RemoveAll(cfg.AnalyzerSCfg().DBPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user