# Print out and compare logged config set via config file that includes invalid values
karma.bin-should-fail --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\""
-- 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
