Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
Log Alertmanager version used for testing
Browse files Browse the repository at this point in the history
There's ever growing list of tested Alertmanager releases, print version so it's more obvious what do we actually test against
  • Loading branch information
prymitive committed Feb 13, 2018
1 parent c601aba commit 9a5909a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ func testAlertGroup(version string, t *testing.T, testCase groupTest, group mode
func TestVerifyAllGroups(t *testing.T) {
mockConfig()
for _, version := range mock.ListAllMocks() {
t.Logf("Testing API using mock files from Alertmanager %s", version)
mockAlerts(version)
r := ginTestEngine()
req, _ := http.NewRequest("GET", "/alerts.json", nil)
Expand Down
3 changes: 3 additions & 0 deletions views_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func mockAlerts(version string) {
func TestAlerts(t *testing.T) {
mockConfig()
for _, version := range mock.ListAllMocks() {
t.Logf("Testing alerts using mock files from Alertmanager %s", version)
mockAlerts(version)
r := ginTestEngine()
req, _ := http.NewRequest("GET", "/alerts.json?q=@receiver=by-cluster-service,alertname=HTTP_Probe_Failed,instance=web1", nil)
Expand Down Expand Up @@ -183,6 +184,7 @@ func TestAlerts(t *testing.T) {
func TestValidateAllAlerts(t *testing.T) {
mockConfig()
for _, version := range mock.ListAllMocks() {
t.Logf("Validating alerts.json response using mock files from Alertmanager %s", version)
mockAlerts(version)
r := ginTestEngine()
req, _ := http.NewRequest("GET", "/alerts.json?q=alertname=HTTP_Probe_Failed,instance=web1", nil)
Expand Down Expand Up @@ -354,6 +356,7 @@ var acTests = []acTestCase{
func TestAutocomplete(t *testing.T) {
mockConfig()
for _, version := range mock.ListAllMocks() {
t.Logf("Testing autocomplete using mock files from Alertmanager %s", version)
mockAlerts(version)
r := ginTestEngine()

Expand Down

0 comments on commit 9a5909a

Please sign in to comment.