You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2023/01/04 10:29:33 UTC

[GitHub] [airflow] Taragolis commented on pull request #28631: Clear DB before individual module tests

Taragolis commented on PR #28631:
URL: https://github.com/apache/airflow/pull/28631#issuecomment-1370748325

   @potiuk I removed all optional changes and kept only related to this PR: autofixture and changes in API tests + Kerberos Integration
   
   Also found that if we call `DAG.sync_to_db()` it no has any affect to database, so I change it to same method in DagBag object, I do not know is it expected or it is some kind of bug.
   
   Example of changes
   
   ```patch
   --- a/tests/api/client/test_local_client.py
   +++ b/tests/api/client/test_local_client.py
   @@ -44,7 +44,7 @@
    class TestLocalClient:
        @classmethod
        def setup_class(cls):
   -        DagBag(example_bash_operator.__file__).get_dag("example_bash_operator").sync_to_db()
   +        DagBag(example_bash_operator.__file__, include_examples=False).sync_to_db()
    
        def setup_method(self):
            clear_db_pools()
   ```
   
   Previously this part work because we do not clear this part of metadatabase in API tests and tests use initial database state.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org