From 4dbeca0fb7d992055cb37ff330591bfd48a7decd Mon Sep 17 00:00:00 2001 From: porosnicuadrian Date: Thu, 1 Apr 2021 17:51:15 +0300 Subject: [PATCH] Fixed tests in apier/v1 for internal --- apier/v1/chargers_it_test.go | 4 +++- apier/v1/resourcesv1_it_test.go | 2 +- apier/v1/stats_it_test.go | 2 +- apier/v1/thresholds_it_test.go | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apier/v1/chargers_it_test.go b/apier/v1/chargers_it_test.go index 034e8b83b..17ee2511a 100644 --- a/apier/v1/chargers_it_test.go +++ b/apier/v1/chargers_it_test.go @@ -105,9 +105,11 @@ var ( //Test start here func TestChargerSIT(t *testing.T) { + sTestsChargerCache := sTestsCharger switch *dbType { case utils.MetaInternal: chargerConfigDIR = "tutinternal" + sTestsChargerCache = sTestsChargerCache[:len(sTestsChargerCache)-10] case utils.MetaMySQL: chargerConfigDIR = "tutmysql" case utils.MetaMongo: @@ -117,7 +119,7 @@ func TestChargerSIT(t *testing.T) { default: t.Fatal("Unknown Database type") } - for _, stest := range sTestsCharger { + for _, stest := range sTestsChargerCache { t.Run(chargerConfigDIR, stest) } } diff --git a/apier/v1/resourcesv1_it_test.go b/apier/v1/resourcesv1_it_test.go index ed42ace24..4d4a597cb 100644 --- a/apier/v1/resourcesv1_it_test.go +++ b/apier/v1/resourcesv1_it_test.go @@ -92,7 +92,7 @@ func TestRsV1IT(t *testing.T) { switch *dbType { case utils.MetaInternal: rlsV1ConfDIR = "tutinternal" - sTestsRLSV1 = sTestsRLSV1[:len(sTestsRLSV1)-4] + sTestsRLSV1 = sTestsRLSV1[:len(sTestsRLSV1)-14] case utils.MetaMySQL: rlsV1ConfDIR = "tutmysql" case utils.MetaMongo: diff --git a/apier/v1/stats_it_test.go b/apier/v1/stats_it_test.go index adf915f3e..5829ec406 100644 --- a/apier/v1/stats_it_test.go +++ b/apier/v1/stats_it_test.go @@ -122,7 +122,7 @@ func TestSTSV1IT(t *testing.T) { switch *dbType { case utils.MetaInternal: stsV1ConfDIR = "tutinternal" - sTestsStatSV1 = sTestsStatSV1[:len(sTestsStatSV1)-4] + sTestsStatSV1 = sTestsStatSV1[:len(sTestsStatSV1)-15] case utils.MetaMySQL: stsV1ConfDIR = "tutmysql" case utils.MetaMongo: diff --git a/apier/v1/thresholds_it_test.go b/apier/v1/thresholds_it_test.go index 48291581c..205e69682 100644 --- a/apier/v1/thresholds_it_test.go +++ b/apier/v1/thresholds_it_test.go @@ -246,9 +246,11 @@ var ( // Test start here func TestTSV1IT(t *testing.T) { + sTestsThresholdCacheSV1 := sTestsThresholdSV1 switch *dbType { case utils.MetaInternal: tSv1ConfDIR = "tutinternal" + sTestsThresholdCacheSV1 = sTestsThresholdCacheSV1[:len(sTestsThresholdCacheSV1)-10] case utils.MetaMySQL: tSv1ConfDIR = "tutmysql" case utils.MetaMongo: @@ -259,7 +261,7 @@ func TestTSV1IT(t *testing.T) { t.Fatal("Unknown Database type") } - for _, stest := range sTestsThresholdSV1 { + for _, stest := range sTestsThresholdCacheSV1 { t.Run(tSv1ConfDIR, stest) } }