OpenStack in a snap!
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.

112 lines
2.7KB

  1. [tox]
  2. envlist = lint, unit, multipass
  3. skipsdist = True
  4. [testenv]
  5. basepython=python3
  6. install_command = pip install {opts} {packages}
  7. deps = -r{toxinidir}/test-requirements.txt
  8. setenv =
  9. PATH = /snap/bin:{env:PATH}
  10. passenv = HOME TERM DISTRO
  11. whitelist_externals =
  12. sudo
  13. /snap/bin/snapcraft
  14. commands =
  15. {toxinidir}/tools/basic_setup.sh
  16. flake8 {toxinidir}/tests/
  17. {toxinidir}/tests/test_basic.py
  18. [testenv:snap]
  19. # Testing environment for the gerrit gate. Named 'snap' to conform to
  20. # the requirements of the snap friendly job that we inherit from in
  21. # .zuul.yaml.
  22. commands =
  23. {toxinidir}/tools/lxd_build.sh
  24. flake8 {toxinidir}/tests/
  25. # Specify tests in sequence, as they can't run in parallel if not
  26. # using multipass.
  27. {toxinidir}/tests/test_basic.py
  28. [testenv:multipass]
  29. # Default testing environment for a human operated machine. Builds the
  30. # snap in a multipass instance, then runs tests in a separate multipass
  31. # instance. This makes the fewest changes to your personal computer,
  32. # but is heavier on system requirements. For a more lightweight test,
  33. # use the "snap" environment above. Beware that you will wind up with
  34. # a lot of things installed, including potentially the locally built
  35. # version of MicroStack!
  36. setenv =
  37. MULTIPASS=true
  38. commands =
  39. {toxinidir}/tools/multipass_build.sh
  40. flake8 {toxinidir}/tests/
  41. {toxinidir}/tests/test_basic.py
  42. [testenv:basic]
  43. # Run basic tests, with default distro.
  44. setenv =
  45. MULTIPASS=true
  46. [testenv:refresh]
  47. # Verify that we can refresh MicroStack
  48. setenv =
  49. MULTIPASS=true
  50. commands =
  51. {toxinidir}/tools/basic_setup.sh
  52. flake8 {toxinidir}/tests/
  53. {toxinidir}/tests/test_refresh.py
  54. [testenv:xenial]
  55. # Run basic tests, under xenial.
  56. setenv =
  57. MULTIPASS=true
  58. DISTRO=xenial
  59. [testenv:disco]
  60. # Run basic tests, under disco.
  61. setenv =
  62. MULTIPASS=true
  63. DISTRO=disco
  64. [testenv:eoan]
  65. # Run basic tests, under eoan.
  66. setenv =
  67. MULTIPASS=true
  68. DISTRO=eoan
  69. [testenv:cluster]
  70. # Test out clustering!
  71. # Requires multipass.
  72. setenv =
  73. MULTIPASS=true
  74. commands =
  75. {toxinidir}/tools/basic_setup.sh
  76. flake8 {toxinidir}/tests/
  77. {toxinidir}/tests/test_cluster.py
  78. [testenv:build]
  79. # Just build the snap, using multipass.
  80. setenv =
  81. MULTIPASS=true
  82. commands =
  83. {toxinidir}/tools/multipass_build.sh
  84. [testenv:lint]
  85. commands =
  86. flake8 {toxinidir}/tests/
  87. flake8 {toxinidir}/tools/
  88. flake8 {toxinidir}/tools/init/init/
  89. flake8 {toxinidir}/tools/launch/launch/
  90. flake8 {toxinidir}/tools/cluster/cluster/
  91. [testenv:unit]
  92. deps = -r{toxinidir}/tools/init/test-requirements.txt
  93. -r{toxinidir}/tools/init/requirements.txt
  94. commands =
  95. stestr run --top-dir=./tools/init/ --test-path=./tools/init/tests/ {posargs}