Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHlt committed Dec 11, 2021
1 parent d1898d3 commit 3650a6a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clients/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var _ = Describe("Backend", func() {

httpTrans, ok := client.Transport.(*http.Transport)
Expect(ok).To(BeTrue())
Expect(httpTrans.TLSClientConfig.ServerName).To(Equal("my.san"))
Expect(httpTrans.TLSClientConfig.ServerName).To(Equal(""))
Expect(httpTrans.MaxIdleConns).To(Equal(100))
Expect(httpTrans.MaxIdleConnsPerHost).To(Equal(100))
})
Expand Down
14 changes: 11 additions & 3 deletions scrapers/scrape_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package scrapers_test
import (
"fmt"
"io/ioutil"
"net"
"net/http"
"net/url"
"strconv"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -51,12 +53,18 @@ var _ = Describe("Scraper", func() {
})

It("scrapes metrics from an app", func() {
host, portStr, err := net.SplitHostPort(serverURL.Host)
Expect(err).ShouldNot(HaveOccurred())
port, err := strconv.Atoi(portStr)
Expect(err).ShouldNot(HaveOccurred())
route := &models.Route{
ID: "a758f25d-2d01-419e-b63b-de3aabcd9e15",
Address: serverURL.Host,
ID: "a758f25d-2d01-419e-b63b-de3aabcd9e15",
Address: host,
ServiceAddress: host,
ServicePort: port,
}

resp, err := scraper.Scrape(route, "", "http", http.Header{})
resp, err := scraper.Scrape(route, "/metrics", "http", http.Header{})
Expect(err).ShouldNot(HaveOccurred())
defer resp.Close()

Expand Down

0 comments on commit 3650a6a

Please sign in to comment.