# Print out and compare logged config set via config file that includes invalid values
! 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: decoding failed due to the following error(s):\n\n'Alertmanager.Interval' time: invalid duration\n'Alertmanager.Servers[0].Timeout' time: invalid duration\n'Alertmanager.Servers[0].Proxy' cannot parse value as 'bool': strconv.ParseBool: invalid syntax\n'Alertmanager.Servers[2].Timeout' time: invalid duration\n'Alertmanager.Servers[2].Headers[0]' expected type 'map[string]string', got unconvertible type 'string'\n'alertAcknowledgement.Enabled' cannot parse value as 'bool': strconv.ParseBool: invalid syntax\n'Annotations.Default.Hidden' cannot parse value as 'bool': strconv.ParseBool: invalid syntax\n'UI.Refresh' time: unknown unit\n'UI.hideFiltersWhenIdle' cannot parse value as 'bool': strconv.ParseBool: invalid syntax\n'UI.colorTitlebar' cannot parse value as 'bool': strconv.ParseBool: invalid syntax\n'UI.animations' cannot parse value as 'bool': strconv.ParseBool: invalid syntax\n'UI.minimalGroupWidth' cannot parse value as 'int': strconv.ParseInt: invalid syntax\n'UI.alertsPerGroup' cannot parse value as 'int': strconv.ParseInt: invalid syntax"
-- karma.yaml --
alertmanager:
  interval: jjs88
  servers:
    - name: ha1
      uri: "http://127.0.0.1:9093"
      timeout: bbb
      proxy: YEs
      cors:
        credentials: foo
    - name: ha2
      uri: "http://127.0.0.1:9094"
      timeout: 11
      readonly: 1
    - name: local
      uri: http://127.0.0.1:9095
      timeout: z
      proxy: true
      readonly: 0
      headers:
        - X-Auth-Test=some-token-or-other-string
    - name: client-auth
      uri: https://127.0.0.1:9096
      timeout: 10s
      tls:
        ca: ca.pem
        cert: cert.pem
        key: key.pem
alertAcknowledgement:
  enabled: zzz
  duration: 7m0s
  author: karma
  comment: comment
annotations:
  default:
    hidden: z
  hidden: {}
  visible:
    - visible
filters:
  default: []
karma:
  name: karma-demo
log:
  level: 123
ui:
  refresh: 10sm
  hideFiltersWhenIdle: z
  colorTitlebar: yum
  theme: x
  animations: 1a
  minimalGroupWidth: abc4
  alertsPerGroup: 5a
  collapseGroups: collapsedOanMobile
