mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 14:48:43 +05:00
Fix apier/v2 integration tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
5322358638
commit
be19930503
@@ -143,7 +143,7 @@ func testV2CDRsProcessCDR(t *testing.T) {
|
||||
} else if reply != utils.OK {
|
||||
t.Error("Unexpected reply received: ", reply)
|
||||
}
|
||||
time.Sleep(time.Duration(100) * time.Millisecond) // Give time for CDR to be rated
|
||||
time.Sleep(time.Duration(150) * time.Millisecond) // Give time for CDR to be rated
|
||||
}
|
||||
|
||||
func testV2CDRsGetCdrs(t *testing.T) {
|
||||
@@ -223,7 +223,7 @@ func testV2CDRsRateCDRs(t *testing.T) {
|
||||
} else if reply != utils.OK {
|
||||
t.Error("Unexpected reply received: ", reply)
|
||||
}
|
||||
time.Sleep(time.Duration(100) * time.Millisecond) // Give time for CDR to be rated
|
||||
time.Sleep(time.Duration(150) * time.Millisecond) // Give time for CDR to be rated
|
||||
}
|
||||
|
||||
func testV2CDRsGetCdrs2(t *testing.T) {
|
||||
@@ -291,7 +291,7 @@ func testV2CDRsUsageNegative(t *testing.T) {
|
||||
} else if reply != utils.OK {
|
||||
t.Error("Unexpected reply received: ", reply)
|
||||
}
|
||||
time.Sleep(time.Duration(100) * time.Millisecond) // Give time for CDR to be rated
|
||||
time.Sleep(time.Duration(150) * time.Millisecond) // Give time for CDR to be rated
|
||||
|
||||
var cdrs []*engine.ExternalCDR
|
||||
args := utils.RPCCDRsFilter{RunIDs: []string{utils.MetaRaw}, OriginIDs: []string{"testV2CDRsUsageNegative"}}
|
||||
@@ -336,7 +336,7 @@ func testV2CDRsUsageNegative(t *testing.T) {
|
||||
}
|
||||
|
||||
func testV2CDRsKillEngine(t *testing.T) {
|
||||
if err := engine.KillEngine(100); err != nil {
|
||||
if err := engine.KillEngine(*waitRater); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,16 @@
|
||||
// Used in apier_local_tests
|
||||
// Starts rater, cdrs and mediator connecting over internal channel
|
||||
|
||||
"general": {
|
||||
"log_level": 7,
|
||||
},
|
||||
|
||||
"stor_db": {
|
||||
"db_type": "postgres", // stor database type to use: <mysql|postgres>
|
||||
"db_port": 5432, // the port to reach the stordb
|
||||
"db_password": "CGRateS.org"
|
||||
},
|
||||
|
||||
|
||||
"rals": {
|
||||
"enabled": true, // enable Rater service: <true|false>
|
||||
},
|
||||
|
||||
@@ -762,7 +762,9 @@ func (cdrS *CdrServer) attrSProcessEvent(cgrEv *utils.CGREvent) (err error) {
|
||||
// V2ProcessCDR will process the CDR out of CGREvent
|
||||
func (cdrS *CdrServer) V2ProcessCDR(cgrEv *utils.CGREvent, reply *string) (err error) {
|
||||
if cdrS.attrS != nil {
|
||||
cdrS.attrSProcessEvent(cgrEv)
|
||||
if err := cdrS.attrSProcessEvent(cgrEv); err != nil {
|
||||
return utils.NewErrServerError(err)
|
||||
}
|
||||
}
|
||||
rawCDR, err := NewMapEvent(cgrEv.Event).AsCDR(cdrS.cgrCfg, cgrEv.Tenant, cdrS.Timezone())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user