-
Notifications
You must be signed in to change notification settings - Fork 5.9k
/
tox.ini
58 lines (53 loc) · 1.36 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
[tox]
envlist = grafonnet-{check,fix},lint,promql-query-test,jsonnet-lint,tests-alerts
skipsdist = true
[testenv:grafonnet-{check,fix}]
basepython = python3
whitelist_externals =
jsonnet
jb
sh
description =
check: Ensure that auto-generated grafana dashboard files matches the current version
fix: generate dashboard json files from jsonnet file with latest changes
deps =
-rrequirements-grafonnet.txt
commands =
check: sh test-jsonnet.sh
fix: jsonnet -J vendor -m output/dashboards dashboards.jsonnet
jsonnet -J vendor -S alerts.jsonnet -o output/alerts/ceph_default_alerts.yml
[testenv:jsonnet-lint]
whitelist_externals =
sh
find
jsonnetfmt
description =
Run jsonnet linter
commands =
./lint-jsonnet.sh --test
[testenv:lint]
description =
Run linters
deps =
-rrequirements-lint.txt
setenv =
commands =
pylint --rcfile=.pylintrc tests_dashboards
mypy tests_dashboards
isort tests_dashboards
[testenv:promql-query-test]
description =
Run promtool unit testing on grafana queries.
deps =
-rtests/requirements.txt
depends = grafonnet-check
setenv =
commands =
behave tests_dashboards/features
[testenv:tests_alerts]
deps =
-rrequirements-alerts.txt
pytest
commands =
pytest -rA tests_alerts/test_syntax.py tests_alerts/test_unittests.py
./tests_alerts/validate_rules.py