Skip to content

Commit

Permalink
Test e2e
Browse files Browse the repository at this point in the history
Signed-off-by: clyang82 <[email protected]>
  • Loading branch information
clyang82 committed Jun 7, 2024
1 parent 9916ae6 commit e013315
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/e2e/pkg/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package e2e_test

import (
"context"
"encoding/json"
"fmt"
"net/http"
"time"
Expand Down Expand Up @@ -175,7 +176,7 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
})

It("patch the nginx resource", func() {
It("patch the nginx resource without causing any changes", func() {

newRes := helper.NewAPIResource(consumer_name, 2)
patchedResource, resp, err := apiClient.DefaultApi.ApiMaestroV1ResourcesIdPatch(context.Background(), *resource.Id).
Expand Down Expand Up @@ -203,13 +204,15 @@ var _ = Describe("Resources", Ordered, Label("e2e-tests-resources"), func() {
Expect(resp.StatusCode).To(Equal(http.StatusNoContent))

Eventually(func() error {
_, err := kubeClient.AppsV1().Deployments("default").Get(context.Background(), "nginx", metav1.GetOptions{})
nginx, err := kubeClient.AppsV1().Deployments("default").Get(context.Background(), "nginx", metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
return nil
}
return err
}
data, _ := json.Marshal(nginx)
fmt.Println(string(data))
return fmt.Errorf("nginx deployment still exists")
}, 1*time.Minute, 1*time.Second).ShouldNot(HaveOccurred())
})
Expand Down

0 comments on commit e013315

Please sign in to comment.