Agent for Monasca
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.

tox.ini 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. [tox]
  2. envlist = py27,py36,pep8,cover
  3. minversion = 2.5
  4. skipsdist = True
  5. [testenv]
  6. usedevelop = True
  7. setenv =
  8. VIRTUAL_ENV={envdir}
  9. DISCOVER_DIRECTORY=tests
  10. passenv = *_proxy
  11. *_PROXY
  12. deps =
  13. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  14. -r{toxinidir}/test-requirements.txt
  15. -r{toxinidir}/requirements.txt
  16. whitelist_externals = bash
  17. find
  18. rm
  19. install_command = pip install {opts} {packages}
  20. commands =
  21. find . -type f -name "*.pyc" -delete
  22. rm -Rf .testrepository/times.dbm
  23. [testenv:py27]
  24. basepython = python2.7
  25. commands =
  26. {[testenv]commands}
  27. stestr run {posargs}
  28. [testenv:cover]
  29. basepython = python3
  30. commands =
  31. {[testenv]commands}
  32. coverage erase
  33. python setup.py test --coverage --testr-args='{posargs}' --coverage-package-name=monasca_agent,monasca_setup
  34. coverage report
  35. [testenv:bandit]
  36. basepython = python3
  37. commands =
  38. # B101 - asserts used on purpose
  39. # Following rules should be fixed in future
  40. # B602[ subprocess_popen_with_shell_equals_true ] - removed when fixed
  41. # B603[ subprocess_without_shell_equals_true ] - removed when fixed
  42. # B301[ pickle ] - removed when fixed
  43. # B303[ insecure MD5 usage ] - removed when fixed
  44. # B311[ random ] - removed when fixed
  45. # B403[ import_pickle ] - removed when fixed
  46. # B404[ import_subprocess ] - removed when fixed
  47. # B405[ import_xml_etree] - removed when fixed
  48. # B310[ urllib_urlopen ] - removed when fixed
  49. # B320[ xml_bad_tree ] - removed when fixed
  50. # B410[ import_lxml ] - removed when fixed
  51. # B411[ import_xmlrpclib ] - removed when fixed
  52. # B605[ start_process_with_a_shell ] - removed when fixed
  53. # B607[ start_process_with_partial_path ] - removed when fixed
  54. # B608[ hardcoded_sql_expressions ] - removed when fixed
  55. # B501[ request_with_no_cert_validation ] - removed when fixed
  56. # B504[ ssl_with_no_version ] - removed when fixed
  57. bandit -r monasca_agent -n5 -s B101,B602,B603,B301,B303,B311,B403,B404,B405,B310,B320,B410,B411,B501,B504,B605,B607,B608 -x {toxinidir}/tests
  58. [testenv:flake8]
  59. basepython = python3
  60. commands =
  61. flake8 monasca_agent
  62. flake8 monasca_setup
  63. flake8 tests
  64. [testenv:pep8]
  65. basepython = python3
  66. commands =
  67. {[testenv:flake8]commands}
  68. {[testenv:bandit]commands}
  69. [testenv:venv]
  70. basepython = python3
  71. commands = {posargs}
  72. [testenv:bindep]
  73. # Do not install any requirements. We want this to be fast and work even if
  74. # system dependencies are missing, since it's used to tell you what system
  75. # dependencies are missing! This also means that bindep must be installed
  76. # separately, outside of the requirements files.
  77. basepython = python3
  78. deps = bindep
  79. commands = bindep test
  80. [flake8]
  81. max-line-length = 100
  82. max-complexity = 30
  83. # TODO: ignored checks should be enabled in the future
  84. # H405 multi line docstring summary not separated with an empty line
  85. ignore = H405
  86. show-source = True
  87. exclude=.venv,.git,.tox,dist,*egg,build,tests,tests_to_fix
  88. [hacking]
  89. local-check-factory = monasca_agent.hacking.checks.factory