diff --git a/integrationtests/drop_test.go b/integrationtests/drop_test.go index eefbbb85..ce5546af 100644 --- a/integrationtests/drop_test.go +++ b/integrationtests/drop_test.go @@ -3,9 +3,7 @@ package integrationtests import ( "bytes" "fmt" - "os" "os/exec" - "runtime" "strconv" "time" @@ -28,12 +26,6 @@ var _ = Describe("Drop Proxy", func() { runDropTest := func(incomingPacketDropper, outgoingPacketDropper proxy.DropCallback, version protocol.VersionNumber) { proxyPort := 12345 - clientPath := fmt.Sprintf( - "%s/src/github.com/lucas-clemente/quic-clients/client-%s-debug", - os.Getenv("GOPATH"), - runtime.GOOS, - ) - iPort, _ := strconv.Atoi(port) var err error dropproxy, err = proxy.NewUDPProxy(proxyPort, "localhost", iPort, incomingPacketDropper, outgoingPacketDropper, 0, 0) diff --git a/integrationtests/integration_test.go b/integrationtests/integration_test.go index 150ad25a..c9c6bb13 100644 --- a/integrationtests/integration_test.go +++ b/integrationtests/integration_test.go @@ -3,9 +3,7 @@ package integrationtests import ( "bytes" "fmt" - "os" "os/exec" - "runtime" "strconv" "sync" @@ -24,12 +22,6 @@ var _ = Describe("Integration tests", func() { dataMan.GenerateData(dataLen) }) - clientPath := fmt.Sprintf( - "%s/src/github.com/lucas-clemente/quic-clients/client-%s-debug", - os.Getenv("GOPATH"), - runtime.GOOS, - ) - for i := range protocol.SupportedVersions { version := protocol.SupportedVersions[i] diff --git a/integrationtests/integrationtests_suite_test.go b/integrationtests/integrationtests_suite_test.go index 8cfb22ca..a9a5442b 100644 --- a/integrationtests/integrationtests_suite_test.go +++ b/integrationtests/integrationtests_suite_test.go @@ -13,6 +13,9 @@ import ( "os" "os/exec" "path" + "path/filepath" + "runtime" + "strconv" "time" @@ -35,10 +38,11 @@ const ( ) var ( - server *h2quic.Server - dataMan dataManager - port string - uploadDir string + server *h2quic.Server + dataMan dataManager + port string + uploadDir string + clientPath string docker *gexec.Session ) @@ -68,6 +72,12 @@ var _ = BeforeEach(func() { Expect(err).ToNot(HaveOccurred()) err = os.MkdirAll(uploadDir, os.ModeDir|0777) Expect(err).ToNot(HaveOccurred()) + + _, thisfile, _, ok := runtime.Caller(0) + if !ok { + Fail("Failed to get current path") + } + clientPath = filepath.Join(thisfile, fmt.Sprintf("../../../quic-clients/client-%s-debug", runtime.GOOS)) }) var _ = AfterEach(func() { diff --git a/integrationtests/random_rtt_test.go b/integrationtests/random_rtt_test.go index e4d6a4b4..12e90c19 100644 --- a/integrationtests/random_rtt_test.go +++ b/integrationtests/random_rtt_test.go @@ -3,9 +3,7 @@ package integrationtests import ( "bytes" "fmt" - "os" "os/exec" - "runtime" "strconv" "time" @@ -28,12 +26,6 @@ var _ = Describe("Random RTT", func() { runRTTTest := func(minRtt, maxRtt time.Duration, version protocol.VersionNumber) { proxyPort := 12345 - clientPath := fmt.Sprintf( - "%s/src/github.com/lucas-clemente/quic-clients/client-%s-debug", - os.Getenv("GOPATH"), - runtime.GOOS, - ) - iPort, _ := strconv.Atoi(port) var err error rttProxy, err = proxy.NewUDPProxy(proxyPort, "localhost", iPort, nil, nil, minRtt, maxRtt) diff --git a/integrationtests/rtt_test.go b/integrationtests/rtt_test.go index e0a4836f..a44b25ff 100644 --- a/integrationtests/rtt_test.go +++ b/integrationtests/rtt_test.go @@ -3,9 +3,7 @@ package integrationtests import ( "bytes" "fmt" - "os" "os/exec" - "runtime" "strconv" "time" @@ -28,12 +26,6 @@ var _ = Describe("non-zero RTT", func() { runRTTTest := func(rtt time.Duration, version protocol.VersionNumber) { proxyPort := 12345 - clientPath := fmt.Sprintf( - "%s/src/github.com/lucas-clemente/quic-clients/client-%s-debug", - os.Getenv("GOPATH"), - runtime.GOOS, - ) - iPort, _ := strconv.Atoi(port) var err error rttProxy, err = proxy.NewUDPProxy(proxyPort, "localhost", iPort, nil, nil, rtt, rtt)