...

Source file src/github.com/prometheus/alertmanager/test/with_api_v2/acceptance/web_test.go

Documentation: github.com/prometheus/alertmanager/test/with_api_v2/acceptance

     1  // Copyright 2018 Prometheus Team
     2  // Licensed under the Apache License, Version 2.0 (the "License");
     3  // you may not use this file except in compliance with the License.
     4  // You may obtain a copy of the License at
     5  //
     6  // http://www.apache.org/licenses/LICENSE-2.0
     7  //
     8  // Unless required by applicable law or agreed to in writing, software
     9  // distributed under the License is distributed on an "AS IS" BASIS,
    10  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  package test
    15  
    16  import (
    17  	"testing"
    18  
    19  	a "github.com/prometheus/alertmanager/test/with_api_v2"
    20  )
    21  
    22  func TestWebWithPrefix(t *testing.T) {
    23  	t.Parallel()
    24  
    25  	conf := `
    26  route:
    27    receiver: "default"
    28    group_by: []
    29    group_wait:      1s
    30    group_interval:  1s
    31    repeat_interval: 1h
    32  
    33  receivers:
    34  - name: "default"
    35  `
    36  
    37  	// The test framework polls the API with the given prefix during
    38  	// Alertmanager startup and thereby ensures proper configuration.
    39  	at := a.NewAcceptanceTest(t, &a.AcceptanceOpts{RoutePrefix: "/foo"})
    40  	at.AlertmanagerCluster(conf, 1)
    41  	at.Run()
    42  }
    43  

View as plain text