mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Revise integration tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
031cf1fe43
commit
3403a91a2b
@@ -488,7 +488,6 @@ func testCGRConfigReloadERs(t *testing.T) {
|
||||
CSVHeaderDefineChar: utils.StringPointer(":"),
|
||||
CSVRowLength: utils.IntPointer(0),
|
||||
PartialOrderField: utils.StringPointer("~*req.AnswerTime"),
|
||||
XMLRootPath: utils.StringPointer(utils.EmptyString),
|
||||
NATSSubject: utils.StringPointer("cgrates_cdrs"),
|
||||
},
|
||||
},
|
||||
@@ -510,8 +509,8 @@ func testCGRConfigReloadERs(t *testing.T) {
|
||||
CSVRowLength: utils.IntPointer(0),
|
||||
PartialOrderField: utils.StringPointer("~*req.AnswerTime"),
|
||||
PartialCacheAction: utils.StringPointer(utils.MetaNone),
|
||||
XMLRootPath: utils.StringPointer(utils.EmptyString),
|
||||
NATSSubject: utils.StringPointer("cgrates_cdrs"),
|
||||
|
||||
NATSSubject: utils.StringPointer("cgrates_cdrs"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -700,7 +699,6 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) {
|
||||
"csvRowLength": 0.,
|
||||
"partialOrderField": "~*req.AnswerTime",
|
||||
utils.PartialCacheActionOpt: utils.MetaNone,
|
||||
"xmlRootPath": "",
|
||||
"natsSubject": "cgrates_cdrs",
|
||||
},
|
||||
"partial_commit_fields": []any{},
|
||||
@@ -724,7 +722,6 @@ func testCgrCfgV1ReloadConfigSection(t *testing.T) {
|
||||
"csvRowLength": 0.,
|
||||
"partialOrderField": "~*req.AnswerTime",
|
||||
utils.PartialCacheActionOpt: utils.MetaNone,
|
||||
"xmlRootPath": "",
|
||||
"natsSubject": "cgrates_cdrs",
|
||||
},
|
||||
"partial_commit_fields": []any{},
|
||||
|
||||
@@ -176,6 +176,7 @@ func testDspChcPrecacheStatus(t *testing.T) {
|
||||
utils.CacheDiameterMessages: utils.MetaReady,
|
||||
utils.CacheAttributeFilterIndexes: utils.MetaReady,
|
||||
utils.CacheResourceFilterIndexes: utils.MetaReady,
|
||||
utils.MetaSentryPeer: utils.MetaReady,
|
||||
utils.CacheStatFilterIndexes: utils.MetaReady,
|
||||
utils.CacheThresholdFilterIndexes: utils.MetaReady,
|
||||
utils.CacheRouteFilterIndexes: utils.MetaReady,
|
||||
|
||||
@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package dispatchers
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
@@ -343,7 +344,7 @@ func testDspRplDispatcherProfile(t *testing.T) {
|
||||
allEngine.stopEngine(t)
|
||||
|
||||
// Get DispatcherProfile
|
||||
if err := dispEngine.RPC.Call(utils.ReplicatorSv1GetDispatcherProfile, argsDispatcherProfile, &reply); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := dispEngine.RPC.Call(utils.ReplicatorSv1GetDispatcherProfile, argsDispatcherProfile, &reply); err == nil || !errors.Is(err, utils.ErrDSPProfileNotFound) {
|
||||
t.Errorf("Expecting: %+v, received: %+v, ", utils.ErrDSPProfileNotFound, err)
|
||||
}
|
||||
|
||||
|
||||
@@ -161,14 +161,13 @@ func TestSetGetRemoveConfigSectionsDrvMongo(t *testing.T) {
|
||||
}
|
||||
defer db.Close()
|
||||
sectionIDs := []string{"thresholds", "resources"}
|
||||
expected := make(map[string][]byte)
|
||||
|
||||
// Try to retrieve the values before setting them (should receive an empty map)
|
||||
if rcv, err := db.GetConfigSectionsDrv(context.Background(), "1234", sectionIDs); err == nil ||
|
||||
err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrNotFound, err)
|
||||
} else if !reflect.DeepEqual(rcv, expected) {
|
||||
t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ToJSON(expected), utils.ToJSON(rcv))
|
||||
} else if rcv != nil {
|
||||
t.Errorf("expected: <%+v>, \nreceived: <%+v>", nil, utils.ToJSON(rcv))
|
||||
}
|
||||
|
||||
ms, err := utils.NewMarshaler(utils.JSON)
|
||||
@@ -267,8 +266,8 @@ func TestSetGetRemoveConfigSectionsDrvMongo(t *testing.T) {
|
||||
if rcv, err := db.GetConfigSectionsDrv(context.Background(), "1234", sectionIDs); err == nil ||
|
||||
err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrNotFound, err)
|
||||
} else if !reflect.DeepEqual(rcv, expected) {
|
||||
t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ToJSON(expected), utils.ToJSON(rcv))
|
||||
} else if rcv != nil {
|
||||
t.Errorf("expected: <%+v>, \nreceived: <%+v>", nil, utils.ToJSON(rcv))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -161,7 +161,7 @@ func testTutSMGCacheStats(t *testing.T) {
|
||||
expectedStats[utils.CacheRouteProfiles].Items = 12
|
||||
expectedStats[utils.CacheAttributeProfiles].Items = 8
|
||||
expectedStats[utils.MetaDefault].Items = 0
|
||||
expectedStats[utils.CacheLoadIDs].Items = 27
|
||||
expectedStats[utils.CacheLoadIDs].Items = 28
|
||||
expectedStats[utils.CacheChargerProfiles].Items = 3
|
||||
expectedStats[utils.CacheRPCConnections].Items = 1
|
||||
expectedStats[utils.CacheThresholdFilterIndexes].Items = 1
|
||||
|
||||
Reference in New Issue
Block a user