This makes use of PyTest framework to execute integration tests. In general, the tests do the following:
- Upload known input test data (Public API) into specified data sources (ei. blob storage) necessary for the pipeline to run.
- Trigger pipeline to consume uploaded test data.
- Verify pipeline run has succeeded and data outputs are valid.
Note, this package does not deploy the actual integration test environment and assumes an integration tests environment is already provisioned.
The following environment variables must be set:
Service principal account details used to connect to Azure:
- AZ_SERVICE_PRINCIPAL_ID
- AZ_SERVICE_PRINCIPAL_SECRET
- AZ_SERVICE_PRINCIPAL_TENANT_ID
Azure Synapse Analytics:
- AZ_SUBSCRIPTION_ID
- AZ_RESOURCE_GROUP_NAME
- AZ_SYNAPSE_NAME
Azure Synapse Analytics output(s) connection information:
- AZ_SYNAPSE_DEDICATED_SQLPOOL_NAME
- AZ_SYNAPSE_SQLPOOL_ADMIN_USERNAME
- AZ_SYNAPSE_SQLPOOL_ADMIN_PASSWORD
- AZ_SYNAPSE_DEDICATED_SQLPOOL_DATABASE_NAME
Additional optional configuration:
- Open VSCode from the root of the Python project. That is, the root of your VSCode workspace needs to be at
/tests/integrationtests
. It should have.devcontainer
and.vscode
folders. - Copy
.envtemplate
file as new.env
file. Set the environment variables as listed out in.envtemplate
file. - In VSCode command pallete (
ctrl+shift+p
), selectRemote-Containers: Reopen in container
. First time building the Devcontainer may take a while. - Run
pytest
to run tests.
The code is organized as follows:
tests/
conftest.py
- Common Pytest Fixtures.dataconnectors/
- Data connector specific fixtures, subdivided into modules.test_*.py
- contain all test cases