System configuration for OpenStack Infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.3KB

  1. [tox]
  2. minversion = 1.6
  3. envlist = linters
  4. skipsdist = True
  5. [testenv]
  6. basepython = python3
  7. usedevelop = True
  8. install_command = pip install {opts} {packages}
  9. deps = -r{toxinidir}/test-requirements.txt
  10. [testenv:linters]
  11. whitelist_externals = bash
  12. commands =
  13. flake8
  14. {toxinidir}/tools/run-bashate.sh
  15. python3 {toxinidir}/tools/sorted_modules_env.py {toxinidir}/modules.env
  16. python3 {toxinidir}/tools/irc_checks.py
  17. python3 {toxinidir}/tools/check_clouds_yaml.py
  18. # The following command validates that inventory/openstack.yaml
  19. # parses, but doesn't do anything.
  20. bash -c "ANSIBLE_INVENTORY_PLUGINS=./playbooks/roles/install-ansible/files/inventory_plugins ansible -i ./inventory/openstack.yaml not_a_host -a 'true'"
  21. python3 -m unittest playbooks/roles/install-ansible/files/inventory_plugins/test_yamlgroup.py
  22. # Ansible Lint Check
  23. #
  24. # ANSIBLE0010: Package installs should not use latest
  25. # We often deploy latest pip packages
  26. #
  27. # 204: Lines < 160
  28. # Things like keys, script lines, etc exceed this. We have good
  29. # taste and only use long lines where appropriate.
  30. #
  31. # 206: {{var}} should have spaces {{ var }}
  32. # This rule seems sane, but it appears there's no way to convince
  33. # ansible-lint perfectly good things that are *not* ansible (like
  34. # exim configs) in YAML shouldn't have to follow this rule. See
  35. # https://github.com/ansible/ansible-lint/issues/534; might be able
  36. # to turn on if fixed.
  37. #
  38. # 306: shells with pipes should use pipefail
  39. # This requires running the shell as /bin/bash. There is a small
  40. # possibility to hide errors, but we can rely on
  41. # developers to decide when to explicitly check for failures.
  42. bash -c "find roles playbooks -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
  43. ansible-lint -x ANSIBLE0004 -x ANSIBLE0006 -x ANSIBLE0007 -x ANSIBLE0010 \
  44. -x ANSIBLE0011 -x ANSIBLE0012 -x ANSIBLE0013 -x ANSIBLE0015 \
  45. -x 204 -x 206 -x 304 -x 306"
  46. [testenv:venv]
  47. commands = {posargs}
  48. [testenv:docs]
  49. deps = -r{toxinidir}/doc/requirements.txt
  50. commands = sphinx-build -W -E -b html doc/source doc/build/html
  51. [testenv:testinfra]
  52. commands = py.test --junit-xml junit.xml --connection=ansible --ansible-inventory=/etc/ansible/hosts/inventory.yaml -v testinfra {posargs}
  53. [flake8]
  54. show-source = True
  55. exclude = .tox,.eggs
  56. ignore = E125,H
  57. select = H231