mirror of
https://github.com/ceph/ceph
synced 2024-12-22 19:34:30 +00:00
34e2e33870
as allowlist_externals was introduced in
tox v4.0. see
5e33fda1a4
, but
this option was backported to 3.18 as an alias of whitelist_externals, so we don't need
to specify the minversion to 4.0 in this change.
as we started using tox 4.0 and up (v4.0.2 in specific). tox complains
and fails like:
alerts-lint: failed with promtool is not allowed, use allowlist_externals to allow it
alerts-lint: FAIL code 1 (9.25 seconds)
see https://tox.wiki/en/latest/faq.html#tox-4-removed-tox-ini-keys
and https://tox.wiki/en/latest/config.html#allowlist_externals
it'd be nice to use a more inclusive language also. so, in this change,
s/whitelist_externals/allowlist_externals/ in all tox.ini in this
project.
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
76 lines
1.8 KiB
INI
76 lines
1.8 KiB
INI
[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 =
|
|
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
|