From 7933021d39667701ee7ecb7dd55e4b9484fa9e3e Mon Sep 17 00:00:00 2001 From: Alan Moran Date: Thu, 21 Nov 2024 12:39:35 +0100 Subject: [PATCH] Remove pending test --- src/autoscaler/api/cmd/api/api_test.go | 66 ++++++++++++-------------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/src/autoscaler/api/cmd/api/api_test.go b/src/autoscaler/api/cmd/api/api_test.go index 67e13684db..df170132ff 100644 --- a/src/autoscaler/api/cmd/api/api_test.go +++ b/src/autoscaler/api/cmd/api/api_test.go @@ -297,50 +297,44 @@ var _ = Describe("Api", func() { }) When("running CF server", func() { - XWhen("running in outside cf", func() {}) - When("running in CF", func() { - - BeforeEach(func() { - os.Setenv("VCAP_APPLICATION", "{}") - os.Setenv("VCAP_SERVICES", getVcapServices()) - os.Setenv("PORT", fmt.Sprintf("%d", vcapPort)) - runner.Start() - }) - AfterEach(func() { - runner.Interrupt() - Eventually(runner.Session, 5).Should(Exit(0)) - os.Unsetenv("VCAP_APPLICATION") - os.Unsetenv("VCAP_SERVICES") - os.Unsetenv("PORT") - }) - - It("should start a cf server", func() { - req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/v1/info", cfServerURL), nil) - Expect(err).NotTo(HaveOccurred()) + BeforeEach(func() { + os.Setenv("VCAP_APPLICATION", "{}") + os.Setenv("VCAP_SERVICES", getVcapServices()) + os.Setenv("PORT", fmt.Sprintf("%d", vcapPort)) + runner.Start() + }) + AfterEach(func() { + runner.Interrupt() + Eventually(runner.Session, 5).Should(Exit(0)) + os.Unsetenv("VCAP_APPLICATION") + os.Unsetenv("VCAP_SERVICES") + os.Unsetenv("PORT") + }) - rsp, err = cfServerHttpClient.Do(req) - Expect(err).ToNot(HaveOccurred()) + It("should start a cf server", func() { + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/v1/info", cfServerURL), nil) + Expect(err).NotTo(HaveOccurred()) - bodyBytes, err := io.ReadAll(rsp.Body) - Expect(err).ToNot(HaveOccurred()) - Expect(bodyBytes).To(ContainSubstring("Automatically increase or decrease the number of application instances based on a policy you define.")) + rsp, err = cfServerHttpClient.Do(req) + Expect(err).ToNot(HaveOccurred()) - req, err = http.NewRequest(http.MethodGet, fmt.Sprintf("%s/v2/catalog", cfServerURL), nil) - Expect(err).NotTo(HaveOccurred()) - req.SetBasicAuth(username, password) + bodyBytes, err := io.ReadAll(rsp.Body) + Expect(err).ToNot(HaveOccurred()) + Expect(bodyBytes).To(ContainSubstring("Automatically increase or decrease the number of application instances based on a policy you define.")) - rsp, err = cfServerHttpClient.Do(req) - Expect(err).ToNot(HaveOccurred()) - Expect(rsp.StatusCode).To(Equal(http.StatusOK)) + req, err = http.NewRequest(http.MethodGet, fmt.Sprintf("%s/v2/catalog", cfServerURL), nil) + Expect(err).NotTo(HaveOccurred()) + req.SetBasicAuth(username, password) - bodyBytes, err = io.ReadAll(rsp.Body) - Expect(err).ToNot(HaveOccurred()) - Expect(bodyBytes).To(ContainSubstring("autoscaler-free-plan-id")) - }) + rsp, err = cfServerHttpClient.Do(req) + Expect(err).ToNot(HaveOccurred()) + Expect(rsp.StatusCode).To(Equal(http.StatusOK)) + bodyBytes, err = io.ReadAll(rsp.Body) + Expect(err).ToNot(HaveOccurred()) + Expect(bodyBytes).To(ContainSubstring("autoscaler-free-plan-id")) }) }) - }) func getVcapServices() (result string) {