From 181616fcf390260a46cc19dc34183be2e1df1f75 Mon Sep 17 00:00:00 2001 From: biswassri Date: Thu, 14 Nov 2024 10:06:42 -0500 Subject: [PATCH] Update to github CI --- .github/workflows/prometheus-unit-tests.yaml | 10 +--------- .../prometheus_unit_tests/scripts/check_alert_tests.sh | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/prometheus-unit-tests.yaml b/.github/workflows/prometheus-unit-tests.yaml index 5d299746964..e982e9c7439 100644 --- a/.github/workflows/prometheus-unit-tests.yaml +++ b/.github/workflows/prometheus-unit-tests.yaml @@ -9,16 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version-file: go.mod - - name: Install Promtool run: | - go install github.com/prometheus/prometheus/cmd/promtool@latest - export PATH=$PATH:$(go env GOPATH)/bin - promtool --version - + sudo apt-get update && sudo apt-get install -y prometheus - name: Run prometheus-unit-tests run : make test-alerts diff --git a/tests/prometheus_unit_tests/scripts/check_alert_tests.sh b/tests/prometheus_unit_tests/scripts/check_alert_tests.sh index 552e4a14d9e..291e6f87623 100755 --- a/tests/prometheus_unit_tests/scripts/check_alert_tests.sh +++ b/tests/prometheus_unit_tests/scripts/check_alert_tests.sh @@ -10,7 +10,7 @@ while IFS= read -r ALERT; do done < <(yq -N e '.data[] | from_yaml | .groups[].rules[] - | select(.alert != "DeadManSnitch" and .labels.severity == strenv(ALERT_SEVERITY)) + | select(.alert != "DeadManSnitch" and .labels.severity == "critical") | .alert' "${PROMETHEUS_CONFIG_YAML}") # Collect all alerts from the unit test files