tox.ini 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Tox (http://tox.testrun.org/) is a tool for running tests
  2. # in multiple virtualenvs. This configuration file will run the
  3. # test suite on all supported python versions and providers.
  4. # To use it, "pip install tox" and then run "tox" from this directory.
  5. # You will have to set all required environment variables (below) before
  6. # running the tests.
  7. [tox]
  8. envlist = {py3.13,pypy}-{aws,azure,gcp,openstack,mock},lint
  9. [testenv]
  10. commands = # see setup.cfg for options sent to pytest and coverage
  11. coverage run --source=cloudbridge -m pytest -v {posargs:-n 5 tests/}
  12. # Combine parallel-mode data files and emit Cobertura XML for upload
  13. # by coverallsapp/github-action in CI. Locally this produces
  14. # coverage.xml in the project root, which IDEs can also consume.
  15. coverage combine
  16. coverage xml
  17. setenv =
  18. # Fix for moto import issue: https://github.com/travis-ci/travis-ci/issues/7940
  19. BOTO_CONFIG=/dev/null
  20. aws: CB_TEST_PROVIDER=aws
  21. azure: CB_TEST_PROVIDER=azure
  22. gcp: CB_TEST_PROVIDER=gcp
  23. openstack: CB_TEST_PROVIDER=openstack
  24. mock: CB_TEST_PROVIDER=mock
  25. # https://github.com/nedbat/coveragepy/issues/883#issuecomment-650562896
  26. COVERAGE_FILE=.coverage.{envname}
  27. passenv =
  28. PYTHONUNBUFFERED
  29. aws: CB_IMAGE_AWS
  30. aws: CB_VM_TYPE_AWS
  31. aws: CB_PLACEMENT_AWS
  32. aws: AWS_ACCESS_KEY
  33. aws: AWS_SECRET_KEY
  34. azure: CB_IMAGE_AZURE
  35. azure: CB_VM_TYPE_AZURE
  36. azure: AZURE_SUBSCRIPTION_ID
  37. azure: AZURE_CLIENT_ID
  38. azure: AZURE_SECRET
  39. azure: AZURE_TENANT
  40. azure: AZURE_REGION_NAME
  41. azure: AZURE_RESOURCE_GROUP
  42. azure: AZURE_STORAGE_ACCOUNT
  43. azure: AZURE_VM_DEFAULT_USER_NAME
  44. azure: AZURE_PUBLIC_KEY_STORAGE_TABLE_NAME
  45. gcp: CB_IMAGE_GCP
  46. gcp: CB_VM_TYPE_GCP
  47. gcp: CB_PLACEMENT_GCP
  48. gcp: GCP_DEFAULT_REGION
  49. gcp: GCP_DEFAULT_ZONE
  50. gcp: GCP_PROJECT_NAME
  51. gcp: GCP_SERVICE_CREDS_FILE
  52. gcp: GCP_SERVICE_CREDS_DICT
  53. openstack: CB_IMAGE_OS
  54. openstack: CB_VM_TYPE_OS
  55. openstack: CB_PLACEMENT_OS
  56. openstack: OS_AUTH_URL
  57. openstack: OS_PASSWORD
  58. openstack: OS_PROJECT_NAME
  59. openstack: OS_TENANT_NAME
  60. openstack: OS_USERNAME
  61. openstack: OS_REGION_NAME
  62. openstack: OS_USER_DOMAIN_NAME
  63. openstack: OS_PROJECT_DOMAIN_NAME
  64. openstack: NOVA_SERVICE_NAME
  65. openstack: OS_APPLICATION_CREDENTIAL_ID
  66. openstack: OS_APPLICATION_CREDENTIAL_SECRET
  67. mock: CB_IMAGE_AWS
  68. mock: CB_VM_TYPE_AWS
  69. mock: CB_PLACEMENT_AWS
  70. mock: AWS_ACCESS_KEY
  71. mock: AWS_SECRET_KEY
  72. deps =
  73. -rrequirements.txt
  74. coverage
  75. pytest-xdist
  76. [testenv:lint]
  77. commands = flake8 cloudbridge tests setup.py
  78. deps = flake8