diff --git a/Makefile b/Makefile index 4d733b12..440889c0 100755 --- a/Makefile +++ b/Makefile @@ -79,9 +79,6 @@ ENABLE_OCM_MOCK ?= false ENABLE_GRPC ?= false -# Run the e2e on kind cluster. If false, the api/grpc server, consumer_name, and consumer_kubeconfig required to be set. -ON_KIND ?= true - # Enable set images POSTGRES_IMAGE ?= docker.io/library/postgres:14.2 MQTT_IMAGE ?= docker.io/library/eclipse-mosquitto:2.0.18 @@ -412,14 +409,11 @@ e2e-test/teardown: ./test/e2e/setup/e2e_teardown.sh .PHONY: e2e-test/teardown -e2e-test: - @if [ "$(ON_KIND)" = "true" ]; then \ - make e2e-test/teardown; make e2e-test/setup; \ - fi +e2e-test: e2e-test/teardown e2e-test/setup ginkgo --output-dir="${PWD}/test/e2e/report" --json-report=report.json --junit-report=report.xml \ ${PWD}/test/e2e/pkg -- \ - -api-server=$${api_server:-https://$$(cat ${PWD}/test/e2e/.external_host_ip):30080} \ - -grpc-server=$${grpc_server:-$$(shell cat ${PWD}/test/e2e/.external_host_ip):30090} \ - -consumer-name=$${consumer_name:-$$(cat ${PWD}/test/e2e/.consumer_name)} \ - -consumer-kubeconfig=$${consumer_kubeconfig:-${PWD}/test/e2e/.kubeconfig} + -api-server=https://$(shell cat ${PWD}/test/e2e/.external_host_ip):30080 \ + -grpc-server=$(shell cat ${PWD}/test/e2e/.external_host_ip):30090 \ + -consumer-name=$(shell cat ${PWD}/test/e2e/.consumer_name) \ + -consumer-kubeconfig=${PWD}/test/e2e/.kubeconfig .PHONY: e2e-test diff --git a/test/e2e/pkg/consumer_test.go b/test/e2e/pkg/consumer_test.go index eac9882a..35cb3e33 100644 --- a/test/e2e/pkg/consumer_test.go +++ b/test/e2e/pkg/consumer_test.go @@ -18,22 +18,6 @@ var _ = Describe("Consumer", Ordered, func() { }) Context("Consumer CRUD Tests", func() { - It("list the default consumer", func() { - consumerList, resp, err := apiClient.DefaultApi.ApiMaestroV1ConsumersGet(ctx).Execute() - Expect(err).To(Succeed()) - Expect(resp.StatusCode).To(Equal(http.StatusOK)) - Expect(consumerList).NotTo(BeNil()) - Expect(len(consumerList.Items) > 0).To(BeTrue()) - - got := false - for _, c := range consumerList.Items { - if *c.Name == consumer.Name { - got = true - } - } - Expect(got).To(BeTrue()) - }) - It("create consumer", func() { consumer := openapi.Consumer{Name: &testConsumerName} created, resp, err := apiClient.DefaultApi.ApiMaestroV1ConsumersPost(ctx).Consumer(consumer).Execute() @@ -48,6 +32,22 @@ var _ = Describe("Consumer", Ordered, func() { Expect(got).NotTo(BeNil()) }) + It("list consumer", func() { + consumerList, resp, err := apiClient.DefaultApi.ApiMaestroV1ConsumersGet(ctx).Execute() + Expect(err).To(Succeed()) + Expect(resp.StatusCode).To(Equal(http.StatusOK)) + Expect(consumerList).NotTo(BeNil()) + Expect(len(consumerList.Items) > 0).To(BeTrue()) + + got := false + for _, c := range consumerList.Items { + if *c.Name == testConsumerName { + got = true + } + } + Expect(got).To(BeTrue()) + }) + It("patch consumer", func() { labels := &map[string]string{"hello": "world"} patched, resp, err := apiClient.DefaultApi.ApiMaestroV1ConsumersIdPatch(ctx, testConsumerID).