Skip to content

Commit

Permalink
Update Ingress Test V1
Browse files Browse the repository at this point in the history
  • Loading branch information
katyanna committed Dec 5, 2023
1 parent 362d007 commit 05ce69b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kubernetes/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require"
)

func TestListIngresses(t *testing.T) {
testServer := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
f, _ := os.Open("testdata/fixture01.json")
f, _ := os.Open("testdata/fixture03.json")
defer f.Close()
rw.WriteHeader(http.StatusOK)
io.Copy(rw, f)
_, err := io.Copy(rw, f)
require.NoError(t, err)
}))
defer testServer.Close()
kubeClient, _ := newSimpleClient(&Config{BaseURL: testServer.URL}, false)
Expand All @@ -28,7 +30,6 @@ func TestListIngresses(t *testing.T) {
newIngress("fixture02", map[string]string{ingressClassAnnotation: "skipper"}, "", "skipper.example.org", "fixture02", IngressAPIVersionNetworking),
newIngress("fixture03", map[string]string{ingressClassAnnotation: "other"}, "", "other.example.org", "fixture03", IngressAPIVersionNetworking),
newIngress("fixture04", nil, "another", "another.example.org", "fixture04", IngressAPIVersionNetworking),
newIngress("fixture05", map[string]string{ingressClassAnnotation: "yet-another-ignored"}, "yet-another", "yet-another.example.org", "fixture05", IngressAPIVersionNetworking),
)
got, err := ingressClient.listIngress(kubeClient)
if err != nil {
Expand Down

0 comments on commit 05ce69b

Please sign in to comment.