From 9180950b639d80895eac56f1f22cf43f36d4bb1e Mon Sep 17 00:00:00 2001 From: Alan Moran Date: Fri, 13 Dec 2024 14:44:16 -0300 Subject: [PATCH] Fix lints --- src/autoscaler/api/cmd/api/api_test.go | 8 +++----- src/autoscaler/api/config/config_test.go | 7 +++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/autoscaler/api/cmd/api/api_test.go b/src/autoscaler/api/cmd/api/api_test.go index 47cfbf4613..13bba98162 100644 --- a/src/autoscaler/api/cmd/api/api_test.go +++ b/src/autoscaler/api/cmd/api/api_test.go @@ -14,8 +14,6 @@ import ( "code.cloudfoundry.org/app-autoscaler/src/autoscaler/db" "code.cloudfoundry.org/app-autoscaler/src/autoscaler/testhelpers" - . "code.cloudfoundry.org/app-autoscaler/src/autoscaler/testhelpers" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -47,9 +45,9 @@ var _ = Describe("Api", func() { vcapPort = 8080 + GinkgoParallelProcess() - brokerHttpClient = NewServiceBrokerClient() + brokerHttpClient = testhelpers.NewServiceBrokerClient() healthHttpClient = &http.Client{} - apiHttpClient = NewPublicApiClient() + apiHttpClient = testhelpers.NewPublicApiClient() cfServerHttpClient = &http.Client{} serverURL, err = url.Parse(fmt.Sprintf("https://127.0.0.1:%d", cfg.Server.Port)) @@ -169,7 +167,7 @@ var _ = Describe("Api", func() { bodyBytes, err := io.ReadAll(rsp.Body) - FailOnError("Read failed", err) + testhelpers.FailOnError("Read failed", err) if len(bodyBytes) == 0 { Fail("body empty") } diff --git a/src/autoscaler/api/config/config_test.go b/src/autoscaler/api/config/config_test.go index f561eb133a..8848750828 100644 --- a/src/autoscaler/api/config/config_test.go +++ b/src/autoscaler/api/config/config_test.go @@ -4,7 +4,6 @@ import ( "crypto/rand" "crypto/rsa" "fmt" - "io/ioutil" "os" "time" @@ -67,13 +66,13 @@ var _ = Describe("Config", func() { }) It("sets EventGenerator TlSClientCert", func() { - actualKeyContent, err := ioutil.ReadFile(conf.EventGenerator.TLSClientCerts.KeyFile) + actualKeyContent, err := os.ReadFile(conf.EventGenerator.TLSClientCerts.KeyFile) Expect(err).NotTo(HaveOccurred()) - actualCertContent, err := ioutil.ReadFile(conf.EventGenerator.TLSClientCerts.CertFile) + actualCertContent, err := os.ReadFile(conf.EventGenerator.TLSClientCerts.CertFile) Expect(err).NotTo(HaveOccurred()) - actualCACertContent, err := ioutil.ReadFile(conf.EventGenerator.TLSClientCerts.CACertFile) + actualCACertContent, err := os.ReadFile(conf.EventGenerator.TLSClientCerts.CACertFile) Expect(err).NotTo(HaveOccurred()) Expect(actualKeyContent).To(Equal(cfInstanceKey))