diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /monitoring/ceph-mixin/tox.ini | |
parent | Initial commit. (diff) | |
download | ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | monitoring/ceph-mixin/tox.ini | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/monitoring/ceph-mixin/tox.ini b/monitoring/ceph-mixin/tox.ini new file mode 100644 index 000000000..743f4bca6 --- /dev/null +++ b/monitoring/ceph-mixin/tox.ini @@ -0,0 +1,76 @@ +[tox] +envlist = + lint, + jsonnet-{check,lint,fix}, + jsonnet-bundler-{install,update}, + promql-query-{test,lint}, + alerts-check +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 + jsonnetfm + 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 = + python -m doctest tests_dashboards/util.py + behave tests_dashboards/features + +[testenv:alerts-{fix,check,lint}] +deps = + -rrequirements-alerts.txt + pytest +depends = grafonnet-check +allowlist_externals = + promtool +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 |