From c11cd1c9f557a4cc7870660ffbd0fd79d9225d66 Mon Sep 17 00:00:00 2001 From: Gabriel Cocenza Date: Wed, 18 Dec 2024 14:50:05 -0300 Subject: [PATCH] Both ci.yaml and test_prometheus_rules.yaml were using same lock (#524) Those files had the same configuration for concurrency which blocked the CI with the message: Canceling since a deadlock for concurrency group 'Release to latest/edge-refs/heads/2/edge' was detected between 'ci-tests' and 'ci-tests.promtool' This PR adds completly the promtool into the ci.yaml file --- .github/workflows/ci.yaml | 17 +++++++++++- .github/workflows/test_prometheus_rules.yaml | 28 -------------------- 2 files changed, 16 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/test_prometheus_rules.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9ab29bde0..1e1862ad7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,7 +33,22 @@ jobs: run: tox run -e unit promtool: - uses: ./.github/workflows/test_prometheus_rules.yaml + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + # prometheus snap includes promtool + - name: Install prometheus snap + run: sudo snap install prometheus + + - name: Check validity of prometheus alert rules + run: | + promtool check rules src/alert_rules/prometheus/*.yaml + + - name: Run unit tests for prometheus alert rules + run: | + promtool test rules tests/unit/test_alert_rules/*.yaml terraform-test: name: Terraform - Lint and Simple Deployment diff --git a/.github/workflows/test_prometheus_rules.yaml b/.github/workflows/test_prometheus_rules.yaml deleted file mode 100644 index 2af5a7c2e..000000000 --- a/.github/workflows/test_prometheus_rules.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Test prometheus rules - -on: - workflow_call: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} - cancel-in-progress: true - -jobs: - promtool: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - # prometheus snap includes promtool - - name: Install prometheus snap - run: sudo snap install prometheus - - - name: Check validity of prometheus alert rules - run: | - promtool check rules src/alert_rules/prometheus/*.yaml - - - name: Run unit tests for prometheus alert rules - run: | - promtool test rules tests/unit/test_alert_rules/*.yaml