From bd452b35ca8ae5e96e4af3c7fefeb8400156e2c5 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 18 Feb 2017 13:40:28 +0700 Subject: [PATCH] support unset GOPATH in Go 1.8 in integrationtests fixes #415 --- integrationtests/drop_test.go | 8 -------- integrationtests/integration_test.go | 8 -------- .../integrationtests_suite_test.go | 18 ++++++++++++++---- integrationtests/random_rtt_test.go | 8 -------- integrationtests/rtt_test.go | 8 -------- 5 files changed, 14 insertions(+), 36 deletions(-) diff --git a/integrationtests/drop_test.go b/integrationtests/drop_test.go index eefbbb850..ce5546af7 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 150ad25ad..c9c6bb13c 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 8cfb22ca2..2fcbfc676 100644 --- a/integrationtests/integrationtests_suite_test.go +++ b/integrationtests/integrationtests_suite_test.go @@ -5,6 +5,7 @@ import ( "crypto/md5" "encoding/hex" "fmt" + "go/build" "io" "io/ioutil" "mime/multipart" @@ -13,6 +14,8 @@ import ( "os" "os/exec" "path" + "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()) + + clientPath = fmt.Sprintf( + "%s/src/github.com/lucas-clemente/quic-clients/client-%s-debug", + build.Default.GOPATH, + runtime.GOOS, + ) }) var _ = AfterEach(func() { diff --git a/integrationtests/random_rtt_test.go b/integrationtests/random_rtt_test.go index e4d6a4b40..12e90c194 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 e0a4836fd..a44b25ffd 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)