diff --git a/controllers/suite_test.go b/controllers/suite_test.go index b7a33b60..2415299f 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -63,6 +63,11 @@ var secretNamespacedName = types.NamespacedName{ var rndm = rand.New(rand.NewSource(GinkgoRandomSeed())) +// TODO: +// - Find a different way to create an ephemeral webhook URL as a more reliable solution. +// Perhaps, use smee client to create a new channel per test run. +var webhookURL = "https://smee.io/PZeBPogfii2vPl6s" + func TestControllersAPIs(t *testing.T) { RegisterFailHandler(Fail) diff --git a/controllers/workspace_controller_notifications_test.go b/controllers/workspace_controller_notifications_test.go index 644972b0..ce6e0cd6 100644 --- a/controllers/workspace_controller_notifications_test.go +++ b/controllers/workspace_controller_notifications_test.go @@ -86,7 +86,7 @@ var _ = Describe("Workspace controller", Ordered, func() { instance.Spec.Notifications = append(instance.Spec.Notifications, appv1alpha2.Notification{ Name: "slack", Type: tfc.NotificationDestinationTypeSlack, - URL: "https://www.hashicorp.com", + URL: webhookURL, }) // Create a new Kubernetes workspace object and wait until the controller finishes the reconciliation createWorkspace(instance) @@ -101,7 +101,7 @@ var _ = Describe("Workspace controller", Ordered, func() { instance.Spec.Notifications = append(instance.Spec.Notifications, appv1alpha2.Notification{ Name: "slack", Type: tfc.NotificationDestinationTypeSlack, - URL: "https://www.hashicorp.com", + URL: webhookURL, }) instance.Spec.Notifications = append(instance.Spec.Notifications, appv1alpha2.Notification{ Name: "email", @@ -121,7 +121,7 @@ var _ = Describe("Workspace controller", Ordered, func() { instance.Spec.Notifications = append(instance.Spec.Notifications, appv1alpha2.Notification{ Name: "slack", Type: tfc.NotificationDestinationTypeSlack, - URL: "https://www.hashicorp.com", + URL: webhookURL, }) // Create a new Kubernetes workspace object and wait until the controller finishes the reconciliation createWorkspace(instance) diff --git a/controllers/workspace_controller_run_tasks_test.go b/controllers/workspace_controller_run_tasks_test.go index 23dcb26d..c6d0c5cd 100644 --- a/controllers/workspace_controller_run_tasks_test.go +++ b/controllers/workspace_controller_run_tasks_test.go @@ -238,7 +238,7 @@ func isRunTasksReconciled(instance *appv1alpha2.Workspace) { func createRunTaskForTest(name string) string { rt, err := tfClient.RunTasks.Create(ctx, organization, tfc.RunTaskCreateOptions{ Name: name, - URL: "https://www.hashicorp.com", + URL: webhookURL, Category: "task", // MUST BE "task" Enabled: tfc.Bool(true), })