frenzyfriday 939ca8ac23 Adding script to convert queries to er format
1. The source is src/data/queries.yml. This is the human readable file updated by user.
2. ^ this is converted to files which ER can understand by er_converter.py
3. If there is a bug url in the query entry the corresponding ER file is named <bug_id>.yaml - else the file is named after the query id and shows up as "private bug" in ER dashboard.
4. As a test the playbook er.yml checks if all query files generated can be parsed by ER.
5. Added docstrings for er and sova converters and removed ER specific comments from sova converter.

Depends-On: https://review.opendev.org/c/openstack/tripleo-ci-health-queries/+/780282/

Change-Id: Iea8e6a37b80a95b28ad6e09d041802b7e660d76b
2021-04-22 12:25:14 +01:00

65 lines
1.6 KiB
INI

[tox]
minversion = 3.16.1
# linters is run last because it may catch if 'py' updates tracked files
envlist = py,linters
isolated_build = true
requires =
setuptools >= 41.4.0
pip >= 19.3.0
tox-bindep
# tox-extra ensures tox fails if there are untacked git or repo is dirty
tox-extra
skip_missing_interpreters = True
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
usedevelop = false
[testenv]
deps =
-r requirements.txt
commands =
python3 src/model.py
bash -c "cat src/data/queries.yml | yq | jsonschema -i /dev/stdin output/queries-schema.json"
python3 src/sova-converter.py
ansible-galaxy collection install -r requirements.yml
ansible-playbook playbooks/sova.yml
python3 src/er-converter.py
ansible-playbook playbooks/er.yml
passenv =
CURL_CA_BUNDLE # https proxies, https://github.com/tox-dev/tox/issues/1437
FORCE_COLOR
HOME
NO_COLOR
PYTEST_* # allows developer to define their own preferences
PY_COLORS
REQUESTS_CA_BUNDLE # https proxies
TERM
SSL_CERT_FILE # https proxies
# recreate = True
setenv =
PIP_DISABLE_PIP_VERSION_CHECK = 1
PRE_COMMIT_COLOR = always
ANSIBLE_NOCOWS = 1
skip_install = true
allowlist_externals =
bash
cat
[testenv:deps]
description = Update dependency lock files
deps =
pip-tools >= 6.1.0
commands =
pip-compile -o requirements.txt requirements.in
[testenv:linters]
description = Run all linters
basepython = python3
deps =
pre-commit>=2.6.0
skip_install = true
commands =
{envpython} -m pre_commit run {posargs:--all-files --hook-stage manual -v}
passenv =
{[testenv]passenv}
PRE_COMMIT_HOME