From: Martina Ferrari Date: Fri, 5 Jun 2020 15:36:25 -0300 Subject: Fix prometheus invocations, paths for debian build system, and avoid recompiling prometheus. Forwarded: not-needed Last-Update: Wed, 16 Mar 2022 05:48:22 +0000 --- cmd/prometheus/main_test.go | 10 +++++----- web/web_test.go | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/prometheus/main_test.go b/cmd/prometheus/main_test.go index 89c171b..6cb53db 100644 --- a/cmd/prometheus/main_test.go +++ b/cmd/prometheus/main_test.go @@ -104,7 +104,7 @@ func TestComputeExternalURL(t *testing.T) { } for _, test := range tests { - _, err := computeExternalURL(test.input, "0.0.0.0:9090") + _, err := computeExternalURL(test.input, "0.0.0.0:9099") if test.valid { require.NoError(t, err) } else { @@ -159,7 +159,7 @@ func TestSendAlerts(t *testing.T) { Annotations: labels.FromStrings("a2", "v2"), StartsAt: time.Unix(2, 0), EndsAt: time.Unix(3, 0), - GeneratorURL: "http://localhost:9090/graph?g0.expr=up&g0.tab=1", + GeneratorURL: "http://localhost:9099/graph?g0.expr=up&g0.tab=1", }, }, }, @@ -179,7 +179,7 @@ func TestSendAlerts(t *testing.T) { Annotations: labels.FromStrings("a2", "v2"), StartsAt: time.Unix(2, 0), EndsAt: time.Unix(4, 0), - GeneratorURL: "http://localhost:9090/graph?g0.expr=up&g0.tab=1", + GeneratorURL: "http://localhost:9099/graph?g0.expr=up&g0.tab=1", }, }, }, @@ -195,7 +195,7 @@ func TestSendAlerts(t *testing.T) { require.NotEmpty(t, tc.in, "sender called with 0 alert") require.Equal(t, tc.exp, alerts) }) - rules.SendAlerts(senderFunc, "http://localhost:9090")(context.TODO(), "up", tc.in...) + rules.SendAlerts(senderFunc, "http://localhost:9099")(context.TODO(), "up", tc.in...) }) } } @@ -346,7 +346,7 @@ func getCurrentGaugeValuesFor(t *testing.T, reg prometheus.Gatherer, metricNames } func TestAgentSuccessfulStartup(t *testing.T) { - prom := exec.Command(promPath, "-test.main", "--enable-feature=agent", "--web.listen-address=0.0.0.0:0", "--config.file="+agentConfig) + prom := exec.Command(promPath, "-test.main", "--enable-feature=agent", "--web.listen-address=0.0.0.0:0", "--config.file="+agentConfig, "--storage.agent.path="+filepath.Join(t.TempDir(), "data")) require.NoError(t, prom.Start()) actualExitStatus := 0 diff --git a/web/web_test.go b/web/web_test.go index e1fa66f..115d8b0 100644 --- a/web/web_test.go +++ b/web/web_test.go @@ -300,9 +300,9 @@ func TestDebugHandler(t *testing.T) { } { opts := &Options{ RoutePrefix: tc.prefix, - ListenAddress: "somehost:9090", + ListenAddress: "somehost:9098", ExternalURL: &url.URL{ - Host: "localhost.localdomain:9090", + Host: "localhost.localdomain:9098", Scheme: "http", }, } @@ -325,9 +325,9 @@ func TestHTTPMetrics(t *testing.T) { t.Parallel() handler := New(nil, &Options{ RoutePrefix: "/", - ListenAddress: "somehost:9090", + ListenAddress: "somehost:9098", ExternalURL: &url.URL{ - Host: "localhost.localdomain:9090", + Host: "localhost.localdomain:9098", Scheme: "http", }, })