Skip to content

Commit

Permalink
test/cli: add periods to comment sentences and import ordering
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gier <pgier@redhat.com>
  • Loading branch information
pgier authored and DuskEagle committed Aug 1, 2019
1 parent eca6f4c commit c3cd10a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions test/cli/acceptance.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ import (
"testing"
"time"

httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"

apiclient "github.com/prometheus/alertmanager/api/v2/client"
"github.com/prometheus/alertmanager/api/v2/client/general"
"github.com/prometheus/alertmanager/api/v2/models"
"github.com/prometheus/alertmanager/cli/format"

httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)

const (
// amtool is the relative path to local amtool binary
// amtool is the relative path to local amtool binary.
amtool = "../../../amtool"
)

Expand Down Expand Up @@ -463,7 +463,7 @@ func (am *Alertmanager) AddAlertsAt(at float64, alerts ...*TestAlert) {
})
}

// AddAlerts declares alerts that are to be added to the Alertmanager server
// AddAlerts declares alerts that are to be added to the Alertmanager server.
func (am *Alertmanager) AddAlerts(alerts ...*TestAlert) {
for _, alert := range alerts {
out, err := am.addAlertCommand(alert)
Expand All @@ -489,7 +489,7 @@ func (am *Alertmanager) addAlertCommand(alert *TestAlert) ([]byte, error) {
return cmd.CombinedOutput()
}

// QueryAlerts uses the amtool cli to query alerts
// QueryAlerts uses the amtool cli to query alerts.
func (am *Alertmanager) QueryAlerts() ([]TestAlert, error) {
amURLFlag := "--alertmanager.url=" + am.getURL("/")
cmd := exec.Command(amtool, amURLFlag, "alert", "query")
Expand Down Expand Up @@ -545,7 +545,7 @@ func (am *Alertmanager) SetSilence(at float64, sil *TestSilence) {
}
}

// addSilenceCommand adds a silence using the 'amtool silence add' command
// addSilenceCommand adds a silence using the 'amtool silence add' command.
func (am *Alertmanager) addSilenceCommand(sil *TestSilence) ([]byte, error) {
amURLFlag := "--alertmanager.url=" + am.getURL("/")
args := []string{amURLFlag, "silence", "add"}
Expand All @@ -557,7 +557,7 @@ func (am *Alertmanager) addSilenceCommand(sil *TestSilence) ([]byte, error) {
return cmd.CombinedOutput()
}

// QuerySilence queries the current silences using the 'amtool silence query' command
// QuerySilence queries the current silences using the 'amtool silence query' command.
func (am *Alertmanager) QuerySilence() ([]TestSilence, error) {
amURLFlag := "--alertmanager.url=" + am.getURL("/")
args := []string{amURLFlag, "silence", "query"}
Expand Down Expand Up @@ -631,7 +631,7 @@ func (am *Alertmanager) DelSilence(at float64, sil *TestSilence) {
}
}

// expireSilenceCommand expires a silence using the 'amtool silence expire' command
// expireSilenceCommand expires a silence using the 'amtool silence expire' command.
func (am *Alertmanager) expireSilenceCommand(sil *TestSilence) ([]byte, error) {
amURLFlag := "--alertmanager.url=" + am.getURL("/")
args := []string{amURLFlag, "silence", "expire", sil.ID()}
Expand Down
2 changes: 1 addition & 1 deletion test/cli/acceptance/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestMain(m *testing.M) {
}

// TestAmtoolVersion checks that amtool is executable and
// is reporting valid version info
// is reporting valid version info.
func TestAmtoolVersion(t *testing.T) {
t.Parallel()
version, err := Version()
Expand Down

0 comments on commit c3cd10a

Please sign in to comment.