mirror of
https://github.com/ceph/ceph
synced 2024-12-21 19:02:10 +00:00
86d040e2fc
Made following changes to files, Makefile: Add needed 'tox' target to generate alert files Now we can do 'make generate' OR 'make test' to generate all the yaml files (and run tests) alerts.jsonnet: Added an 'import' line to include 'config.libsonnet' file. This fix the errors in generating 'prometheus_alerts.yml' file tox.ini: Added all the existing 'alerts-' targets to 'envlist' Added the missing 'alerts-test' target to 'testenv' Added 'jsonnet' to 'allowlist_externals', which prevents a deprecation waring A minor spell correction lint-jsonnet.sh: Made errors more verbose. Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
78 lines
1.9 KiB
INI
78 lines
1.9 KiB
INI
[tox]
|
|
envlist =
|
|
lint,
|
|
jsonnet-{check,lint,fix},
|
|
jsonnet-bundler-{install,update},
|
|
promql-query-{test,lint},
|
|
alerts-{fix,check,lint,test}
|
|
|
|
skipsdist = true
|
|
|
|
[testenv:jsonnet-bundler-{install,update}]
|
|
allowlist_externals =
|
|
jb
|
|
description =
|
|
install: Install the jsonnet dependencies
|
|
update: Update the jsonnet dependencies
|
|
commands =
|
|
install: jb install
|
|
update: jb update
|
|
|
|
[testenv:jsonnet-{check,fix,lint}]
|
|
basepython = python3
|
|
allowlist_externals =
|
|
find
|
|
jb
|
|
jsonnet
|
|
jsonnetfmt
|
|
sh
|
|
description =
|
|
check: Ensure that auto-generated files matches the current version
|
|
fix: Update generated files from jsonnet file with latest changes
|
|
lint: Test if jsonnet files are linted (without any update)
|
|
deps =
|
|
-rrequirements-grafonnet.txt
|
|
depends = jsonnet-bundler-install
|
|
commands =
|
|
check: sh test-jsonnet.sh
|
|
lint: ./lint-jsonnet.sh --test
|
|
fix: jsonnet -J vendor -m dashboards_out dashboards.jsonnet
|
|
|
|
[testenv:lint]
|
|
description =
|
|
Run python linters
|
|
deps =
|
|
-rrequirements-lint.txt
|
|
setenv =
|
|
commands =
|
|
pylint --rcfile=.pylintrc tests_dashboards
|
|
mypy tests_dashboards
|
|
isort tests_dashboards
|
|
|
|
[testenv:promql-query-test]
|
|
description =
|
|
lint: Run promtool check on grafana queries
|
|
test: Run promtool unit testing on grafana queries.
|
|
deps =
|
|
-rrequirements-lint.txt
|
|
depends = grafonnet-check
|
|
setenv =
|
|
allowlist_externals =
|
|
promtool
|
|
commands =
|
|
behave tests_dashboards/features
|
|
|
|
[testenv:alerts-{fix,check,lint,test}]
|
|
deps =
|
|
-rrequirements-alerts.txt
|
|
pytest
|
|
depends = grafonnet-check
|
|
allowlist_externals =
|
|
promtool
|
|
jsonnet
|
|
commands =
|
|
fix: jsonnet -J vendor -S alerts.jsonnet -o prometheus_alerts.yml
|
|
lint: promtool check rules prometheus_alerts.yml
|
|
test: pytest -rA tests_alerts/test_syntax.py tests_alerts/test_unittests.py
|
|
python3 ./tests_alerts/validate_rules.py
|