airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Run Task SDK tests without DB

Open kaxil opened this issue 1 year ago • 2 comments

We don't need Database for Task SDK. So let's skip initializing or using the database. This will help us catch if there is a code that needs DB leaks in the SDK code


^ Add meaningful description above Read the Pull Request Guidelines for more information. In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed. In case of a new dependency, check compliance with the ASF 3rd Party License Policy. In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

kaxil avatar Oct 18 '24 20:10 kaxil

Hmmm, could this be done in the task_sdk/tests/conftest.py too somehow, so that if you run pytest it will also not spin up the DB?

I think there is a marker we could apply globally via that file.

@ashb Done

kaxil avatar Oct 18 '24 21:10 kaxil

~Waiting for https://github.com/apache/airflow/pull/43185 to get merged first~

Update: Its Merged

kaxil avatar Oct 19 '24 03:10 kaxil