[tox]
envlist = py3,flake8,cover
isolated_build = true

[testenv]
extras =
  test
sitepackages = True
commands =
    # NOTE: you can run any command line tool here - not just tests
    stestr run {posargs}
allowlist_externals =
  bash
  find
  rm
  env
  tar
setenv =
  VIRTUAL_ENV={envdir}
  LANGUAGE=en_US
  LC_ALL=en_US.utf-8
  OS_STDOUT_CAPTURE=1
  OS_STDERR_CAPTURE=1
  OS_TEST_TIMEOUT=160
  PYTHONDONTWRITEBYTECODE=1

[testenv:flake8]
description =
  Run style checks on the changes made since HEAD~.
envdir = {toxworkdir}/shared
commands =
  bash tools/flake8wrap.sh -HEAD

[testenv:py3]
description =
  Run python3 unit tests

[testenv:cover]
description =
  Generate a coverage report in cover/.
setenv =
  PYTHON=coverage run --source kerbside --parallel-mode
commands =
  coverage erase
  stestr run {posargs}
  coverage combine
  coverage html -d cover
  coverage report

[testenv:bindep]
description =
  Check for missing OS package dependencies using bindep.
skip_install = true
deps =
  bindep
commands =
  bindep test
