Replies: 1 comment
|
For a standalone provider, I'd keep a small test-only DAG for integration tests, even if the distributed package contains no DAGs. Install the provider into an isolated Airflow test environment, put that DAG in a configured test bundle, initialize the test metadata DB, and run it with For operator unit tests, you can stay with pytest: mock the external service, call
|
Uh oh!
There was an error while loading. Please reload this page.
If I'm building and distributing an internal Airflow provider, for example, a repository that only contains custom operators, hooks, etc., but no DAGs, what is the best way to write integration tests for that code? Official Airflow providers often use the dag_maker fixture as a convenient way to write unit tests (example) that create an in-memory DAG. However, the official documentation suggests
dag.test(), which requires a separate DAG file to exist in a configured DAG bundle. If the latter is the answer, will official Airflow providers be migrating to that approach as well?All reactions