From: Martina Ferrari <tina@debian.org>
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-Updated: 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 21447d0..9270285 100644
--- a/cmd/prometheus/main_test.go
+++ b/cmd/prometheus/main_test.go
@@ -103,7 +103,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 {
@@ -161,7 +161,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",
 				},
 			},
 		},
@@ -181,7 +181,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",
 				},
 			},
 		},
@@ -199,7 +199,7 @@ func TestSendAlerts(t *testing.T) {
 				}
 				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...)
 		})
 	}
 }
@@ -358,7 +358,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 8832c28..9925917 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",
 		},
 	})
