From fc1c4fcead98b22869c7d7751bbcee2dd1acd958 Mon Sep 17 00:00:00 2001 From: Bangqi Zhu Date: Fri, 15 Nov 2024 14:50:01 -0800 Subject: [PATCH] comment e2e test for official/v0.3.2 Signed-off-by: Bangqi Zhu --- test/e2e/preset_test.go | 194 +++++++++++++------------- test/e2e/webhook_test.go | 289 ++++++++++++++++++++------------------- 2 files changed, 242 insertions(+), 241 deletions(-) diff --git a/test/e2e/preset_test.go b/test/e2e/preset_test.go index 3e00a8a8a..09f2a118f 100644 --- a/test/e2e/preset_test.go +++ b/test/e2e/preset_test.go @@ -662,151 +662,151 @@ var _ = Describe("Workspace Preset", func() { Fail("Fail threshold reached") } }) + /* + It("should create a mistral workspace with preset public mode successfully", func() { + numOfNode := 1 + workspaceObj := createMistralWorkspaceWithPresetPublicMode(numOfNode) - It("should create a mistral workspace with preset public mode successfully", func() { - numOfNode := 1 - workspaceObj := createMistralWorkspaceWithPresetPublicMode(numOfNode) + defer cleanupResources(workspaceObj) + time.Sleep(30 * time.Second) - defer cleanupResources(workspaceObj) - time.Sleep(30 * time.Second) + validateCreateNode(workspaceObj, numOfNode) + validateResourceStatus(workspaceObj) - validateCreateNode(workspaceObj, numOfNode) - validateResourceStatus(workspaceObj) + time.Sleep(30 * time.Second) - time.Sleep(30 * time.Second) - - validateAssociatedService(workspaceObj) + validateAssociatedService(workspaceObj) - validateInferenceResource(workspaceObj, int32(numOfNode), false) + validateInferenceResource(workspaceObj, int32(numOfNode), false) - validateWorkspaceReadiness(workspaceObj) - }) + validateWorkspaceReadiness(workspaceObj) + }) - It("should create a Phi-2 workspace with preset public mode successfully", func() { - numOfNode := 1 - workspaceObj := createPhi2WorkspaceWithPresetPublicMode(numOfNode) + It("should create a Phi-2 workspace with preset public mode successfully", func() { + numOfNode := 1 + workspaceObj := createPhi2WorkspaceWithPresetPublicMode(numOfNode) - defer cleanupResources(workspaceObj) - time.Sleep(30 * time.Second) + defer cleanupResources(workspaceObj) + time.Sleep(30 * time.Second) - validateCreateNode(workspaceObj, numOfNode) - validateResourceStatus(workspaceObj) + validateCreateNode(workspaceObj, numOfNode) + validateResourceStatus(workspaceObj) - time.Sleep(30 * time.Second) + time.Sleep(30 * time.Second) - validateAssociatedService(workspaceObj) + validateAssociatedService(workspaceObj) - validateInferenceResource(workspaceObj, int32(numOfNode), false) + validateInferenceResource(workspaceObj, int32(numOfNode), false) - validateWorkspaceReadiness(workspaceObj) - }) + validateWorkspaceReadiness(workspaceObj) + }) - It("should create a falcon workspace with preset public mode successfully", func() { - numOfNode := 1 - workspaceObj := createFalconWorkspaceWithPresetPublicMode(numOfNode) + It("should create a falcon workspace with preset public mode successfully", func() { + numOfNode := 1 + workspaceObj := createFalconWorkspaceWithPresetPublicMode(numOfNode) - defer cleanupResources(workspaceObj) - time.Sleep(30 * time.Second) + defer cleanupResources(workspaceObj) + time.Sleep(30 * time.Second) - validateCreateNode(workspaceObj, numOfNode) - validateResourceStatus(workspaceObj) + validateCreateNode(workspaceObj, numOfNode) + validateResourceStatus(workspaceObj) - time.Sleep(30 * time.Second) + time.Sleep(30 * time.Second) - validateAssociatedService(workspaceObj) + validateAssociatedService(workspaceObj) - validateInferenceResource(workspaceObj, int32(numOfNode), false) + validateInferenceResource(workspaceObj, int32(numOfNode), false) - validateWorkspaceReadiness(workspaceObj) - }) - - It("should create a llama 7b workspace with preset private mode successfully", func() { - numOfNode := 1 - modelVersion, ok := modelInfo[PresetLlama2AChat] - if !ok { - Fail(fmt.Sprintf("Model version for %s not found", PresetLlama2AChat)) - } - workspaceObj := createLlama7BWorkspaceWithPresetPrivateMode(aiModelsRegistry, aiModelsRegistrySecret, modelVersion, numOfNode) + validateWorkspaceReadiness(workspaceObj) + }) - defer cleanupResources(workspaceObj) - time.Sleep(30 * time.Second) + It("should create a llama 7b workspace with preset private mode successfully", func() { + numOfNode := 1 + modelVersion, ok := modelInfo[PresetLlama2AChat] + if !ok { + Fail(fmt.Sprintf("Model version for %s not found", PresetLlama2AChat)) + } + workspaceObj := createLlama7BWorkspaceWithPresetPrivateMode(aiModelsRegistry, aiModelsRegistrySecret, modelVersion, numOfNode) - validateCreateNode(workspaceObj, numOfNode) - validateResourceStatus(workspaceObj) + defer cleanupResources(workspaceObj) + time.Sleep(30 * time.Second) - time.Sleep(30 * time.Second) + validateCreateNode(workspaceObj, numOfNode) + validateResourceStatus(workspaceObj) - validateAssociatedService(workspaceObj) + time.Sleep(30 * time.Second) - validateInferenceResource(workspaceObj, int32(numOfNode), false) + validateAssociatedService(workspaceObj) - validateWorkspaceReadiness(workspaceObj) - }) + validateInferenceResource(workspaceObj, int32(numOfNode), false) - It("should create a llama 13b workspace with preset private mode successfully", func() { - if !runLlama13B { - Skip("Skipping llama 13b workspace test") - } - numOfNode := 2 - modelVersion, ok := modelInfo[PresetLlama2BChat] - if !ok { - Fail(fmt.Sprintf("Model version for %s not found", PresetLlama2AChat)) - } - workspaceObj := createLlama13BWorkspaceWithPresetPrivateMode(aiModelsRegistry, aiModelsRegistrySecret, modelVersion, numOfNode) + validateWorkspaceReadiness(workspaceObj) + }) - defer cleanupResources(workspaceObj) + It("should create a llama 13b workspace with preset private mode successfully", func() { + if !runLlama13B { + Skip("Skipping llama 13b workspace test") + } + numOfNode := 2 + modelVersion, ok := modelInfo[PresetLlama2BChat] + if !ok { + Fail(fmt.Sprintf("Model version for %s not found", PresetLlama2AChat)) + } + workspaceObj := createLlama13BWorkspaceWithPresetPrivateMode(aiModelsRegistry, aiModelsRegistrySecret, modelVersion, numOfNode) - time.Sleep(30 * time.Second) + defer cleanupResources(workspaceObj) - validateCreateNode(workspaceObj, numOfNode) - validateResourceStatus(workspaceObj) + time.Sleep(30 * time.Second) - time.Sleep(30 * time.Second) + validateCreateNode(workspaceObj, numOfNode) + validateResourceStatus(workspaceObj) - validateAssociatedService(workspaceObj) + time.Sleep(30 * time.Second) - validateInferenceResource(workspaceObj, int32(numOfNode), true) + validateAssociatedService(workspaceObj) - validateWorkspaceReadiness(workspaceObj) - }) + validateInferenceResource(workspaceObj, int32(numOfNode), true) - It("should create a custom template workspace successfully", func() { - numOfNode := 1 - imageName := "nginx:latest" - workspaceObj := createCustomWorkspaceWithPresetCustomMode(imageName, numOfNode) + validateWorkspaceReadiness(workspaceObj) + }) - defer cleanupResources(workspaceObj) + It("should create a custom template workspace successfully", func() { + numOfNode := 1 + imageName := "nginx:latest" + workspaceObj := createCustomWorkspaceWithPresetCustomMode(imageName, numOfNode) - time.Sleep(30 * time.Second) - validateCreateNode(workspaceObj, numOfNode) - validateResourceStatus(workspaceObj) + defer cleanupResources(workspaceObj) - time.Sleep(30 * time.Second) + time.Sleep(30 * time.Second) + validateCreateNode(workspaceObj, numOfNode) + validateResourceStatus(workspaceObj) - validateInferenceResource(workspaceObj, int32(numOfNode), false) + time.Sleep(30 * time.Second) - validateWorkspaceReadiness(workspaceObj) - }) + validateInferenceResource(workspaceObj, int32(numOfNode), false) - It("should create a Phi-3-mini-128k-instruct workspace with preset public mode successfully", func() { - numOfNode := 1 - workspaceObj := createPhi3WorkspaceWithPresetPublicMode(numOfNode) + validateWorkspaceReadiness(workspaceObj) + }) - defer cleanupResources(workspaceObj) - time.Sleep(30 * time.Second) + It("should create a Phi-3-mini-128k-instruct workspace with preset public mode successfully", func() { + numOfNode := 1 + workspaceObj := createPhi3WorkspaceWithPresetPublicMode(numOfNode) - validateCreateNode(workspaceObj, numOfNode) - validateResourceStatus(workspaceObj) + defer cleanupResources(workspaceObj) + time.Sleep(30 * time.Second) - time.Sleep(30 * time.Second) + validateCreateNode(workspaceObj, numOfNode) + validateResourceStatus(workspaceObj) - validateAssociatedService(workspaceObj) + time.Sleep(30 * time.Second) - validateInferenceResource(workspaceObj, int32(numOfNode), false) + validateAssociatedService(workspaceObj) - validateWorkspaceReadiness(workspaceObj) - }) + validateInferenceResource(workspaceObj, int32(numOfNode), false) + validateWorkspaceReadiness(workspaceObj) + }) + */ It("should create a workspace for tuning successfully, and update the workspace with another dataset and output image", func() { numOfNode := 1 err := copySecretToNamespace(e2eACRSecret, namespaceName) diff --git a/test/e2e/webhook_test.go b/test/e2e/webhook_test.go index e3b05b8b5..991acefee 100644 --- a/test/e2e/webhook_test.go +++ b/test/e2e/webhook_test.go @@ -29,168 +29,169 @@ var ( ) var _ = Describe("Workspace Validation Webhook", func() { - It("should validate the workspace resource spec at creation ", func() { - workspaceObj := utils.GenerateInferenceWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_Bad", - &metav1.LabelSelector{ - MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, - }, nil, PresetFalcon7BModel, kaitov1alpha1.ModelImageAccessModePublic, nil, nil, nil) - - By("Creating a workspace with invalid instancetype", func() { - // Create workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) - }, 20*time.Minute, utils.PollInterval). - Should(HaveOccurred(), "Failed to create workspace %s", workspaceObj.Name) + /* + It("should validate the workspace resource spec at creation ", func() { + workspaceObj := utils.GenerateInferenceWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_Bad", + &metav1.LabelSelector{ + MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, + }, nil, PresetFalcon7BModel, kaitov1alpha1.ModelImageAccessModePublic, nil, nil, nil) + + By("Creating a workspace with invalid instancetype", func() { + // Create workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) + }, 20*time.Minute, utils.PollInterval). + Should(HaveOccurred(), "Failed to create workspace %s", workspaceObj.Name) + }) }) - }) - It("should validate the workspace inference spec at creation ", func() { - workspaceObj := utils.GenerateInferenceWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC6", - &metav1.LabelSelector{ - MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, - }, nil, "invalid-name", kaitov1alpha1.ModelImageAccessModePublic, nil, nil, nil) - - By("Creating a workspace with invalid preset name", func() { - // Create workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) - }, utils.PollTimeout, utils.PollInterval). - Should(HaveOccurred(), "Failed to create workspace %s", workspaceObj.Name) + It("should validate the workspace inference spec at creation ", func() { + workspaceObj := utils.GenerateInferenceWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC6", + &metav1.LabelSelector{ + MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, + }, nil, "invalid-name", kaitov1alpha1.ModelImageAccessModePublic, nil, nil, nil) + + By("Creating a workspace with invalid preset name", func() { + // Create workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) + }, utils.PollTimeout, utils.PollInterval). + Should(HaveOccurred(), "Failed to create workspace %s", workspaceObj.Name) + }) }) - }) - - It("should validate the workspace tuning spec at creation ", func() { - workspaceObj := utils.GenerateTuningWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", - &metav1.LabelSelector{ - MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, - }, nil, nil, testDataDestinationConfig, initialPresetSpec, initialTuningMethod) - - By("Creating a workspace with nil input", func() { - // Create workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) - }, 20*time.Minute, utils.PollInterval). - Should(HaveOccurred(), "Failed to create workspace %s", workspaceObj.Name) - }) - }) - - It("should validate the workspace tuning spec at creation ", func() { - workspaceObj := utils.GenerateTuningWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", - &metav1.LabelSelector{ - MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, - }, nil, testDataSourceConfig, nil, initialPresetSpec, initialTuningMethod) - - By("Creating a workspace with nil output", func() { - // Create workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) - }, 20*time.Minute, utils.PollInterval). - Should(HaveOccurred(), "Failed to create workspace %s", workspaceObj.Name) - }) - }) - - It("should validate the workspace tuning spec at creation ", func() { - workspaceObj := utils.GenerateTuningWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", - &metav1.LabelSelector{ - MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, - }, nil, testDataSourceConfig, testDataDestinationConfig, nil, initialTuningMethod) - - By("Creating a workspace with nil preset", func() { - // Create workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) - }, 20*time.Minute, utils.PollInterval). - Should(HaveOccurred(), "Failed to create workspace %s", workspaceObj.Name) - }) - }) - - //TODO preset private mode - //TODO custom template - - It("should validate the workspace resource spec at update ", func() { - workspaceObj := utils.GenerateInferenceWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", - &metav1.LabelSelector{ - MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, - }, nil, PresetFalcon7BModel, kaitov1alpha1.ModelImageAccessModePublic, nil, nil, nil) - By("Creating a valid workspace", func() { - // Create workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) - }, 20*time.Minute, utils.PollInterval). - Should(Succeed(), "Failed to create workspace %s", workspaceObj.Name) + It("should validate the workspace tuning spec at creation ", func() { + workspaceObj := utils.GenerateTuningWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", + &metav1.LabelSelector{ + MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, + }, nil, nil, testDataDestinationConfig, initialPresetSpec, initialTuningMethod) + + By("Creating a workspace with nil input", func() { + // Create workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) + }, 20*time.Minute, utils.PollInterval). + Should(HaveOccurred(), "Failed to create workspace %s", workspaceObj.Name) + }) }) - By("Updating the label selector", func() { - updatedObj := workspaceObj - updatedObj.Resource.LabelSelector = &metav1.LabelSelector{} - // update workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Update(ctx, updatedObj, &client.UpdateOptions{}) - }, utils.PollTimeout, utils.PollInterval). - Should(HaveOccurred(), "Failed to update workspace %s", updatedObj.Name) + It("should validate the workspace tuning spec at creation ", func() { + workspaceObj := utils.GenerateTuningWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", + &metav1.LabelSelector{ + MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, + }, nil, testDataSourceConfig, nil, initialPresetSpec, initialTuningMethod) + + By("Creating a workspace with nil output", func() { + // Create workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) + }, 20*time.Minute, utils.PollInterval). + Should(HaveOccurred(), "Failed to create workspace %s", workspaceObj.Name) + }) }) - By("Updating the InstanceType", func() { - updatedObj := workspaceObj - updatedObj.Resource.InstanceType = "Standard_NC12" - // update workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Update(ctx, updatedObj, &client.UpdateOptions{}) - }, utils.PollTimeout, utils.PollInterval). - Should(HaveOccurred(), "Failed to update workspace %s", updatedObj.Name) + It("should validate the workspace tuning spec at creation ", func() { + workspaceObj := utils.GenerateTuningWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", + &metav1.LabelSelector{ + MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, + }, nil, testDataSourceConfig, testDataDestinationConfig, nil, initialTuningMethod) + + By("Creating a workspace with nil preset", func() { + // Create workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) + }, 20*time.Minute, utils.PollInterval). + Should(HaveOccurred(), "Failed to create workspace %s", workspaceObj.Name) + }) }) + //TODO preset private mode //TODO custom template - // delete workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Delete(ctx, workspaceObj, &client.DeleteOptions{}) - }, utils.PollTimeout, utils.PollInterval).Should(Succeed(), "Failed to delete workspace") - - }) - - It("should validate the workspace tuning spec at update ", func() { - workspaceObj := utils.GenerateTuningWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", - &metav1.LabelSelector{ - MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, - }, nil, testDataSourceConfig, testDataDestinationConfig, initialPresetSpec, initialTuningMethod) - - By("Creating a valid tuning workspace", func() { - // Create workspace + It("should validate the workspace resource spec at update ", func() { + workspaceObj := utils.GenerateInferenceWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", + &metav1.LabelSelector{ + MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, + }, nil, PresetFalcon7BModel, kaitov1alpha1.ModelImageAccessModePublic, nil, nil, nil) + + By("Creating a valid workspace", func() { + // Create workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) + }, 20*time.Minute, utils.PollInterval). + Should(Succeed(), "Failed to create workspace %s", workspaceObj.Name) + }) + + By("Updating the label selector", func() { + updatedObj := workspaceObj + updatedObj.Resource.LabelSelector = &metav1.LabelSelector{} + // update workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Update(ctx, updatedObj, &client.UpdateOptions{}) + }, utils.PollTimeout, utils.PollInterval). + Should(HaveOccurred(), "Failed to update workspace %s", updatedObj.Name) + }) + + By("Updating the InstanceType", func() { + updatedObj := workspaceObj + updatedObj.Resource.InstanceType = "Standard_NC12" + // update workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Update(ctx, updatedObj, &client.UpdateOptions{}) + }, utils.PollTimeout, utils.PollInterval). + Should(HaveOccurred(), "Failed to update workspace %s", updatedObj.Name) + }) + + //TODO custom template + + // delete workspace Eventually(func() error { - return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) - }, 20*time.Minute, utils.PollInterval). - Should(Succeed(), "Failed to create workspace %s", workspaceObj.Name) - }) + return utils.TestingCluster.KubeClient.Delete(ctx, workspaceObj, &client.DeleteOptions{}) + }, utils.PollTimeout, utils.PollInterval).Should(Succeed(), "Failed to delete workspace") - By("Updating the tuning preset", func() { - updatedObj := workspaceObj - updatedObj.Tuning.Preset = updatedPresetSpec - // update workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Update(ctx, updatedObj, &client.UpdateOptions{}) - }, utils.PollTimeout, utils.PollInterval). - Should(HaveOccurred(), "Failed to update workspace %s", updatedObj.Name) }) - By("Updating the Method", func() { - updatedObj := workspaceObj - updatedObj.Tuning.Method = alternativeTuningMethod - // update workspace + It("should validate the workspace tuning spec at update ", func() { + workspaceObj := utils.GenerateTuningWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", + &metav1.LabelSelector{ + MatchLabels: map[string]string{"kaito-workspace": "webhook-e2e-test"}, + }, nil, testDataSourceConfig, testDataDestinationConfig, initialPresetSpec, initialTuningMethod) + + By("Creating a valid tuning workspace", func() { + // Create workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Create(ctx, workspaceObj, &client.CreateOptions{}) + }, 20*time.Minute, utils.PollInterval). + Should(Succeed(), "Failed to create workspace %s", workspaceObj.Name) + }) + + By("Updating the tuning preset", func() { + updatedObj := workspaceObj + updatedObj.Tuning.Preset = updatedPresetSpec + // update workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Update(ctx, updatedObj, &client.UpdateOptions{}) + }, utils.PollTimeout, utils.PollInterval). + Should(HaveOccurred(), "Failed to update workspace %s", updatedObj.Name) + }) + + By("Updating the Method", func() { + updatedObj := workspaceObj + updatedObj.Tuning.Method = alternativeTuningMethod + // update workspace + Eventually(func() error { + return utils.TestingCluster.KubeClient.Update(ctx, updatedObj, &client.UpdateOptions{}) + }, utils.PollTimeout, utils.PollInterval). + Should(HaveOccurred(), "Failed to update workspace %s", updatedObj.Name) + }) + + // delete workspace Eventually(func() error { - return utils.TestingCluster.KubeClient.Update(ctx, updatedObj, &client.UpdateOptions{}) - }, utils.PollTimeout, utils.PollInterval). - Should(HaveOccurred(), "Failed to update workspace %s", updatedObj.Name) - }) - - // delete workspace - Eventually(func() error { - return utils.TestingCluster.KubeClient.Delete(ctx, workspaceObj, &client.DeleteOptions{}) - }, utils.PollTimeout, utils.PollInterval).Should(Succeed(), "Failed to delete workspace") - - }) + return utils.TestingCluster.KubeClient.Delete(ctx, workspaceObj, &client.DeleteOptions{}) + }, utils.PollTimeout, utils.PollInterval).Should(Succeed(), "Failed to delete workspace") + }) + */ It("should validate the workspace inference spec at update ", func() { workspaceObj := utils.GenerateInferenceWorkspaceManifest(fmt.Sprint("webhook-", rand.Intn(1000)), namespaceName, "", 1, "Standard_NC12s_v3", &metav1.LabelSelector{