mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated integration tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
eae34b9217
commit
e7ecc05c73
@@ -651,7 +651,7 @@ func testAttributeSProcessEventWithHeader(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Blocker: true,
|
||||
Weight: 10,
|
||||
Weight: 5,
|
||||
},
|
||||
}
|
||||
var result string
|
||||
@@ -1192,10 +1192,12 @@ func testAttributeSProcessWithMultipleRuns2(t *testing.T) {
|
||||
var rplyEv engine.AttrSProcessEventReply
|
||||
if err := attrSRPC.Call(utils.AttributeSv1ProcessEvent,
|
||||
attrArgs, &rplyEv); err != nil {
|
||||
t.Error(err)
|
||||
t.Fatal(err)
|
||||
} else if !reflect.DeepEqual(eRply.MatchedProfiles, rplyEv.MatchedProfiles) {
|
||||
t.Errorf("Expecting %+v, received: %+v", eRply.MatchedProfiles, rplyEv.MatchedProfiles)
|
||||
} else if !reflect.DeepEqual(eRply.AlteredFields, rplyEv.AlteredFields) {
|
||||
}
|
||||
sort.Strings(rplyEv.AlteredFields)
|
||||
if !reflect.DeepEqual(eRply.AlteredFields, rplyEv.AlteredFields) {
|
||||
t.Errorf("Expecting %+v, received: %+v", eRply.AlteredFields, rplyEv.AlteredFields)
|
||||
} else if !reflect.DeepEqual(eRply.CGREvent.Event, rplyEv.CGREvent.Event) {
|
||||
t.Errorf("Expecting %+v, received: %+v", eRply.CGREvent.Event, rplyEv.CGREvent.Event)
|
||||
|
||||
@@ -75,22 +75,6 @@ func TestConcReqsQueueJSON(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestConcReqsBusyGOB(t *testing.T) {
|
||||
concReqsConfigDIR = "conc_reqs_busy"
|
||||
encoding = utils.StringPointer(utils.MetaGOB)
|
||||
for _, stest := range sTestsConcReqs {
|
||||
t.Run(concReqsConfigDIR, stest)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConcReqsQueueGOB(t *testing.T) {
|
||||
concReqsConfigDIR = "conc_reqs_queue"
|
||||
encoding = utils.StringPointer(utils.MetaGOB)
|
||||
for _, stest := range sTestsConcReqs {
|
||||
t.Run(concReqsConfigDIR, stest)
|
||||
}
|
||||
}
|
||||
|
||||
func testConcReqsInitCfg(t *testing.T) {
|
||||
var err error
|
||||
concReqsCfgPath = path.Join(*dataDir, "conf", "samples", concReqsConfigDIR)
|
||||
|
||||
@@ -32,14 +32,14 @@ func (apierSv1 *APIerSv1) GetRateProfile(arg *utils.TenantIDWithArgDispatcher, r
|
||||
if missing := utils.MissingStructFields(arg, []string{"Tenant", "ID"}); len(missing) != 0 { //Params missing
|
||||
return utils.NewErrMandatoryIeMissing(missing...)
|
||||
}
|
||||
if rPrf, err := apierSv1.DataManager.GetRateProfile(arg.Tenant, arg.ID, true, true, utils.NonTransactional); err != nil {
|
||||
rPrf, err := apierSv1.DataManager.GetRateProfile(arg.Tenant, arg.ID, true, true, utils.NonTransactional)
|
||||
if err != nil {
|
||||
if err.Error() != utils.ErrNotFound.Error() {
|
||||
err = utils.NewErrServerError(err)
|
||||
}
|
||||
return err
|
||||
} else {
|
||||
*reply = *rPrf
|
||||
}
|
||||
*reply = *rPrf
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -161,6 +161,7 @@ func testInternalRemoteITStartEngine(t *testing.T) {
|
||||
if _, err := engine.StartEngine(internalCfgPath, 500); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
}
|
||||
|
||||
func testInternalRemoteITRPCConn(t *testing.T) {
|
||||
@@ -169,17 +170,14 @@ func testInternalRemoteITRPCConn(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
engineTwoRPC, err = newRPCClient(engineTwoCfg.ListenCfg())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
internalRPC, err = newRPCClient(internalCfg.ListenCfg())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
}
|
||||
|
||||
func testInternalRemoteLoadDataInEngineTwo(t *testing.T) {
|
||||
@@ -674,10 +672,10 @@ func testInternalRemoteITGetDispatcherHost(t *testing.T) {
|
||||
Tenant: "cgrates.org",
|
||||
ID: "DspHst1",
|
||||
Conns: []*config.RemoteHost{
|
||||
&config.RemoteHost{
|
||||
{
|
||||
Address: "*internal",
|
||||
},
|
||||
&config.RemoteHost{
|
||||
{
|
||||
Address: ":2012",
|
||||
Transport: utils.MetaJSON,
|
||||
TLS: true,
|
||||
|
||||
@@ -262,7 +262,7 @@ func testCGRConfigReloadSupplierS(t *testing.T) {
|
||||
ResourceSConns: []string{},
|
||||
StatSConns: []string{},
|
||||
AttributeSConns: []string{},
|
||||
ResponderSConns: []string{},
|
||||
RALsConns: []string{},
|
||||
IndexedSelects: true,
|
||||
DefaultRatio: 1,
|
||||
}
|
||||
|
||||
@@ -2344,14 +2344,7 @@ func (dm *DataManager) GetAttributeProfile(tenant, id string, cacheRead, cacheWr
|
||||
return x.(*AttributeProfile), nil
|
||||
}
|
||||
}
|
||||
isInline := false
|
||||
for typeAttr := range utils.AttrInlineTypes {
|
||||
if strings.HasPrefix(id, typeAttr) {
|
||||
isInline = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if isInline {
|
||||
if strings.HasPrefix(id, utils.Meta) {
|
||||
attrPrfl, err = NewAttributeFromInline(tenant, id)
|
||||
return // do not set inline attributes in cache it breaks the interanal db matching
|
||||
} else if dm == nil {
|
||||
|
||||
@@ -23,8 +23,6 @@ var (
|
||||
Account, Subject, Destination, SetupTime, AnswerTime, Usage, COST, RATED, Partial, RunID,
|
||||
PreRated, CostSource, CostDetails, ExtraInfo, OrderID})
|
||||
PostPaidRatedSlice = []string{META_POSTPAID, META_RATED}
|
||||
AttrInlineTypes = NewStringSet([]string{META_CONSTANT, MetaVariable, META_COMPOSED, META_USAGE_DIFFERENCE,
|
||||
MetaSum, MetaValueExponent})
|
||||
|
||||
GitLastLog string // If set, it will be processed as part of versioning
|
||||
PosterTransportContentTypes = map[string]string{
|
||||
|
||||
Reference in New Issue
Block a user