| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- # 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 pyproject.toml for coverage options; setup.cfg for flake8
- 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
- # Standard boto3 credential env vars — set by aws-actions/configure-aws-credentials
- # in CI (OIDC) and by `aws configure` locally. Required because tox does not
- # forward arbitrary env vars to the test process.
- aws: AWS_ACCESS_KEY_ID
- aws: AWS_SECRET_ACCESS_KEY
- aws: AWS_SESSION_TOKEN
- aws: AWS_REGION
- aws: AWS_DEFAULT_REGION
- # Cloudbridge-specific names, kept for backward compatibility with local dev
- # configs that set these.
- 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
- deps = flake8
|