Alerting: Add alertmanager integration tests (#100106)

This commit is contained in:
Tito Lins
2025-02-13 11:36:45 +01:00
committed by GitHub
parent 6db155649c
commit ae9837b793
15 changed files with 1059 additions and 0 deletions

View File

@ -0,0 +1,41 @@
package alertmanager
import (
"os"
"github.com/grafana/e2e"
)
const (
defaultPostgresImage = "postgres:16.4"
postgresHTTPPort = 5432
)
// GetDefaultImage returns the Docker image to use to run the Postgres..
func GetPostgresImage() string {
if img := os.Getenv("POSTGRES_IMAGE"); img != "" {
return img
}
return defaultPostgresImage
}
type PostgresService struct {
*e2e.HTTPService
}
func NewPostgresService(name string, envVars map[string]string) *PostgresService {
svc := &PostgresService{
HTTPService: e2e.NewHTTPService(
name,
GetPostgresImage(),
nil,
nil,
postgresHTTPPort,
),
}
svc.SetEnvVars(envVars)
return svc
}