From 5f371caff3409ce4086844b5529353fbec483c40 Mon Sep 17 00:00:00 2001 From: jananivMS Date: Tue, 14 Apr 2020 20:19:14 -0600 Subject: [PATCH] test fixes --- controllers/mysql_combined_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/controllers/mysql_combined_test.go b/controllers/mysql_combined_test.go index 1ee87db8a1b..a0cc952fbbe 100644 --- a/controllers/mysql_combined_test.go +++ b/controllers/mysql_combined_test.go @@ -7,10 +7,8 @@ package controllers import ( "context" - "fmt" "testing" - "github.com/Azure/azure-service-operator/pkg/resourcemanager/config" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" azurev1alpha1 "github.com/Azure/azure-service-operator/api/v1alpha1" @@ -25,6 +23,7 @@ func TestMySQLHappyPath(t *testing.T) { rgLocation := "eastus2" rgName := tc.resourceGroupName mySQLServerName := GenerateTestResourceNameWithRandom("mysql-srv", 10) + mySQLReplicaName := GenerateTestResourceNameWithRandom("mysql-rep", 10) // Create the mySQLServer object and expect the Reconcile to be created mySQLServerInstance := azurev1alpha1.NewDefaultMySQLServer(mySQLServerName, rgName, rgLocation) @@ -32,8 +31,7 @@ func TestMySQLHappyPath(t *testing.T) { RequireInstance(ctx, t, tc, mySQLServerInstance) // Create a mySQL replica - fullSourceServerId := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforMySQL/servers/%s", config.Subscription(), rgName, mySQLServerName) - mySQLReplicaInstance := azurev1alpha1.NewReplicaMySQLServer(mySQLServerName, rgName, rgLocation, fullSourceServerId) + mySQLReplicaInstance := azurev1alpha1.NewReplicaMySQLServer(mySQLReplicaName, rgName, rgLocation, mySQLServerInstance.Status.ResourceId) EnsureInstance(ctx, t, tc, mySQLReplicaInstance)