Principle:Apache Airflow Testing Quality Assurance
| Knowledge Sources | |
|---|---|
| Domains | Testing, Quality_Assurance |
| Last Updated | 2026-02-08 00:00 GMT |
Overview
A comprehensive testing and validation framework for ensuring provider packages conform to Airflow's quality standards and integration contracts.
Description
Testing and Quality Assurance for providers encompasses three testing tiers: unit tests (isolated component tests), integration tests (with mocked or real external services), and system tests (end-to-end DAG execution). The ProvidersManager singleton validates that all installed providers are correctly structured, their components are importable, and their metadata conforms to the provider schema. The provider_db_inventory tool audits provider database access patterns to ensure providers don't directly access the metadata database.
Usage
Use this principle when developing provider packages. Run unit tests for individual hooks, operators, and sensors. Use ProvidersManager validation to verify package structure. Run the DB inventory audit before release to check for unauthorized database access.
Theoretical Basis
Testing Pyramid:
- Unit Tests: Test individual hooks, operators, sensors in isolation
- Integration Tests: Test with external service connections (mocked or real)
- System Tests: End-to-end DAG execution with pytest markers
Provider Validation:
- ProvidersManager discovers all packages via apache_airflow_provider entry point
- Schema validation ensures provider.yaml conforms to expected structure
- Component import validation ensures all declared classes are importable
- DB inventory audit checks for direct database access patterns