tox.ini 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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.10,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 -n 5 tests/ -v {posargs}
  12. setenv =
  13. # Fix for moto import issue: https://github.com/travis-ci/travis-ci/issues/7940
  14. BOTO_CONFIG=/dev/null
  15. aws: CB_TEST_PROVIDER=aws
  16. azure: CB_TEST_PROVIDER=azure
  17. gcp: CB_TEST_PROVIDER=gcp
  18. openstack: CB_TEST_PROVIDER=openstack
  19. mock: CB_TEST_PROVIDER=mock
  20. # https://github.com/nedbat/coveragepy/issues/883#issuecomment-650562896
  21. COVERAGE_FILE=.coverage.{envname}
  22. passenv =
  23. PYTHONUNBUFFERED
  24. aws: CB_IMAGE_AWS,CB_VM_TYPE_AWS,CB_PLACEMENT_AWS,AWS_ACCESS_KEY,AWS_SECRET_KEY
  25. azure: CB_IMAGE_AZURE,CB_VM_TYPE_AZURE,AZURE_SUBSCRIPTION_ID,AZURE_CLIENT_ID,AZURE_SECRET,AZURE_TENANT,AZURE_REGION_NAME,AZURE_RESOURCE_GROUP,AZURE_STORAGE_ACCOUNT,AZURE_VM_DEFAULT_USER_NAME,AZURE_PUBLIC_KEY_STORAGE_TABLE_NAME
  26. gcp: CB_IMAGE_GCP,CB_VM_TYPE_GCP,CB_PLACEMENT_GCP,GCP_DEFAULT_REGION,GCP_DEFAULT_ZONE,GCP_PROJECT_NAME,GCP_SERVICE_CREDS_FILE,GCP_SERVICE_CREDS_DICT
  27. openstack: CB_IMAGE_OS,CB_VM_TYPE_OS,CB_PLACEMENT_OS,OS_AUTH_URL,OS_PASSWORD,OS_PROJECT_NAME,OS_TENANT_NAME,OS_USERNAME,OS_REGION_NAME,OS_USER_DOMAIN_NAME,OS_PROJECT_DOMAIN_NAME,NOVA_SERVICE_NAME,OS_APPLICATION_CREDENTIAL_ID,OS_APPLICATION_CREDENTIAL_SECRET
  28. mock: CB_IMAGE_AWS,CB_VM_TYPE_AWS,CB_PLACEMENT_AWS,AWS_ACCESS_KEY,AWS_SECRET_KEY
  29. deps =
  30. -rrequirements.txt
  31. coverage
  32. pytest-xdist
  33. [testenv:lint]
  34. commands = flake8 cloudbridge tests setup.py
  35. deps = flake8