From c94fa731aae210b8ee5517b2f7e4d982bb3575cc Mon Sep 17 00:00:00 2001 From: Krasi Georgiev Date: Wed, 20 Dec 2017 18:21:10 +0000 Subject: [PATCH] bypass the proxy for the tests --- cmd/prometheus/main_test.go | 3 +++ web/web_test.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/cmd/prometheus/main_test.go b/cmd/prometheus/main_test.go index 184f47dfd..5c6eab97e 100644 --- a/cmd/prometheus/main_test.go +++ b/cmd/prometheus/main_test.go @@ -35,6 +35,9 @@ func TestMain(m *testing.M) { if testing.Short() { os.Exit(m.Run()) } + // On linux with a global proxy the tests will fail as the go client(http,grpc) tries to connect through the proxy. + os.Setenv("no_proxy", "localhost,127.0.0.1,0.0.0.0,:") + var err error promPath, err = os.Getwd() if err != nil { diff --git a/web/web_test.go b/web/web_test.go index 10f3d83f9..e761d7c27 100644 --- a/web/web_test.go +++ b/web/web_test.go @@ -29,6 +29,11 @@ import ( libtsdb "github.com/prometheus/tsdb" ) +func TestMain(m *testing.M) { + // On linux with a global proxy the tests will fail as the go client(http,grpc) tries to connect through the proxy. + os.Setenv("no_proxy", "localhost,127.0.0.1,0.0.0.0,:") + os.Exit(m.Run()) +} func TestGlobalURL(t *testing.T) { opts := &Options{ ListenAddress: ":9090",