Skip to content

Commit

Permalink
feat: Add promtool testing in Makefile (#132)
Browse files Browse the repository at this point in the history
* Fix file name used in lsi sas alert rule test.
* Add promtool job in GH check workflow.
* Ensure func depends on lint-unit and promtool.
  • Loading branch information
dashmage authored Dec 12, 2023
1 parent 47a79eb commit a81547e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,25 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
tox-version: "<4"

promtool:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
# prometheus snap comes pre-packaged with promtool
- name: Install prometheus snap
run: sudo snap install prometheus
- name: Check validity of prometheus alert rules
run: |
promtool check rules src/prometheus_alert_rules/*.yaml
- name: Run unit tests for prometheus alert rules
run: |
promtool test rules tests/unit/test_alert_rules/*.yaml
func:
uses: canonical/bootstack-actions/.github/workflows/func.yaml@v2
needs: lint-unit
needs: [lint-unit, promtool]
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_alert_rules/test_lsi_sas.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rule_files:
- ../../../src/prometheus_alert_rules/lsi_sas_2.yaml
- ../../../src/prometheus_alert_rules/lsi_sas.yaml

evaluation_interval: 1m

Expand Down

0 comments on commit a81547e

Please sign in to comment.