chore(backend): update all deps

This commit is contained in:
Łukasz Mierzwa
2025-03-19 10:19:27 +00:00
committed by Łukasz Mierzwa
parent c486bc7308
commit e6a886ed36
133 changed files with 447 additions and 337 deletions

View File

@@ -1,5 +1,5 @@
run:
deadline: 5m
timeout: 5m
output:
sort-results: true
@@ -10,12 +10,19 @@ linters:
- goimports
- revive
- misspell
- staticcheck
- promlinter
- tenv
- errorlint
- exportloopref
- predeclared
- exhaustive
- importas
- nakedret
- prealloc
- unconvert
- testifylint
- copyloopvar
- exptostd
- nilnesserr
- usetesting
issues:
max-same-issues: 0

View File

@@ -147,7 +147,6 @@ func (hp *historyPoller) run(workers int) {
hp.isRunning.Store(true)
wg := sync.WaitGroup{}
for w := 1; w <= workers; w++ {
w := w
wg.Add(1)
go func() {
defer wg.Done()
@@ -306,7 +305,7 @@ func rewriteTransport(rules []config.HistoryRewrite, uri string) (http.RoundTrip
func countAlerts(uri string, timeout time.Duration, transport http.RoundTripper, labels map[string]string) (ret []OffsetSample, err error) {
if uri == "" {
return
return ret, err
}
client, err := api.NewClient(api.Config{

View File

@@ -347,8 +347,6 @@ func filterAlerts(dedupedAlerts []models.AlertGroup, fl []filters.FilterT) (filt
agCopy.StateCount[s] = 0
}
for _, alert := range ag.Alerts {
alert := alert
var hadMismatch bool
for _, filter := range fl {
if filter.GetIsValid() {
@@ -363,7 +361,6 @@ func filterAlerts(dedupedAlerts []models.AlertGroup, fl []filters.FilterT) (filt
blockedAMs := map[string]bool{}
for _, am := range alert.Alertmanager {
am := am
for _, filter := range fl {
if filter.GetIsValid() && filter.GetIsAlertmanagerFilter() && !filter.MatchAlertmanager(&am) {
blockedAMs[am.Name] = true
@@ -393,7 +390,7 @@ func filterAlerts(dedupedAlerts []models.AlertGroup, fl []filters.FilterT) (filt
}
}
return
return filteredAlerts
}
func newStateCount() map[string]int {

View File

@@ -94,7 +94,6 @@ func TestSortByStartsAt(t *testing.T) {
}
for _, testCase := range testCases {
testCase := testCase
sort.Slice(testCase.groups, func(i, j int) bool {
return sortByStartsAt(i, j, testCase.groups, testCase.sortReverse)
})

View File

@@ -65,7 +65,6 @@ func TestAuthHeader(t *testing.T) {
defer httpmock.DeactivateAndReset()
for _, testCase := range authHeaderTests {
testCase := testCase // scopelint pin
for _, version := range mock.ListAllMocks() {
apiCache, _ = lru.New[string, []byte](100)

View File

@@ -88,7 +88,7 @@ func BenchmarkPullAlerts(b *testing.B) {
mockConfig(b.Setenv)
for _, version := range mock.ListAllMocks() {
version := version
b.Run(version, func(b *testing.B) {
for i := 0; i < b.N; i++ {
mockAlerts(version)

View File

@@ -111,7 +111,6 @@ func TestGetViewURL(t *testing.T) {
}
for _, testCase := range tests {
testCase := testCase
t.Run(fmt.Sprintf("prefix=%q view=%v result=%q", testCase.prefix, testCase.view, testCase.result), func(t *testing.T) {
config.Config.Listen.Prefix = testCase.prefix
result := getViewURL(testCase.view)

View File

@@ -247,7 +247,6 @@ func TestProxyHeaders(t *testing.T) {
defer httpmock.DeactivateAndReset()
for _, testCase := range proxyHeaderTests {
testCase := testCase // scopelint pin
r := testRouter()
am, err := alertmanager.NewAlertmanager(
"cluster",

View File

@@ -22,42 +22,16 @@ import (
"github.com/beme/abide"
"github.com/rogpeppe/go-internal/testscript"
"github.com/rs/zerolog/log"
"github.com/spf13/pflag"
)
func mainShoulFail() int {
initLogger()
err := serve(pflag.ContinueOnError)
if err != nil {
log.Error().Err(err).Msg("Execution failed")
return 0
}
log.Error().Msg("No error logged")
return 100
}
func mainShouldWork() int {
initLogger()
err := serve(pflag.ContinueOnError)
if err != nil {
log.Error().Err(err).Msg("Execution failed")
return 100
}
return 0
}
func TestMain(m *testing.M) {
ecode := testscript.RunMain(m, map[string]func() int{
"karma.bin-should-fail": mainShoulFail,
"karma.bin-should-work": mainShouldWork,
testscript.Main(m, map[string]func(){
"karma": main,
})
err := abide.Cleanup()
if err != nil {
fmt.Printf("abide.Cleanup() error: %v\n", err)
ecode = 1
}
os.Exit(ecode)
}
func TestScripts(t *testing.T) {
@@ -154,7 +128,6 @@ func httpServer(ts *testscript.TestScript, _ bool, args []string) {
for n, mockList := range mocks.responses {
if n == name {
for _, mock := range mockList {
mock := mock
mux.HandleFunc(mock.pattern, mock.handler)
}
break

View File

@@ -1,5 +1,5 @@
# Config is valid with example silence ACL rules
karma.bin-should-work --check-config
exec karma --check-config
! stdout .
cmp stderr stderr.txt

View File

@@ -1,5 +1,5 @@
# Raises an error if --authorization.acl points to a file that cannot be parsed
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="failed to parse silence ACL configuration file \"acl.yaml\": yaml: unmarshal errors:\n line 1: cannot unmarshal !!str `This Is...` into config.SilencesACLSchema"
level=fatal msg="Execution failed" error="failed to parse silence ACL configuration file \"acl.yaml\": yaml: unmarshal errors:\n line 1: cannot unmarshal !!str `This Is...` into config.SilencesACLSchema"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if --authorization.acl points to a missing file
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="failed to load silence ACL configuration file \"acl.yaml\": open acl.yaml: no such file or directory"
level=fatal msg="Execution failed" error="failed to load silence ACL configuration file \"acl.yaml\": open acl.yaml: no such file or directory"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses invalid 'action' value
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule requires 'action' to be one of [allow block requireMatcher], got \"foo\""
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule requires 'action' to be one of [allow block requireMatcher], got \"foo\""
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses invalid 'alertmanagers' value
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: invalid ACL rule, no alertmanager with name \"unknown\" found"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: invalid ACL rule, no alertmanager with name \"unknown\" found"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses filter with invalid name_re
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: invalid ACL rule, failed to parse name_re \"cluster***\": error parsing regexp: invalid nested repetition operator: `**`"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: invalid ACL rule, failed to parse name_re \"cluster***\": error parsing regexp: invalid nested repetition operator: `**`"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses filter with invalid value_re
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: invalid ACL rule, failed to parse value_re \"prod***\": error parsing regexp: invalid nested repetition operator: `**`"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: invalid ACL rule, failed to parse value_re \"prod***\": error parsing regexp: invalid nested repetition operator: `**`"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses invalid 'groups' value
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: invalid silence ACL rule, no group with name \"unknown\" found in authorization.groups configuration"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: invalid silence ACL rule, no group with name \"unknown\" found in authorization.groups configuration"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses matcher with invalid name_re
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: invalid ACL rule, failed to parse name_re \"cluster.++++\": error parsing regexp: invalid nested repetition operator: `++`"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: invalid ACL rule, failed to parse name_re \"cluster.++++\": error parsing regexp: invalid nested repetition operator: `++`"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses matcher with invalid value_re
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: invalid ACL rule, failed to parse value_re \".+++\": error parsing regexp: invalid nested repetition operator: `++`"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: invalid ACL rule, failed to parse value_re \".+++\": error parsing regexp: invalid nested repetition operator: `++`"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses matcher with both name and name_re
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher can only have 'name' or 'name_re' set, not both"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher can only have 'name' or 'name_re' set, not both"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses matcher with both value and value_re
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher can only have 'value' or 'value_re' set, not both"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher can only have 'value' or 'value_re' set, not both"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses filter with missing name or name_re
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule filter requires 'name' or 'name_re' to be set"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule filter requires 'name' or 'name_re' to be set"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses filter with missing value or value_re
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule filter requires 'value' or 'value_re' to be set"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule filter requires 'value' or 'value_re' to be set"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses matcher without name
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher requires 'name' or 'name_re' to be set"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher requires 'name' or 'name_re' to be set"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses matcher without name
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher requires 'name' or 'name_re' to be set"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher requires 'name' or 'name_re' to be set"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses matcher without value
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher requires 'value' or 'value_re' to be set"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher requires 'value' or 'value_re' to be set"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses matcher without value
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher requires 'value' or 'value_re' to be set"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule matcher requires 'value' or 'value_re' to be set"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule is missing 'reason'
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule requires 'reason' to be set"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule requires 'reason' to be set"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses filter with both name and name_re
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule filter can only have 'name' or 'name_re' set, not both"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule filter can only have 'name' or 'name_re' set, not both"
-- karma.yaml --
authentication:
header:

View File

@@ -1,5 +1,5 @@
# Raises an error if silence ACL rule uses filter with both value and value_re
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule filter can only have 'value' or 'value_re' set, not both"
level=fatal msg="Execution failed" error="invalid silence ACL rule at position 0: silence ACL rule filter can only have 'value' or 'value_re' set, not both"
-- karma.yaml --
authentication:
header:

View File

@@ -1,10 +1,10 @@
# Raises an error if basic auth credentials are missing
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="authentication.basicAuth.users require both username and password to be set"
level=fatal msg="Execution failed" error="authentication.basicAuth.users require both username and password to be set"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,10 +1,10 @@
# Raises an error if basic auth password is missing
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="authentication.basicAuth.users require both username and password to be set"
level=fatal msg="Execution failed" error="authentication.basicAuth.users require both username and password to be set"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,10 +1,10 @@
# Raises an error if basic auth username is missing
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="authentication.basicAuth.users require both username and password to be set"
level=fatal msg="Execution failed" error="authentication.basicAuth.users require both username and password to be set"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,10 +1,10 @@
# Raises an error if authorization group is missing name
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="'members' is required for every authorization group"
level=fatal msg="Execution failed" error="'members' is required for every authorization group"
-- karma.yaml --
authentication:
header:

View File

@@ -1,10 +1,10 @@
# Raises an error if authorization group is missing name
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="'name' is required for every authorization group"
level=fatal msg="Execution failed" error="'name' is required for every authorization group"
-- karma.yaml --
authentication:
header:

View File

@@ -1,10 +1,10 @@
# Raises an error if both header & basic auth authentication is enabled
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="both authentication.basicAuth.users and authentication.header.name is set, only one can be enabled"
level=fatal msg="Execution failed" error="both authentication.basicAuth.users and authentication.header.name is set, only one can be enabled"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,10 +1,10 @@
# Raises an error if header authentication config is missing name
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="authentication.header.name is required when authentication.header.value_re is set"
level=fatal msg="Execution failed" error="authentication.header.name is required when authentication.header.value_re is set"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,10 +1,10 @@
# Raises an error if header authentication config is missing regex rule
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="authentication.header.value_re is required when authentication.header.name is set"
level=fatal msg="Execution failed" error="authentication.header.value_re is required when authentication.header.name is set"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,10 +1,10 @@
# Raises an error if header authentication config contains invalid regex rule
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="invalid regex for authentication.header.value_re: error parsing regexp: invalid nested repetition operator: `++`"
level=fatal msg="Execution failed" error="invalid regex for authentication.header.value_re: error parsing regexp: invalid nested repetition operator: `++`"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,5 +1,5 @@
# Validates config when --check-config is passed
karma.bin-should-work --check-config --alertmanager.uri=http://127.0.0.1:7031
exec karma --check-config --alertmanager.uri=http://127.0.0.1:7031
! stdout .
stderr 'msg="Configuration is valid"'
! stderr 'level=error'

View File

@@ -1,6 +1,6 @@
# Loads config file from flags when CONFIG_FILE env is also set
env CONFIG_FILE=env.yaml
karma.bin-should-work --check-config --config.file=flag.yaml
exec karma --check-config --config.file=flag.yaml
! stdout .
cmp stderr stderr.txt

View File

@@ -1,6 +1,6 @@
# Loads config file from CONFIG_FILE env
env CONFIG_FILE=foo.yaml
karma.bin-should-work --check-config
exec karma --check-config
! stdout .
cmp stderr stderr.txt

View File

@@ -1,6 +1,6 @@
# Loads config file from --config.file flag
env CONFIG_FILE=foo.yaml
karma.bin-should-work --check-config --config.file foo.yaml
exec karma --check-config --config.file foo.yaml
! stdout .
cmp stderr stderr.txt

View File

@@ -1,7 +1,7 @@
# Works in simple mode when single --alertmanager.uri flag is passed
exec bash -x ./test.sh &
karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7035 --listen.address=127.0.0.1 --listen.port=8035 --log.requests
exec karma --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7035 --listen.address=127.0.0.1 --listen.port=8035 --log.requests
! stdout .
stderr 'msg="Request completed" address=127.0.0.1:[0-9]+ bytes=[0-9]+ code=200 duration=.+ method=POST path=/alerts.json'
stderr 'msg="Request completed" address=127.0.0.1:[0-9]+ bytes=[0-9]+ code=200 duration=.+ method=POST path=/alerts.json'

View File

@@ -1,5 +1,5 @@
# Load 'karma.yaml' from cwd by default
karma.bin-should-work --check-config
exec karma --check-config
! stdout .
cmp stderr stderr.txt

View File

@@ -1,5 +1,5 @@
# Raises an error if we have 2 instances with the same name (one using default name)
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
@@ -7,7 +7,7 @@ cmp stderr stderr.txt
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=error msg="Execution failed" error="failed to register Alertmanager 'default' with URI 'https://127.0.0.1:9094': alertmanager upstream 'default' already exist"
level=fatal msg="Execution failed" error="failed to register Alertmanager 'default' with URI 'https://127.0.0.1:9094': alertmanager upstream 'default' already exist"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,5 +1,5 @@
# Raises an error if we have 2 instances with the same name
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
@@ -7,7 +7,7 @@ cmp stderr stderr.txt
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=am1 name=am1 proxy=false readonly=false uri=https://127.0.0.1:9093
level=error msg="Execution failed" error="failed to register Alertmanager 'am1' with URI 'https://127.0.0.1:9094': alertmanager upstream 'am1' already exist"
level=fatal msg="Execution failed" error="failed to register Alertmanager 'am1' with URI 'https://127.0.0.1:9094': alertmanager upstream 'am1' already exist"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,10 +1,10 @@
# Raises an error if history.rewrite rule contains invalid regex
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="history.rewrite source regex \"foo.++++++\" is invalid: error parsing regexp: invalid nested repetition operator: `++`"
level=fatal msg="Execution failed" error="history.rewrite source regex \"foo.++++++\" is invalid: error parsing regexp: invalid nested repetition operator: `++`"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,5 +1,5 @@
# Uses 'default' as the default alertmanager name
karma.bin-should-work --config.file=karma.yaml --check-config
exec karma --config.file=karma.yaml --check-config
! stdout .
cmp stderr stderr.txt

View File

@@ -1,10 +1,10 @@
# Raises an error if we cors.credentials value is incorrect
karma.bin-should-fail --config.file karma.yaml
! exec karma --config.file karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="invalid cors.credentials value 'foo' for alertmanager 'am1', allowed options: omit, inclue, same-origin"
level=fatal msg="Execution failed" error="invalid cors.credentials value 'foo' for alertmanager 'am1', allowed options: omit, inclue, same-origin"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,10 +1,10 @@
# Raises an error if we pass alertmanager.interval value that doesn't parse
karma.bin-should-fail --config.file karma.yaml
! exec karma --config.file karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="failed to unmarshal configuration: 1 error(s) decoding:\n\n* error decoding 'Alertmanager.Interval': time: invalid duration \"abc123\""
level=fatal msg="Execution failed" error="failed to unmarshal configuration: 1 error(s) decoding:\n\n* error decoding 'Alertmanager.Interval': time: invalid duration \"abc123\""
-- karma.yaml --
alertmanager:
interval: abc123

View File

@@ -1,8 +1,89 @@
# Fails on invalid flag usage
env CONFIG_FILE=foo.yaml
karma.bin-should-fail --check-config --invalid.flag
! stdout .
! exec karma --check-config --invalid.flag
cmp stdout stdout.txt
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="unknown flag: --invalid.flag"
unknown flag: --invalid.flag
Usage of karma:
--alertAcknowledgement.author string Default silence author when acknowledging alerts with short lived silences (default "karma")
--alertAcknowledgement.comment string Comment used when acknowledging alerts with short lived silences (default "ACK! This alert was acknowledged using karma on %NOW%")
--alertAcknowledgement.duration duration Initial silence duration when acknowledging alerts with short lived silences (default 15m0s)
--alertAcknowledgement.enabled Enable alert acknowledging
--alertmanager.cors.credentials string CORS credentials policy for browser fetch requests (default "include")
--alertmanager.external_uri string Alertmanager server URI used for web UI links (only used with simplified config)
--alertmanager.interval duration Interval for fetching data from Alertmanager servers (default 1m0s)
--alertmanager.name string Name for the Alertmanager server (only used with simplified config) (default "default")
--alertmanager.proxy Proxy all client requests to Alertmanager via karma (only used with simplified config)
--alertmanager.readonly Enable read-only mode that disable silence management (only used with simplified config)
--alertmanager.timeout duration Timeout for requests sent to the Alertmanager server (only used with simplified config) (default 40s)
--alertmanager.tls.ca string Path to CA certificate used to establish TLS connection to the Alertmanager server (only used with simplified config)
--alertmanager.tls.cert string Path to a TLS client certificate file to use when establishing TLS connections to the Alertmanager server - requires alertmanager.tls.key to be set (only used with simplified config)
--alertmanager.tls.key string Path to a TLS client key file to use when establishing TLS connections to the Alertmanager server - requires alertmanager.tls.key to be set (only used with simplified config)
--alertmanager.uri string Alertmanager server URI (only used with simplified config)
--annotations.actions strings List of annotations that will be moved to the alert menu
--annotations.default.hidden Hide all annotations by default unless explicitly listed in the 'visible' list
--annotations.enableInsecureHTML Enable HTML strings in annotations to be parsed as HTML, enable at your own risk
--annotations.hidden strings List of annotations that are hidden by default
--annotations.keep strings List of annotations to keep, all other annotations will be stripped
--annotations.order strings Preferred order of annotation names
--annotations.strip strings List of annotations to ignore
--annotations.visible strings List of annotations that are visible by default
--authorization.acl.silences string Path to silence ACL config file
--check-config Validate configuration and exit
--config.file string Full path to the configuration file, 'karma.yaml' will be used if found in the current working directory
--custom.css string Path to a file with custom CSS to load
--custom.js string Path to a file with custom JavaScript to load
--debug Enable debug mode
--filters.default strings List of default filters
--grid.auto.ignore strings List of label names not allowed for automatic multi-grid
--grid.auto.order strings Order of preference for selecting label names for automatic multi-grid
--grid.groupLimit int Default number of groups to show for each grid (default 40)
--grid.sorting.label string Label name to use when sorting alert grid by label (default "alertname")
--grid.sorting.order string Default sort order for alert grid (default "startsAt")
--grid.sorting.reverse Reverse sort order (default true)
--history.enabled Enable alert history queries (default true)
--history.timeout duration Timeout for history queries against source Prometheus servers (default 20s)
--history.workers int Number of history query workers to run (default 30)
--karma.name string Name for the karma instance (default "karma")
--labels.color.static strings List of label names that should have the same (but distinct) color
--labels.color.unique strings List of label names that should have unique color
--labels.keep strings List of labels to keep, all other labels will be stripped
--labels.keep_re strings List of regular expressions to keep matching labels, all other labels will be stripped
--labels.order strings Preferred order of label names
--labels.strip strings List of labels to ignore
--labels.strip_re strings List of regular expressions to ignore matching labels
--labels.valueOnly strings List of label names for which only the name will be shown in the UI
--labels.valueOnly_re strings List of regular expressions to show only the name of matching labels
--listen.address string IP/Hostname to listen on
--listen.port int HTTP port to listen on (default 8080)
--listen.prefix string URL prefix (default "/")
--listen.timeout.read duration HTTP request read timeout (default 10s)
--listen.timeout.write duration HTTP response write timeout (default 20s)
--listen.tls.cert string TLS certificate path (enables HTTPS)
--listen.tls.key string TLS key path (enables HTTPS)
--log.config Log used configuration to log on startup
--log.format string Log format, one of: text, json (default "text")
--log.level string Log level, one of: debug, info, warning, error, fatal and panic (default "info")
--log.requests Enable request logging
--log.timestamp Add timestamps to all log messages
--pid-file string If set PID of karma process will be written to this file
--receivers.keep strings List of receivers to keep, all alerts with different receivers will be ignored
--receivers.keep_re strings List of regular expressions to keep matching receivers, all other receivers will be ignored
--receivers.strip strings List of receivers to not display alerts for
--receivers.strip_re strings List of regular expressions to ignore matching receivers
--silenceForm.defaultAlertmanagers strings List of Alertmanager names to use as default when creating a new silence
--silenceForm.strip.labels strings List of labels to ignore when auto-filling silence form from alerts
--silences.expired duration Maximum age of expired silences to show on active alerts (default 10m0s)
--ui.alertsPerGroup int Default number of alerts to show for each alert group (default 5)
--ui.animations Enable UI animations (default true)
--ui.collapseGroups string Default state for alert groups (default "collapsedOnMobile")
--ui.colorTitlebar Color alert group titlebar based on alert state
--ui.hideFiltersWhenIdle Hide the filters bar when idle (default true)
--ui.minimalGroupWidth int Minimal width for each alert group on the grid (default 420)
--ui.refresh duration UI refresh interval (default 30s)
--ui.theme string Default theme, 'light', 'dark' or 'auto' (follow browser preference) (default "auto")
--version Print version and exit
-- stdout.txt --
unknown flag: --invalid.flag

View File

@@ -1,7 +1,88 @@
# Raises an error if we pass alertmanager.timeout value that doesn't parse
karma.bin-should-fail --alertmanager.timeout=abc123 --alertmanager.uri=http://127.0.0.1:7044
! stdout .
! exec karma --alertmanager.timeout=abc123 --alertmanager.uri=http://127.0.0.1:7044
cmp stdout stdout.txt
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="invalid argument \"abc123\" for \"--alertmanager.timeout\" flag: time: invalid duration \"abc123\""
invalid argument "abc123" for "--alertmanager.timeout" flag: time: invalid duration "abc123"
Usage of karma:
--alertAcknowledgement.author string Default silence author when acknowledging alerts with short lived silences (default "karma")
--alertAcknowledgement.comment string Comment used when acknowledging alerts with short lived silences (default "ACK! This alert was acknowledged using karma on %NOW%")
--alertAcknowledgement.duration duration Initial silence duration when acknowledging alerts with short lived silences (default 15m0s)
--alertAcknowledgement.enabled Enable alert acknowledging
--alertmanager.cors.credentials string CORS credentials policy for browser fetch requests (default "include")
--alertmanager.external_uri string Alertmanager server URI used for web UI links (only used with simplified config)
--alertmanager.interval duration Interval for fetching data from Alertmanager servers (default 1m0s)
--alertmanager.name string Name for the Alertmanager server (only used with simplified config) (default "default")
--alertmanager.proxy Proxy all client requests to Alertmanager via karma (only used with simplified config)
--alertmanager.readonly Enable read-only mode that disable silence management (only used with simplified config)
--alertmanager.timeout duration Timeout for requests sent to the Alertmanager server (only used with simplified config) (default 40s)
--alertmanager.tls.ca string Path to CA certificate used to establish TLS connection to the Alertmanager server (only used with simplified config)
--alertmanager.tls.cert string Path to a TLS client certificate file to use when establishing TLS connections to the Alertmanager server - requires alertmanager.tls.key to be set (only used with simplified config)
--alertmanager.tls.key string Path to a TLS client key file to use when establishing TLS connections to the Alertmanager server - requires alertmanager.tls.key to be set (only used with simplified config)
--alertmanager.uri string Alertmanager server URI (only used with simplified config)
--annotations.actions strings List of annotations that will be moved to the alert menu
--annotations.default.hidden Hide all annotations by default unless explicitly listed in the 'visible' list
--annotations.enableInsecureHTML Enable HTML strings in annotations to be parsed as HTML, enable at your own risk
--annotations.hidden strings List of annotations that are hidden by default
--annotations.keep strings List of annotations to keep, all other annotations will be stripped
--annotations.order strings Preferred order of annotation names
--annotations.strip strings List of annotations to ignore
--annotations.visible strings List of annotations that are visible by default
--authorization.acl.silences string Path to silence ACL config file
--check-config Validate configuration and exit
--config.file string Full path to the configuration file, 'karma.yaml' will be used if found in the current working directory
--custom.css string Path to a file with custom CSS to load
--custom.js string Path to a file with custom JavaScript to load
--debug Enable debug mode
--filters.default strings List of default filters
--grid.auto.ignore strings List of label names not allowed for automatic multi-grid
--grid.auto.order strings Order of preference for selecting label names for automatic multi-grid
--grid.groupLimit int Default number of groups to show for each grid (default 40)
--grid.sorting.label string Label name to use when sorting alert grid by label (default "alertname")
--grid.sorting.order string Default sort order for alert grid (default "startsAt")
--grid.sorting.reverse Reverse sort order (default true)
--history.enabled Enable alert history queries (default true)
--history.timeout duration Timeout for history queries against source Prometheus servers (default 20s)
--history.workers int Number of history query workers to run (default 30)
--karma.name string Name for the karma instance (default "karma")
--labels.color.static strings List of label names that should have the same (but distinct) color
--labels.color.unique strings List of label names that should have unique color
--labels.keep strings List of labels to keep, all other labels will be stripped
--labels.keep_re strings List of regular expressions to keep matching labels, all other labels will be stripped
--labels.order strings Preferred order of label names
--labels.strip strings List of labels to ignore
--labels.strip_re strings List of regular expressions to ignore matching labels
--labels.valueOnly strings List of label names for which only the name will be shown in the UI
--labels.valueOnly_re strings List of regular expressions to show only the name of matching labels
--listen.address string IP/Hostname to listen on
--listen.port int HTTP port to listen on (default 8080)
--listen.prefix string URL prefix (default "/")
--listen.timeout.read duration HTTP request read timeout (default 10s)
--listen.timeout.write duration HTTP response write timeout (default 20s)
--listen.tls.cert string TLS certificate path (enables HTTPS)
--listen.tls.key string TLS key path (enables HTTPS)
--log.config Log used configuration to log on startup
--log.format string Log format, one of: text, json (default "text")
--log.level string Log level, one of: debug, info, warning, error, fatal and panic (default "info")
--log.requests Enable request logging
--log.timestamp Add timestamps to all log messages
--pid-file string If set PID of karma process will be written to this file
--receivers.keep strings List of receivers to keep, all alerts with different receivers will be ignored
--receivers.keep_re strings List of regular expressions to keep matching receivers, all other receivers will be ignored
--receivers.strip strings List of receivers to not display alerts for
--receivers.strip_re strings List of regular expressions to ignore matching receivers
--silenceForm.defaultAlertmanagers strings List of Alertmanager names to use as default when creating a new silence
--silenceForm.strip.labels strings List of labels to ignore when auto-filling silence form from alerts
--silences.expired duration Maximum age of expired silences to show on active alerts (default 10m0s)
--ui.alertsPerGroup int Default number of alerts to show for each alert group (default 5)
--ui.animations Enable UI animations (default true)
--ui.collapseGroups string Default state for alert groups (default "collapsedOnMobile")
--ui.colorTitlebar Color alert group titlebar based on alert state
--ui.hideFiltersWhenIdle Hide the filters bar when idle (default true)
--ui.minimalGroupWidth int Minimal width for each alert group on the grid (default 420)
--ui.refresh duration UI refresh interval (default 30s)
--ui.theme string Default theme, 'light', 'dark' or 'auto' (follow browser preference) (default "auto")
--version Print version and exit
-- stdout.txt --
invalid argument "abc123" for "--alertmanager.timeout" flag: time: invalid duration "abc123"

View File

@@ -1,7 +1,7 @@
# Raises an error if listen.prefix is invalid
karma.bin-should-fail --alertmanager.uri http://127.0.0.1 --listen.prefix karma
! exec karma --alertmanager.uri http://127.0.0.1 --listen.prefix karma
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="listen.prefix must start with '/', got \"karma\""
level=fatal msg="Execution failed" error="listen.prefix must start with '/', got \"karma\""

View File

@@ -1,7 +1,7 @@
# Raises an error if invalid log format is passed
karma.bin-should-fail --log.format=xml
! exec karma --log.format=xml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="unknown log format 'xml'"
level=fatal msg="Execution failed" error="unknown log format 'xml'"

View File

@@ -1,7 +1,7 @@
# Raises an error if invalid log level is passed
karma.bin-should-fail --log.timestamp=false --log.level=foobar
! exec karma --log.timestamp=false --log.level=foobar
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="unknown log level 'foobar'"
level=fatal msg="Execution failed" error="unknown log level 'foobar'"

View File

@@ -1,12 +1,12 @@
# Raises an error if proxy config is invalid
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=error msg="Execution failed" error="failed to create Alertmanager 'proxied' with URI 'httpz://127.0.0.1': unsupported URI scheme 'httpz' in 'httpz://127.0.0.1'"
level=fatal msg="Execution failed" error="failed to create Alertmanager 'proxied' with URI 'httpz://127.0.0.1': unsupported URI scheme 'httpz' in 'httpz://127.0.0.1'"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,12 +1,12 @@
# Raises an error if proxy_url is invalid
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=error msg="Execution failed" error="failed to parse provided proxy url \"%gh&%ij\": parse \"%gh&%ij\": invalid URL escape \"%gh\""
level=fatal msg="Execution failed" error="failed to parse provided proxy url \"%gh&%ij\": parse \"%gh&%ij\": invalid URL escape \"%gh\""
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,7 +1,7 @@
# Raises an error if negative refresh interval is passed
karma.bin-should-fail --alertmanager.interval=-4s
! exec karma --alertmanager.interval=-4s
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="invalid alertmanager.interval value '-4s'"
level=fatal msg="Execution failed" error="invalid alertmanager.interval value '-4s'"

View File

@@ -1,8 +1,8 @@
# Raises an error if alertmanager URI is invalid
karma.bin-should-fail --alertmanager.uri httpz://username:secret@127.0.0.1
! exec karma --alertmanager.uri httpz://username:secret@127.0.0.1
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Version: dev"
level=error msg="Execution failed" error="failed to create Alertmanager 'default' with URI 'httpz://username:xxx@127.0.0.1': unsupported URI scheme 'httpz' in 'httpz://username:xxx@127.0.0.1'"
level=fatal msg="Execution failed" error="failed to create Alertmanager 'default' with URI 'httpz://username:xxx@127.0.0.1': unsupported URI scheme 'httpz' in 'httpz://username:xxx@127.0.0.1'"

View File

@@ -1,10 +1,10 @@
# Raises an error if label custom color config is using invalid regex rule
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="failed to parse custom color regex rule '.++++' for 'region' label: error parsing regexp: invalid nested repetition operator: `++`"
level=fatal msg="Execution failed" error="failed to parse custom color regex rule '.++++' for 'region' label: error parsing regexp: invalid nested repetition operator: `++`"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,10 +1,10 @@
# Raises an error if label custom color config is missing a value
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="custom label color for 'region' is missing 'value' or 'value_re'"
level=fatal msg="Execution failed" error="custom label color for 'region' is missing 'value' or 'value_re'"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,12 +1,12 @@
# Raises an error if linkDetect config is missing regex rule
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=error msg="Execution failed" error="invalid link detect rule 'foo++++++': error parsing regexp: invalid nested repetition operator: `++`"
level=fatal msg="Execution failed" error="invalid link detect rule 'foo++++++': error parsing regexp: invalid nested repetition operator: `++`"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,12 +1,12 @@
# Raises an error if linkDetect config is missing regex rule
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=error msg="Execution failed" error="invalid link detect rule, regex '' uriTemplate 'https://jira.example.com/'"
level=fatal msg="Execution failed" error="invalid link detect rule, regex '' uriTemplate 'https://jira.example.com/'"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,12 +1,12 @@
# Raises an error if linkDetect config is missing uriTemplate
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=error msg="Execution failed" error="invalid link detect rule, regex 'DEVOPS-[0-9]+' uriTemplate ''"
level=fatal msg="Execution failed" error="invalid link detect rule, regex 'DEVOPS-[0-9]+' uriTemplate ''"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,5 +1,5 @@
# Config is valid with correct linkDetect rules
karma.bin-should-work --config.file=karma.yaml --check-config
exec karma --config.file=karma.yaml --check-config
! stdout .
cmp stderr stderr.txt

View File

@@ -1,7 +1,7 @@
# Logs messages as JSON when log.format=json is passed
exec bash -x ./test.sh &
karma.bin-should-work --log.format=json --log.timestamp=false --pid-file=karma.pid --listen.address=127.0.0.1 --listen.port=8058
exec karma --log.format=json --log.timestamp=false --pid-file=karma.pid --listen.address=127.0.0.1 --listen.port=8058
! stdout .
cmp stderr stderr.txt
wait

View File

@@ -76,7 +76,7 @@ env UI_COLLAPSEGROUPS=expanded
env UI_MULTIGRIDLABEL=cluster
env UI_MULTIGRIDSORTREVERSE=true
karma.bin-should-work --check-config
exec karma --check-config
! stdout .
cmp stderr stderr.txt

View File

@@ -1,5 +1,5 @@
# Print out and compare logged config set via config file
karma.bin-should-work --config.file=custom.yaml --check-config
exec karma --config.file=custom.yaml --check-config
! stdout .
cmp stderr stderr.txt

View File

@@ -1,10 +1,10 @@
# Print out and compare logged config set via config file that includes invalid values
karma.bin-should-fail --config.file=karma.yaml --check-config
! exec karma --config.file=karma.yaml --check-config
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="failed to unmarshal configuration: 13 error(s) decoding:\n\n* 'Alertmanager.Servers[2].Headers[0]' expected a map, got 'string'\n* cannot parse 'Alertmanager.Servers[0].Proxy' as bool: strconv.ParseBool: parsing \"YEs\": invalid syntax\n* cannot parse 'Annotations.Default.Hidden' as bool: strconv.ParseBool: parsing \"z\": invalid syntax\n* cannot parse 'UI.alertsPerGroup' as int: strconv.ParseInt: parsing \"5a\": invalid syntax\n* cannot parse 'UI.animations' as bool: strconv.ParseBool: parsing \"1a\": invalid syntax\n* cannot parse 'UI.colorTitlebar' as bool: strconv.ParseBool: parsing \"yum\": invalid syntax\n* cannot parse 'UI.hideFiltersWhenIdle' as bool: strconv.ParseBool: parsing \"z\": invalid syntax\n* cannot parse 'UI.minimalGroupWidth' as int: strconv.ParseInt: parsing \"abc4\": invalid syntax\n* cannot parse 'alertAcknowledgement.Enabled' as bool: strconv.ParseBool: parsing \"zzz\": invalid syntax\n* error decoding 'Alertmanager.Interval': time: invalid duration \"jjs88\"\n* error decoding 'Alertmanager.Servers[0].Timeout': time: invalid duration \"bbb\"\n* error decoding 'Alertmanager.Servers[2].Timeout': time: invalid duration \"z\"\n* error decoding 'UI.Refresh': time: unknown unit \"sm\" in duration \"10sm\""
level=fatal msg="Execution failed" error="failed to unmarshal configuration: 13 error(s) decoding:\n\n* 'Alertmanager.Servers[2].Headers[0]' expected a map, got 'string'\n* cannot parse 'Alertmanager.Servers[0].Proxy' as bool: strconv.ParseBool: parsing \"YEs\": invalid syntax\n* cannot parse 'Annotations.Default.Hidden' as bool: strconv.ParseBool: parsing \"z\": invalid syntax\n* cannot parse 'UI.alertsPerGroup' as int: strconv.ParseInt: parsing \"5a\": invalid syntax\n* cannot parse 'UI.animations' as bool: strconv.ParseBool: parsing \"1a\": invalid syntax\n* cannot parse 'UI.colorTitlebar' as bool: strconv.ParseBool: parsing \"yum\": invalid syntax\n* cannot parse 'UI.hideFiltersWhenIdle' as bool: strconv.ParseBool: parsing \"z\": invalid syntax\n* cannot parse 'UI.minimalGroupWidth' as int: strconv.ParseInt: parsing \"abc4\": invalid syntax\n* cannot parse 'alertAcknowledgement.Enabled' as bool: strconv.ParseBool: parsing \"zzz\": invalid syntax\n* error decoding 'Alertmanager.Interval': time: invalid duration \"jjs88\"\n* error decoding 'Alertmanager.Servers[0].Timeout': time: invalid duration \"bbb\"\n* error decoding 'Alertmanager.Servers[2].Timeout': time: invalid duration \"z\"\n* error decoding 'UI.Refresh': time: unknown unit \"sm\" in duration \"10sm\""
-- karma.yaml --
alertmanager:
interval: jjs88

View File

@@ -1,7 +1,7 @@
# Logs timestamps when log.timestamp is set to true
exec bash -x ./test.sh &
karma.bin-should-work --log.timestamp=true --pid-file=karma.pid --listen.address=127.0.0.1 --listen.port=8062
exec karma --log.timestamp=true --pid-file=karma.pid --listen.address=127.0.0.1 --listen.port=8062
! stdout .
stderr '[0-9][0-9]:[0-9][0-9]:[0-9][0-9] level=info msg="Version: dev"'
stderr '[0-9][0-9]:[0-9][0-9]:[0-9][0-9] level=info msg="Pulling latest alerts and silences from Alertmanager"'

View File

@@ -1,7 +1,7 @@
# Errors when config.file points to missing file
karma.bin-should-fail --config.file=404.yaml
! exec karma --config.file=404.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="failed to load configuration file \"404.yaml\": open 404.yaml: no such file or directory"
level=fatal msg="Execution failed" error="failed to load configuration file \"404.yaml\": open 404.yaml: no such file or directory"

View File

@@ -1,7 +1,7 @@
# Logs messages as JSON when log.format=json & log.timestamp=true is passed
exec bash -x ./test.sh &
karma.bin-should-work --log.format=json --log.timestamp=true --pid-file=karma.pid --listen.address=127.0.0.1 --listen.port=8064
exec karma --log.format=json --log.timestamp=true --pid-file=karma.pid --listen.address=127.0.0.1 --listen.port=8064
! stdout .
stderr '{"level":"info","time":"[0-9]+-[0-9]+-[0-9]+T[0-9]+:[0-9]+:[0-9]+.*","message":"Version: dev"}'
stderr '{"level":"info","time":"[0-9]+-[0-9]+-[0-9]+T[0-9]+:[0-9]+:[0-9]+.*","message":"Pulling latest alerts and silences from Alertmanager"}'

View File

@@ -1,5 +1,5 @@
# Check if proxy mode is set correctly
karma.bin-should-fail --log.config=true --config.file=karma.yaml --check-config
! exec karma --log.config=true --config.file=karma.yaml --check-config
! stdout .
cmp stderr stderr.txt
@@ -136,7 +136,7 @@ level=info msg=" alertsPerGroup: 5"
level=info msg=" collapseGroups: collapsedOnMobile"
level=info msg=" multiGridLabel: \"\""
level=info msg=" multiGridSortReverse: false"
level=error msg="Execution failed" error="failed to create Alertmanager 'failed' with URI 'http://127.0.0.1': cannot use proxy and readonly mode at the same time"
level=fatal msg="Execution failed" error="failed to create Alertmanager 'failed' with URI 'http://127.0.0.1': cannot use proxy and readonly mode at the same time"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,5 +1,5 @@
# Check if proxy mode is set correctly
karma.bin-should-work --log.config=true --config.file=karma.yaml --check-config
exec karma --log.config=true --config.file=karma.yaml --check-config
! stdout .
cmp stderr stderr.txt

View File

@@ -1,5 +1,5 @@
# Check if readonly mode is set correctly
karma.bin-should-work --log.config=true --config.file=karma.yaml --check-config
exec karma --log.config=true --config.file=karma.yaml --check-config
! stdout .
cmp stderr stderr.txt

View File

@@ -1,7 +1,7 @@
# Works in simple mode when single --alertmanager.uri flag is passed
exec bash -x ./test.sh &
karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7069 --listen.address=127.0.0.1 --listen.port=8069
exec karma --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7069 --listen.address=127.0.0.1 --listen.port=8069
! stdout .
cmp stderr stderr.txt
wait

View File

@@ -1,5 +1,5 @@
# Validates that case sensitive keys are read correctly from config file
karma.bin-should-work --log.config=true --config.file=karma.yaml --check-config
exec karma --log.config=true --config.file=karma.yaml --check-config
! stdout .
cmp stderr stderr.txt

View File

@@ -1,4 +1,4 @@
# Prints version when --version is passed
karma.bin-should-work --version
exec karma --version
stdout 'dev\n'
! stderr .

View File

@@ -1,6 +1,6 @@
# Fails is we cannot write a PID file
karma.bin-should-fail --pid-file=/foo/bar/karma.pid --alertmanager.uri=http://127.0.0.1:7072
! exec karma --pid-file=/foo/bar/karma.pid --alertmanager.uri=http://127.0.0.1:7072
! stdout .
cmp stderr stderr.txt
@@ -8,4 +8,4 @@ cmp stderr stderr.txt
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=http://127.0.0.1:7072
level=info msg="Writing PID file" path=/foo/bar/karma.pid
level=error msg="Execution failed" error="failed to write a PID file: open /foo/bar/karma.pid: no such file or directory"
level=fatal msg="Execution failed" error="failed to write a PID file: open /foo/bar/karma.pid: no such file or directory"

View File

@@ -1,7 +1,7 @@
# Fails is we cannot remove a PID file
exec bash -x ./test.sh &
karma.bin-should-fail --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7073 --listen.address=127.0.0.1 --listen.port=8073
! exec karma --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7073 --listen.address=127.0.0.1 --listen.port=8073
! stdout .
cmp stderr stderr.txt
wait
@@ -25,7 +25,7 @@ level=info msg="Starting HTTP server" address=127.0.0.1:8073
level=info msg="Shutting down HTTP server" signal=terminated
level=info msg="HTTP server shut down"
level=info msg="Removing PID file" path=karma.pid
level=error msg="Execution failed" error="failed to remove PID file: remove karma.pid: no such file or directory"
level=fatal msg="Execution failed" error="failed to remove PID file: remove karma.pid: no such file or directory"
-- test.sh --
while [ ! -f karma.pid ]; do sleep 1 ; done
sleep 1

View File

@@ -1,5 +1,5 @@
# Raises an error if --authorization.acl points to a file that contains unknown keys
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
@@ -8,7 +8,7 @@ level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=info msg="Configured Alertmanager source" cluster=default name=default proxy=false readonly=false uri=https://127.0.0.1:9093
level=info msg="Reading silence ACL config file" path=acl.yaml
level=error msg="Execution failed" error="failed to parse silence ACL configuration file \"acl.yaml\": yaml: unmarshal errors:\n line 6: field nameFoo not found in type config.SilenceFilters"
level=fatal msg="Execution failed" error="failed to parse silence ACL configuration file \"acl.yaml\": yaml: unmarshal errors:\n line 6: field nameFoo not found in type config.SilenceFilters"
-- karma.yaml --
authentication:
header:

View File

@@ -1,10 +1,10 @@
# Raises an error if --config.file points to a file that contains unknown keys
karma.bin-should-fail --check-config
! exec karma --check-config
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="failed to parse configuration file \"karma.yaml\": yaml: unmarshal errors:\n line 5: field authorizationFoo not found in type config.configSchema"
level=fatal msg="Execution failed" error="failed to parse configuration file \"karma.yaml\": yaml: unmarshal errors:\n line 5: field authorizationFoo not found in type config.configSchema"
-- karma.yaml --
authentication:
header:

View File

@@ -1,7 +1,7 @@
# Basic Auth headers are passed to the UI in the API response
exec bash -x ./test.sh &
karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://foo:bar@127.0.0.1 --listen.address=127.0.0.1 --listen.port=8076
exec karma --pid-file=karma.pid --alertmanager.uri=http://foo:bar@127.0.0.1 --listen.address=127.0.0.1 --listen.port=8076
exec sleep 5
grep '"headers":{"Authorization":"Basic Zm9vOmJhcg=="}' out.txt
grep '"publicURI":"http://foo:bar@127.0.0.1"' out.txt

View File

@@ -1,6 +1,6 @@
# Fails to start when invalid port is set
karma.bin-should-fail --pid-file=karma.pid --alertmanager.uri=http://foo:bar@127.0.0.1 --listen.address=127.0.0.1 --listen.port=9999999
! exec karma --pid-file=karma.pid --alertmanager.uri=http://foo:bar@127.0.0.1 --listen.address=127.0.0.1 --listen.port=9999999
! stdout .
cmp stderr stderr.txt
@@ -19,4 +19,4 @@ level=error msg="Request failed" error="Get \"http://foo:***@127.0.0.1/metrics\"
level=error msg="Collection failed" error="Get \"http://127.0.0.1/api/v2/silences\": dial tcp 127.0.0.1:80: connect: connection refused" alertmanager=default try=2/2
level=info msg="Collection completed"
level=info msg="Done, starting HTTP server"
level=error msg="Execution failed" error="listen tcp: address 9999999: invalid port"
level=fatal msg="Execution failed" error="listen tcp: address 9999999: invalid port"

View File

@@ -1,13 +1,13 @@
# Raises an error if tls CA cert is missing
karma.bin-should-fail --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8078
! exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8078
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=error msg="Execution failed" error="failed to create HTTP transport for Alertmanager 'client-auth' with URI 'https://127.0.0.1:9093': open ca.crt: no such file or directory"
level=fatal msg="Execution failed" error="failed to create HTTP transport for Alertmanager 'client-auth' with URI 'https://127.0.0.1:9093': open ca.crt: no such file or directory"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,13 +1,13 @@
# Raises an error if tls CA cert is missing
karma.bin-should-fail --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8078
! exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8078
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=error msg="Execution failed" error="failed to create HTTP transport for Alertmanager 'client-auth' with URI 'https://127.0.0.1:9093': open client.pem: no such file or directory"
level=fatal msg="Execution failed" error="failed to create HTTP transport for Alertmanager 'client-auth' with URI 'https://127.0.0.1:9093': open client.pem: no such file or directory"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,13 +1,13 @@
# Raises an error if tls CA cert is missing
karma.bin-should-fail --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8078
! exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8078
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=error msg="Execution failed" error="failed to create HTTP transport for Alertmanager 'client-auth' with URI 'https://127.0.0.1:9093': open client.key: no such file or directory"
level=fatal msg="Execution failed" error="failed to create HTTP transport for Alertmanager 'client-auth' with URI 'https://127.0.0.1:9093': open client.key: no such file or directory"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,13 +1,13 @@
# Raises an error if tls CA cert is missing
karma.bin-should-fail --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8078
! exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8078
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=error msg="Execution failed" error="failed to create HTTP transport for Alertmanager 'client-auth' with URI 'https://127.0.0.1:9093': tls: failed to find any PEM data in certificate input"
level=fatal msg="Execution failed" error="failed to create HTTP transport for Alertmanager 'client-auth' with URI 'https://127.0.0.1:9093': tls: failed to find any PEM data in certificate input"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,13 +1,13 @@
# Raises an error if tls CA cert is missing
karma.bin-should-fail --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8078
! exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8078
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=info msg="Reading configuration file" path=karma.yaml
level=info msg="Version: dev"
level=error msg="Execution failed" error="failed to create HTTP transport for Alertmanager 'client-auth' with URI 'https://127.0.0.1:9093': tls: failed to find any PEM data in key input"
level=fatal msg="Execution failed" error="failed to create HTTP transport for Alertmanager 'client-auth' with URI 'https://127.0.0.1:9093': tls: failed to find any PEM data in key input"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,7 +1,7 @@
# GET /metrics returns same list of metrics
exec bash -x ./test.sh &
karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7083 --listen.address=127.0.0.1 --listen.port=8083
exec karma --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7083 --listen.address=127.0.0.1 --listen.port=8083
! stdout .
cmp stderr stderr.txt
cmp curl.txt metrics.txt
@@ -20,10 +20,10 @@ go_gc_duration_seconds{quantile="0.75"}
go_gc_duration_seconds{quantile="1"}
go_gc_duration_seconds_sum
go_gc_duration_seconds_count
# HELP go_gc_gogc_percent Heap size target percentage configured by the user, otherwise 100. This value is set by the GOGC environment variable, and the runtime/debug.SetGCPercent function. Sourced from /gc/gogc:percent
# HELP go_gc_gogc_percent Heap size target percentage configured by the user, otherwise 100. This value is set by the GOGC environment variable, and the runtime/debug.SetGCPercent function. Sourced from /gc/gogc:percent.
# TYPE go_gc_gogc_percent gauge
go_gc_gogc_percent
# HELP go_gc_gomemlimit_bytes Go runtime memory limit configured by the user, otherwise math.MaxInt64. This value is set by the GOMEMLIMIT environment variable, and the runtime/debug.SetMemoryLimit function. Sourced from /gc/gomemlimit:bytes
# HELP go_gc_gomemlimit_bytes Go runtime memory limit configured by the user, otherwise math.MaxInt64. This value is set by the GOMEMLIMIT environment variable, and the runtime/debug.SetMemoryLimit function. Sourced from /gc/gomemlimit:bytes.
# TYPE go_gc_gomemlimit_bytes gauge
go_gc_gomemlimit_bytes
# HELP go_goroutines Number of goroutines that currently exist.
@@ -98,7 +98,7 @@ go_memstats_stack_sys_bytes
# HELP go_memstats_sys_bytes Number of bytes obtained from system. Equals to /memory/classes/total:byte.
# TYPE go_memstats_sys_bytes gauge
go_memstats_sys_bytes
# HELP go_sched_gomaxprocs_threads The current runtime.GOMAXPROCS setting, or the number of operating system threads that can execute user-level Go code simultaneously. Sourced from /sched/gomaxprocs:threads
# HELP go_sched_gomaxprocs_threads The current runtime.GOMAXPROCS setting, or the number of operating system threads that can execute user-level Go code simultaneously. Sourced from /sched/gomaxprocs:threads.
# TYPE go_sched_gomaxprocs_threads gauge
go_sched_gomaxprocs_threads
# HELP go_threads Number of OS threads created.

View File

@@ -1,9 +1,9 @@
karma.bin-should-fail --config.file=karma.yaml
! exec karma --config.file=karma.yaml
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="valueOnly regex rule '.++++' is invalid: error parsing regexp: invalid nested repetition operator: `++`"
level=fatal msg="Execution failed" error="valueOnly regex rule '.++++' is invalid: error parsing regexp: invalid nested repetition operator: `++`"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,7 +1,7 @@
# Enables pprof endpoints when debug is enabled
exec bash -x ./test.sh &
karma.bin-should-work --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7085 --listen.address=127.0.0.1 --listen.port=8085 --debug
exec karma --pid-file=karma.pid --alertmanager.uri=http://127.0.0.1:7085 --listen.address=127.0.0.1 --listen.port=8085 --debug
! stdout .
cmp stderr stderr.txt
wait

View File

@@ -2,7 +2,7 @@
cert $WORK karma
exec bash -x ./test.sh &
karma.bin-should-work --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8087
exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8087
! stdout .
exec sleep 5
cmp http1.txt pong.txt

View File

@@ -1,7 +1,7 @@
# Fails on invalid TLS key
cert $WORK karma
karma.bin-should-work --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8088
exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8088
! stdout .
cmp stderr stderr.txt

View File

@@ -1,7 +1,7 @@
# Fails on invalid TLS cert
cert $WORK karma
karma.bin-should-work --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8089
exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8089
! stdout .
cmp stderr stderr.txt

View File

@@ -1,7 +1,7 @@
# Fails on missing TLS key
cert $WORK karma
karma.bin-should-work --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8090
exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8090
! stdout .
cmp stderr stderr.txt

View File

@@ -1,7 +1,7 @@
# Fails on missing TLS cert
cert $WORK karma
karma.bin-should-work --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8091
exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8091
! stdout .
cmp stderr stderr.txt

View File

@@ -1,11 +1,11 @@
# Fails on empty TLS key
karma.bin-should-fail --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8092
! exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8092
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="listen.tls.key must be set when listen.tls.cert is set"
level=fatal msg="Execution failed" error="listen.tls.key must be set when listen.tls.cert is set"
-- karma.yaml --
alertmanager:
servers:

View File

@@ -1,11 +1,11 @@
# Fails on empty TLS cert
karma.bin-should-fail --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8092
! exec karma --pid-file=karma.pid --config.file=karma.yaml --listen.address=127.0.0.1 --listen.port=8092
! stdout .
cmp stderr stderr.txt
-- stderr.txt --
level=error msg="Execution failed" error="listen.tls.cert must be set when listen.tls.key is set"
level=fatal msg="Execution failed" error="listen.tls.cert must be set when listen.tls.key is set"
-- karma.yaml --
alertmanager:
servers:

Some files were not shown because too many files have changed in this diff Show More