mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
fix(tests): refactor main code for more test coverage
This commit is contained in:
@@ -310,11 +310,6 @@ func mainSetup(errorHandling pflag.ErrorHandling) (*gin.Engine, error) {
|
||||
log.Infof("Parsed %d ACL rule(s)", len(silenceACLs))
|
||||
}
|
||||
|
||||
if *validateConfig {
|
||||
log.Info("Configuration is valid")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
switch config.Config.Debug {
|
||||
case true:
|
||||
gin.SetMode(gin.DebugMode)
|
||||
@@ -350,6 +345,11 @@ func mainSetup(errorHandling pflag.ErrorHandling) (*gin.Engine, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if *validateConfig {
|
||||
log.Info("Configuration is valid")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return router, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ env ANNOTATIONS_STRIP='strip1 strip2 strip3'
|
||||
env CUSTOM_CSS='/custom.css'
|
||||
env CUSTOM_JS='/custom.js'
|
||||
|
||||
env DEBUG=true
|
||||
env DEBUG=false
|
||||
|
||||
env FILTERS_DEFAULT='@receiver=by-cluster-service @state=active'
|
||||
|
||||
@@ -118,7 +118,7 @@ level=info msg=" - strip3"
|
||||
level=info msg="custom:"
|
||||
level=info msg=" css: /custom.css"
|
||||
level=info msg=" js: /custom.js"
|
||||
level=info msg="debug: true"
|
||||
level=info msg="debug: false"
|
||||
level=info msg="filters:"
|
||||
level=info msg=" default:"
|
||||
level=info msg=" - '@receiver=by-cluster-service'"
|
||||
|
||||
@@ -429,4 +429,6 @@ level=info msg="[ha1] Configured Alertmanager source at http://localhost:9093 (p
|
||||
level=info msg="[ha2] Configured Alertmanager source at http://localhost:9094 (proxied: false, readonly: true)"
|
||||
level=info msg="[local] Configured Alertmanager source at http://localhost:9095 (proxied: true, readonly: false)"
|
||||
level=info msg="[client-auth] Configured Alertmanager source at https://localhost:9096 (proxied: false, readonly: false)"
|
||||
level=info msg="[ha1] Setting up proxy endpoints"
|
||||
level=info msg="[local] Setting up proxy endpoints"
|
||||
level=info msg="Configuration is valid"
|
||||
|
||||
@@ -3,6 +3,7 @@ karma.bin-should-work --log.format=text --log.config=true --config.file=karma.ya
|
||||
! stdout .
|
||||
stderr 'msg=" proxy: true"'
|
||||
stderr 'msg="\[proxied\] Configured Alertmanager source at http://localhost \(proxied: true\, readonly: false\)"'
|
||||
stderr 'msg="\[proxied\] Setting up proxy endpoints"'
|
||||
! stderr 'level=error'
|
||||
|
||||
-- karma.yaml --
|
||||
|
||||
Reference in New Issue
Block a user