- project:
    queue: telemetry
    templates:
      - openstack-python3-jobs
      - publish-openstack-docs-pti
      - release-notes-jobs-python3
      - check-requirements
    check:
      jobs:
        - aodh-tempest-plugin-mysql
        - aodh-tempest-plugin-mysql-ubuntu-jammy
        - aodh-tempest-plugin-postgresql
        - telemetry-dsvm-integration:
            irrelevant-files: &aodh-irrelevant-files
              - ^(test-|)requirements.txt$
              - ^setup.cfg$
              - ^doc/.*$
              - ^.*\.rst$
              - ^releasenotes/.*$
              - ^aodh/tests/.*$
              - ^aodh/locale/.*$
              - ^tools/.*$
              - ^tox.ini$
            vars:
              devstack_local_conf:
                test-config:
                  $TEMPEST_CONFIG:
                    telemetry_services:
                      metric_backends: gnocchi
        - telemetry-dsvm-integration-ipv6-only:
            irrelevant-files: *aodh-irrelevant-files
            vars:
              devstack_local_conf:
                test-config:
                  $TEMPEST_CONFIG:
                    telemetry_services:
                      metric_backends: gnocchi
        - telemetry-dsvm-integration-centos-9s:
            irrelevant-files: *aodh-irrelevant-files
            vars:
              devstack_local_conf:
                test-config:
                  $TEMPEST_CONFIG:
                    telemetry_services:
                      metric_backends: gnocchi
        - telemetry-dsvm-integration-centos-9s-fips:
            irrelevant-files: *aodh-irrelevant-files
            vars:
              devstack_local_conf:
                test-config:
                  $TEMPEST_CONFIG:
                    telemetry_services:
                      metric_backends: gnocchi
    gate:
      jobs:
        - aodh-tempest-plugin-mysql
        - aodh-tempest-plugin-mysql-ubuntu-jammy
        - aodh-tempest-plugin-postgresql
        - telemetry-dsvm-integration:
            irrelevant-files: *aodh-irrelevant-files
            vars:
              devstack_local_conf:
                test-config:
                  $TEMPEST_CONFIG:
                    telemetry_services:
                      metric_backends: gnocchi, prometheus
                    service_available:
                      gnocchi: True
                      sg-core: True
        - telemetry-dsvm-integration-ipv6-only:
            irrelevant-files: *aodh-irrelevant-files
            vars:
              devstack_local_conf:
                test-config:
                  $TEMPEST_CONFIG:
                    telemetry_services:
                      metric_backends: gnocchi
        - telemetry-dsvm-integration-centos-9s:
            irrelevant-files: *aodh-irrelevant-files
            vars:
              devstack_local_conf:
                test-config:
                  $TEMPEST_CONFIG:
                    telemetry_services:
                      metric_backends: gnocchi
        - telemetry-dsvm-integration-centos-9s-fips:
            irrelevant-files: *aodh-irrelevant-files
            vars:
              devstack_local_conf:
                test-config:
                  $TEMPEST_CONFIG:
                    telemetry_services:
                      metric_backends: gnocchi

- job:
    name: aodh-tempest-plugin-postgresql
    parent: telemetry-tempest-base
    irrelevant-files: *aodh-irrelevant-files
    voting: false
    vars:
      devstack_services:
        postgresql: true
        mysql: false
      devstack_localrc:
        DATABASE_TYPE: postgresql
        AODH_BACKEND: postgresql
        USE_PYTHON3: True
      devstack_local_conf:
        test-config:
          $TEMPEST_CONFIG:
            telemetry_services:
              metric_backends: gnocchi
              alarm_backend: postgresql
            service_available:
              gnocchi: True
              sg-core: False
      tempest_test_regex: telemetry_tempest_plugin.aodh

- job:
    name: aodh-tempest-plugin-mysql
    parent: telemetry-tempest-base
    irrelevant-files: *aodh-irrelevant-files
    vars:
      devstack_localrc:
        AODH_BACKEND: "mysql"
        USE_PYTHON3: True
      devstack_local_conf:
        test-config:
          $TEMPEST_CONFIG:
            telemetry_services:
              metric_backends: gnocchi
              alarm_backend: mysql
            service_available:
              gnocchi: True
              sg-core: False
      tempest_test_regex: telemetry_tempest_plugin.aodh

# TODO(gmann): As per the 2025.1 testing runtime, we need to run at least
# one job on jammy. This job can be removed in the next cycle(2025.2)
- job:
    name: aodh-tempest-plugin-mysql-ubuntu-jammy
    parent: aodh-tempest-plugin-mysql
    nodeset: openstack-single-node-jammy
