fixing tests for cgr-migrator migrate to exec ref

This commit is contained in:
Anthony Somerset
2019-06-19 08:17:56 +02:00
committed by Dan Christian Bogos
parent 9841dfc7eb
commit 616b16c8d4
2 changed files with 16 additions and 16 deletions

View File

@@ -46,28 +46,28 @@ func TestVersionCompare(t *testing.T) {
utils.SharedGroups: 2, utils.CostDetails: 2,
utils.SessionSCosts: 2}
message1 := y.Compare(x, utils.MONGO, true)
if message1 != "cgr-migrator -migrate=*accounts" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -migrate=*accounts", message1)
if message1 != "cgr-migrator -exec=*accounts" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -exec=*accounts", message1)
}
message2 := z.Compare(x, utils.MONGO, true)
if message2 != "cgr-migrator -migrate=*action_plans" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -migrate=*action_plans", message2)
if message2 != "cgr-migrator -exec=*action_plans" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -exec=*action_plans", message2)
}
message3 := q.Compare(x, utils.MONGO, true)
if message3 != "cgr-migrator -migrate=*shared_groups" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -migrate=*shared_groups", message3)
if message3 != "cgr-migrator -exec=*shared_groups" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -exec=*shared_groups", message3)
}
message4 := c.Compare(x, utils.MONGO, false)
if message4 != "cgr-migrator -migrate=*cost_details" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -migrate=*cost_details", message4)
if message4 != "cgr-migrator -exec=*cost_details" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -exec=*cost_details", message4)
}
message5 := a.Compare(b, utils.MYSQL, false)
if message5 != "cgr-migrator -migrate=*sessions_costs" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -migrate=*sessions_costs", message5)
if message5 != "cgr-migrator -exec=*sessions_costs" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -exec=*sessions_costs", message5)
}
message6 := a.Compare(b, utils.POSTGRES, false)
if message6 != "cgr-migrator -migrate=*sessions_costs" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -migrate=*sessions_costs", message6)
if message6 != "cgr-migrator -exec=*sessions_costs" {
t.Errorf("Error failed to compare to curent version expected: %s received: %s", "cgr-migrator -exec=*sessions_costs", message6)
}
}

View File

@@ -161,13 +161,13 @@ func testVersion(t *testing.T) {
currentVersion = allVersions
testVersion = allVersions
testVersion[utils.Accounts] = 1
test = "Migration needed: please backup cgr data and run : <cgr-migrator -migrate=*accounts>"
test = "Migration needed: please backup cgr data and run : <cgr-migrator -exec=*accounts>"
case utils.MONGO, utils.REDIS:
currentVersion = dataDbVersions
testVersion = dataDbVersions
testVersion[utils.Accounts] = 1
test = "Migration needed: please backup cgr data and run : <cgr-migrator -migrate=*accounts>"
test = "Migration needed: please backup cgr data and run : <cgr-migrator -exec=*accounts>"
}
//dataDB
@@ -203,12 +203,12 @@ func testVersion(t *testing.T) {
currentVersion = allVersions
testVersion = allVersions
testVersion[utils.Accounts] = 1
test = "Migration needed: please backup cgr data and run : <cgr-migrator -migrate=*accounts>"
test = "Migration needed: please backup cgr data and run : <cgr-migrator -exec=*accounts>"
case utils.MONGO, utils.POSTGRES, utils.MYSQL:
currentVersion = storDbVersions
testVersion = allVersions
testVersion[utils.CostDetails] = 1
test = "Migration needed: please backup cgr data and run : <cgr-migrator -migrate=*cost_details>"
test = "Migration needed: please backup cgr data and run : <cgr-migrator -exec=*cost_details>"
}
//storageDb