Skip to content

Commit

Permalink
removed test case for validation that no longer happens (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
szoio committed Sep 13, 2019
1 parent 0cd2776 commit 8229d17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
2 changes: 1 addition & 1 deletion controllers/eventhub_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var _ = Describe("EventHub Controller", func() {
// Avoid adding tests for vanilla CRUD operations because they would
// test Kubernetes API server, which isn't the goal here.
Context("Create and Delete", func() {
It("should validate eventhubnamespaces exist before creating eventhubs", func() {
It("should fail to create eventhub if eventhubnamespace doesn't exist", func() {

eventhubName := "t-eh-" + helpers.RandomString(10)

Expand Down
32 changes: 1 addition & 31 deletions controllers/eventhubnamespace_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,7 @@ var _ = Describe("EventHubNamespace Controller", func() {
// test Kubernetes API server, which isn't the goal here.
Context("Create and Delete", func() {

It("should validate eventhubnamespace name is valid", func() {

resourceGroupName := "t-rg-dev-eh-" + helpers.RandomString(10)
eventhubNamespaceName := "t-ns"

// Create the EventHubNamespace object and expect the Reconcile to be created
eventhubNamespaceInstance := &azurev1.EventhubNamespace{
ObjectMeta: metav1.ObjectMeta{
Name: eventhubNamespaceName,
Namespace: "default",
},
Spec: azurev1.EventhubNamespaceSpec{
Location: rgLocation,
ResourceGroup: resourceGroupName,
},
}

tc.K8sClient.Create(context.Background(), eventhubNamespaceInstance)

eventhubNamespacedName := types.NamespacedName{Name: eventhubNamespaceName, Namespace: "default"}

Eventually(func() bool {
_ = tc.K8sClient.Get(context.Background(), eventhubNamespacedName, eventhubNamespaceInstance)
return eventhubNamespaceInstance.IsSubmitted()
}, timeout,
).Should(BeFalse())

})

It("should validate resourcegroup exist before creating eventhubnamespaces", func() {
It("should fail to create eventhubnamespace if resourcegroup doesn't exist", func() {

resourceGroupName := "t-rg-dev-eh-" + helpers.RandomString(10)
eventhubNamespaceName := "t-ns-dev-eh-" + helpers.RandomString(10)
Expand All @@ -108,7 +79,6 @@ var _ = Describe("EventHubNamespace Controller", func() {
return eventhubNamespaceInstance.IsSubmitted()
}, timeout,
).Should(BeFalse())

})

It("should create and delete namespace in k8s", func() {
Expand Down

0 comments on commit 8229d17

Please sign in to comment.