fix failing tests

This commit is contained in:
arberkatellari
2025-05-14 09:35:27 +02:00
committed by Dan Christian Bogos
parent a4e45cd7db
commit 7fe60c2b8b
9 changed files with 43 additions and 20 deletions

View File

@@ -510,6 +510,7 @@ func testActionsSetStatQueueProfileBeforeExecuteResetSQ(t *testing.T) {
},
},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
},
}
@@ -538,6 +539,7 @@ func testActionsSetStatQueueProfileBeforeExecuteResetSQ(t *testing.T) {
},
},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
}
var rplySqPrf engine.StatQueueProfile

View File

@@ -209,6 +209,7 @@ func testStatsSetStatQueueProfiles(t *testing.T) {
},
},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
},
}
@@ -247,6 +248,7 @@ func testStatsSetStatQueueProfiles(t *testing.T) {
},
},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
},
}
@@ -303,6 +305,7 @@ func testStatsGetStatQueueAfterSet(t *testing.T) {
},
},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
}
rplyStrMetrics := make(map[string]string)
@@ -382,6 +385,7 @@ func testStatsGetStatQueueAfterSet(t *testing.T) {
},
},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
}
rplyStrMetrics = map[string]string{}
@@ -489,6 +493,7 @@ func testStatsGetStatQueueProfiles1(t *testing.T) {
},
},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
},
{
Tenant: "cgrates.org",
@@ -516,6 +521,7 @@ func testStatsGetStatQueueProfiles1(t *testing.T) {
},
},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
},
}
if err := sqRPC.Call(context.Background(), utils.AdminSv1GetStatQueueProfiles,
@@ -562,6 +568,7 @@ func testStatsGetStatQueueProfilesWithPrefix(t *testing.T) {
},
},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
},
}
if err := sqRPC.Call(context.Background(), utils.AdminSv1GetStatQueueProfiles,
@@ -1317,6 +1324,7 @@ func testStatsSetStatQueueProfileBeforeProcessEv(t *testing.T) {
},
},
ThresholdIDs: []string{"THD_ID"},
Stored: true,
},
}
@@ -1345,6 +1353,7 @@ func testStatsSetStatQueueProfileBeforeProcessEv(t *testing.T) {
},
},
ThresholdIDs: []string{"THD_ID"},
Stored: true,
}
var rplySqPrf engine.StatQueueProfile

View File

@@ -59,16 +59,22 @@ func TestLoadConfig(t *testing.T) {
User: "cgrates2",
Password: "toor",
Opts: &config.DataDBOpts{
RedisMaxConns: 10,
RedisConnectAttempts: 20,
RedisSentinel: "sentinel1",
MongoQueryTimeout: 10 * time.Second,
MongoConnScheme: "mongodb",
RedisClusterSync: 5 * time.Second,
RedisClusterOndownDelay: 0,
RedisCluster: false,
RedisPoolPipelineWindow: 150 * time.Microsecond,
RedisTLS: false,
InternalDBDumpPath: "/var/lib/cgrates/internal_db/datadb",
InternalDBBackupPath: "/var/lib/cgrates/internal_db/backup/datadb",
InternalDBStartTimeout: 300000000000,
InternalDBDumpInterval: 0,
InternalDBRewriteInterval: 0,
InternalDBFileSizeLimit: 1073741824,
RedisMaxConns: 10,
RedisConnectAttempts: 20,
RedisSentinel: "sentinel1",
MongoQueryTimeout: 10 * time.Second,
MongoConnScheme: "mongodb",
RedisClusterSync: 5 * time.Second,
RedisClusterOndownDelay: 0,
RedisCluster: false,
RedisPoolPipelineWindow: 150 * time.Microsecond,
RedisTLS: false,
},
RmtConns: []string{},
RplConns: []string{},

View File

@@ -614,6 +614,7 @@ func testCgrLdrGetStatsProfileAfterLoad(t *testing.T) {
},
Blockers: utils.DynamicBlockers{{Blocker: true}},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
}
var replySts *engine.StatQueueProfile
if err := cgrLdrBIRPC.Call(context.Background(), utils.AdminSv1GetStatQueueProfile,

View File

@@ -1,3 +1,3 @@
#Tenant[0],Id[1],FilterIDs[2],Weights[3],TTL[4],Limit[5],AllocationMessage[6],Blocker[7],Stored[8],ThresholdIDs[9]
cgrates.org,RES_GRP1,*string:~*req.Account:1001|1002|1003,;0,-1,10,,,,*none
cgrates.org,RES_GRP2,*string:~*req.Account:1004,;0,-1,10,,,,*none
cgrates.org,RES_GRP1,*string:~*req.Account:1001|1002|1003,;0,-1,10,,,true,*none
cgrates.org,RES_GRP2,*string:~*req.Account:1004,;0,-1,10,,,true,*none
1 #Tenant[0] Id[1] FilterIDs[2] Weights[3] TTL[4] Limit[5] AllocationMessage[6] Blocker[7] Stored[8] ThresholdIDs[9]
2 cgrates.org RES_GRP1 *string:~*req.Account:1001|1002|1003 ;0 -1 10 true *none
3 cgrates.org RES_GRP2 *string:~*req.Account:1004 ;0 -1 10 true *none

View File

@@ -1,12 +1,12 @@
#Tenant[0],Id[1],FilterIDs[2],Weights[3],Blockers[4],QueueLength[5],TTL[6],MinItems[7],Stored[8],ThresholdIDs[9],MetricIDs[10],MetricFilterIDs[11],MetricBlockers[12]
cgrates.org,STATS_VENDOR_1,*string:~*req.Category:vendor1,,,100,-1,,,*none,*acd;*tcd;*acc;*tcc;*sum#1,,
cgrates.org,STATS_VENDOR_2,*string:~*req.Category:vendor2,,,100,-1,,,*none,*acd;*tcd;*acc;*tcc;*sum#1;*distinct#~*opts.*usage,,
cgrates.org,STATS_TCC1,,,,100,-1,,,*none,*tcc,,
cgrates.org,STATS_VENDOR_1,*string:~*req.Category:vendor1,,,100,-1,,true,*none,*acd;*tcd;*acc;*tcc;*sum#1,,
cgrates.org,STATS_VENDOR_2,*string:~*req.Category:vendor2,,,100,-1,,true,*none,*acd;*tcd;*acc;*tcc;*sum#1;*distinct#~*opts.*usage,,
cgrates.org,STATS_TCC1,,,,100,-1,,true,*none,*tcc,,
cgrates.org,STATS_TCC2,Fltr_tcc,,,100,-1,,,*none,*tcc,,
cgrates.org,STATS_TOP1,*string:~*req.Account:1010,,,100,-1,,,*none,*asr;*acd,,
cgrates.org,STATS_TOP2,*string:~*req.Destination:1021,,,100,-1,,,*none,*asr;*acd,,
cgrates.org,STATS_TOP3,*string:~*req.Category:call,,,100,-1,,,*none,*asr;*acd,,
cgrates.org,STATS_TOP1,*string:~*req.Account:1010,,,100,-1,,true,*none,*asr;*acd,,
cgrates.org,STATS_TOP2,*string:~*req.Destination:1021,,,100,-1,,true,*none,*asr;*acd,,
cgrates.org,STATS_TOP3,*string:~*req.Category:call,,,100,-1,,true,*none,*asr;*acd,,
1 #Tenant[0] Id[1] FilterIDs[2] Weights[3] Blockers[4] QueueLength[5] TTL[6] MinItems[7] Stored[8] ThresholdIDs[9] MetricIDs[10] MetricFilterIDs[11] MetricBlockers[12]
2 cgrates.org STATS_VENDOR_1 *string:~*req.Category:vendor1 100 -1 true *none *acd;*tcd;*acc;*tcc;*sum#1
3 cgrates.org STATS_VENDOR_2 *string:~*req.Category:vendor2 100 -1 true *none *acd;*tcd;*acc;*tcc;*sum#1;*distinct#~*opts.*usage
4 cgrates.org STATS_TCC1 100 -1 true *none *tcc
5 cgrates.org STATS_TCC2 Fltr_tcc 100 -1 *none *tcc
6 cgrates.org STATS_TOP1 *string:~*req.Account:1010 100 -1 true *none *asr;*acd
7 cgrates.org STATS_TOP2 *string:~*req.Destination:1021 100 -1 true *none *asr;*acd
8 cgrates.org STATS_TOP3 *string:~*req.Category:call 100 -1 true *none *asr;*acd
9
10
11
12

View File

@@ -38,6 +38,10 @@ import (
)
func TestOfflineInternal(t *testing.T) { // run with sudo
switch *utils.DBType {
case utils.MetaMongo, utils.MetaMySQL, utils.MetaPostgres:
t.SkipNow()
}
paths := []string{
path.Join(*utils.DataDir, "conf", "samples", "offline_internal"), // dump -1
path.Join(*utils.DataDir, "conf", "samples", "offline_internal_ms"), // dump ms

View File

@@ -112,6 +112,7 @@ func testV1RsSetProfile(t *testing.T) {
},
},
ThresholdIDs: []string{utils.MetaNone},
Stored: true,
},
}
var result string

View File

@@ -106,8 +106,8 @@ func TestTrendSchedule(t *testing.T) {
cgrates.org,TREND_1,@every 1s,Stats1_1,,-1,-1,1,*last,1,false,Threshold1;Threshold2
cgrates.org,TREND_2,@every 1s,Stats1_2,,-1,-1,1,*last,1,false,*none`,
utils.StatsCsv: `#Tenant[0],Id[1],FilterIDs[2],Weights[3],Blockers[4],QueueLength[5],TTL[6],MinItems[7],Stored[8],ThresholdIDs[9],MetricIDs[10],MetricFilterIDs[11],MetricBlockers[12]
cgrates.org,Stats1_1,*string:~*req.Account:1001,,,,-1,,,,*tcc;*acd;*tcd,,
cgrates.org,Stats1_2,*string:~*req.Account:1002,,,,-1,,,,*sum#~*opts.*usage;*pdd,,`,
cgrates.org,Stats1_1,*string:~*req.Account:1001,,,,-1,,true,,*tcc;*acd;*tcd,,
cgrates.org,Stats1_2,*string:~*req.Account:1002,,,,-1,,true,,*sum#~*opts.*usage;*pdd,,`,
utils.ThresholdsCsv: `#Tenant[0],Id[1],FilterIDs[2],Weight[3],MaxHits[4],MinHits[5],MinSleep[6],Blocker[7],ActionProfileIDs[8],Async[9]
cgrates.org,Threshold1,*string:~*req.Metrics.*acd.ID:*acd,;10,-1,0,1s,false,,true
cgrates.org,Threshold2,*string:~*req.Metrics.*pdd.ID:*pdd,;10,-1,0,1s,false,,true`}