Description: Fix paths in acceptance tests.
 Upstream uses a different build mechanism, which somehow makes the original
 code work.
Forwarded: not-needed
Author: Martina Ferrari <tina@debian.org>
Last-Update: 2019-10-29

--- a/test/cli/acceptance.go
+++ b/test/cli/acceptance.go
@@ -40,9 +40,9 @@ import (
 	"github.com/prometheus/alertmanager/cli/format"
 )
 
-const (
+var (
 	// amtool is the relative path to local amtool binary.
-	amtool = "../../../amtool"
+	amtool = filepath.Join(os.Getenv("GOPATH"), "bin/amtool")
 )
 
 // AcceptanceTest provides declarative definition of given inputs and expected
@@ -320,6 +320,8 @@ func (am *Alertmanager) Start(additional
 		"--config.file", am.confFile.Name(),
 		"--log.level", "debug",
 		"--web.listen-address", am.apiAddr,
+                "--template.default", filepath.Join(os.Getenv("GOPATH"), "src/github.com/prometheus/alertmanager/template/default.tmpl"),
+                "--web.ui-path", filepath.Join(os.Getenv("GOPATH"), "src/github.com/prometheus/alertmanager/ui/app"),
 		"--storage.path", am.dir,
 		"--cluster.listen-address", am.clusterAddr,
 		"--cluster.settle-timeout", "0s",
@@ -329,7 +331,8 @@ func (am *Alertmanager) Start(additional
 	}
 	args = append(args, additionalArg...)
 
-	cmd := exec.Command("../../../alertmanager", args...)
+	bin := filepath.Join(os.Getenv("GOPATH"), "bin/prometheus-alertmanager")
+	cmd := exec.Command(bin, args...)
 
 	if am.cmd == nil {
 		var outb, errb buffer
--- a/test/with_api_v1/acceptance.go
+++ b/test/with_api_v1/acceptance.go
@@ -260,6 +260,8 @@ func (am *Alertmanager) Start() {
 		"--config.file", am.confFile.Name(),
 		"--log.level", "debug",
 		"--web.listen-address", am.apiAddr,
+                "--template.default", filepath.Join(os.Getenv("GOPATH"), "src/github.com/prometheus/alertmanager/template/default.tmpl"),
+                "--web.ui-path", filepath.Join(os.Getenv("GOPATH"), "src/github.com/prometheus/alertmanager/ui/app"),
 		"--storage.path", am.dir,
 		"--cluster.listen-address", am.clusterAddr,
 		"--cluster.settle-timeout", "0s",
@@ -267,7 +269,8 @@ func (am *Alertmanager) Start() {
 	if am.opts.RoutePrefix != "" {
 		args = append(args, "--web.route-prefix", am.opts.RoutePrefix)
 	}
-	cmd := exec.Command("../../../alertmanager", args...)
+	bin := filepath.Join(os.Getenv("GOPATH"), "bin/prometheus-alertmanager")
+	cmd := exec.Command(bin, args...)
 
 	if am.cmd == nil {
 		var outb, errb buffer
--- a/test/with_api_v2/acceptance.go
+++ b/test/with_api_v2/acceptance.go
@@ -300,6 +300,8 @@ func (am *Alertmanager) Start(additional
 		"--config.file", am.confFile.Name(),
 		"--log.level", "debug",
 		"--web.listen-address", am.apiAddr,
+                "--template.default", filepath.Join(os.Getenv("GOPATH"), "src/github.com/prometheus/alertmanager/template/default.tmpl"),
+                "--web.ui-path", filepath.Join(os.Getenv("GOPATH"), "src/github.com/prometheus/alertmanager/ui/app"),
 		"--storage.path", am.dir,
 		"--cluster.listen-address", am.clusterAddr,
 		"--cluster.settle-timeout", "0s",
@@ -309,7 +311,8 @@ func (am *Alertmanager) Start(additional
 	}
 	args = append(args, additionalArg...)
 
-	cmd := exec.Command("../../../alertmanager", args...)
+	bin := filepath.Join(os.Getenv("GOPATH"), "bin/prometheus-alertmanager")
+	cmd := exec.Command(bin, args...)
 
 	if am.cmd == nil {
 		var outb, errb buffer
