🐞 Metrics Integration: thread the port

Confession: I have no idea why I didn't use the global variable `port`
instead of deciding to thread `port` as a parameter.

But for some reason I felt that it was a good idea. Oh well. Committing
these changes before they're lost.
This commit is contained in:
Brian Cunnie
2022-08-17 10:37:24 -07:00
parent 369ac1140d
commit c76a0dfa3b
2 changed files with 25 additions and 27 deletions

View File

@@ -19,10 +19,9 @@ var err error
var serverCmd *exec.Cmd
var serverSession *Session
var port = getFreePort()
var serverPath, _ = Build("main.go")
var _ = BeforeSuite(func() {
// Try to bind to the privileged first (for macOS), the fall back to unprivileged
serverPath, err := Build("main.go")
Expect(err).ToNot(HaveOccurred())
serverCmd = exec.Command(serverPath, "-port", strconv.Itoa(port))
serverSession, err = Start(serverCmd, GinkgoWriter, GinkgoWriter)