rule_files:
  - rules.yaml

tests:
  - interval: 1m
    name: "Failing test"
    input_series:
      - series: test
        values: "0"

    metricsql_expr_test:
      - expr: test
        eval_time: 0m
        exp_samples:
          - value: 0
            labels: test

    # will failed cause there is no "Test" group and rule defined
    alert_rule_test:
      - eval_time: 0m
        groupname: Test
        alertname: Test
        exp_alerts:
          - exp_labels: {}

  - interval: 1m
    name: Failing alert test
    input_series:
      - series: 'up{job="test"}'
        values: 0x10

    alert_rule_test:
      # will failed cause rule is firing
      - eval_time: 5m
        groupname: group1
        alertname: InstanceDown
        exp_alerts: []

  - interval: 1m
    name: Failing alert test with missing groupname
    input_series:
      - series: 'up{job="test"}'
        values: 0x10

    alert_rule_test:
      # will failed cause missing groupname
      - eval_time: 5m
        alertname: AlwaysFiring
        exp_alerts: []