# Tox (http://tox.testrun.org/) is a tool for running tests # in multiple virtualenvs. This configuration file will run the # test suite on all supported python versions and providers. # To use it, "pip install tox" and then run "tox" from this directory. # You will have to set all required environment variables (below) before # running the tests. [tox] envlist = {py3.13,pypy}-{aws,azure,gcp,openstack,mock},lint [testenv] commands = # see setup.cfg for options sent to pytest and coverage coverage run --source=cloudbridge -m pytest -v {posargs:-n 5 tests/} # Combine parallel-mode data files and emit Cobertura XML for upload # by coverallsapp/github-action in CI. Locally this produces # coverage.xml in the project root, which IDEs can also consume. coverage combine coverage xml setenv = # Fix for moto import issue: https://github.com/travis-ci/travis-ci/issues/7940 BOTO_CONFIG=/dev/null aws: CB_TEST_PROVIDER=aws azure: CB_TEST_PROVIDER=azure gcp: CB_TEST_PROVIDER=gcp openstack: CB_TEST_PROVIDER=openstack mock: CB_TEST_PROVIDER=mock # https://github.com/nedbat/coveragepy/issues/883#issuecomment-650562896 COVERAGE_FILE=.coverage.{envname} passenv = PYTHONUNBUFFERED aws: CB_IMAGE_AWS aws: CB_VM_TYPE_AWS aws: CB_PLACEMENT_AWS aws: AWS_ACCESS_KEY aws: AWS_SECRET_KEY azure: CB_IMAGE_AZURE azure: CB_VM_TYPE_AZURE azure: AZURE_SUBSCRIPTION_ID azure: AZURE_CLIENT_ID azure: AZURE_SECRET azure: AZURE_TENANT azure: AZURE_REGION_NAME azure: AZURE_RESOURCE_GROUP azure: AZURE_STORAGE_ACCOUNT azure: AZURE_VM_DEFAULT_USER_NAME azure: AZURE_PUBLIC_KEY_STORAGE_TABLE_NAME gcp: CB_IMAGE_GCP gcp: CB_VM_TYPE_GCP gcp: CB_PLACEMENT_GCP gcp: GCP_DEFAULT_REGION gcp: GCP_DEFAULT_ZONE gcp: GCP_PROJECT_NAME gcp: GCP_SERVICE_CREDS_FILE gcp: GCP_SERVICE_CREDS_DICT openstack: CB_IMAGE_OS openstack: CB_VM_TYPE_OS openstack: CB_PLACEMENT_OS openstack: OS_AUTH_URL openstack: OS_PASSWORD openstack: OS_PROJECT_NAME openstack: OS_TENANT_NAME openstack: OS_USERNAME openstack: OS_REGION_NAME openstack: OS_USER_DOMAIN_NAME openstack: OS_PROJECT_DOMAIN_NAME openstack: NOVA_SERVICE_NAME openstack: OS_APPLICATION_CREDENTIAL_ID openstack: OS_APPLICATION_CREDENTIAL_SECRET mock: CB_IMAGE_AWS mock: CB_VM_TYPE_AWS mock: CB_PLACEMENT_AWS mock: AWS_ACCESS_KEY mock: AWS_SECRET_KEY deps = -rrequirements.txt coverage pytest-xdist [testenv:lint] commands = flake8 cloudbridge tests setup.py deps = flake8