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 2021/02/17 22:38:22 UTC

[GitHub] [airflow] soggycactus opened a new issue #14285: is_valid_plugin can no longer be used for unit testing plugins

soggycactus opened a new issue #14285:
URL: https://github.com/apache/airflow/issues/14285


   I can no longer use `airflow.plugins_manager.is_valid_plugin` to write a simple unit test that ensures I can't merge broken plugins to master. 
   
   This is because the function no longer accepts a list of plugins that represents existing plugins, and instead references a global variable inside the package (I would really love an explanation as to how this is better). 
   
   The global variable plugins is defined as `None`, and when calling the function locally, it will always fail because a `None` object is not iterable. 
   
   Either this function needs to be fixed or Airflow needs to provide another interface for validating plugins. I was really disappointed to see this as I spent this week researching how to upgrade our Airflow to 2.0, only to find that a lot of the utilities I've built around Airflow have been rendered useless. I'm sticking with 1.10.14 for now


----------------------------------------------------------------
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.

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



[GitHub] [airflow] boring-cyborg[bot] commented on issue #14285: is_valid_plugin can no longer be used for unit testing plugins

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #14285:
URL: https://github.com/apache/airflow/issues/14285#issuecomment-780901007


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] soggycactus closed issue #14285: is_valid_plugin can no longer be used for unit testing plugins

Posted by GitBox <gi...@apache.org>.
soggycactus closed issue #14285:
URL: https://github.com/apache/airflow/issues/14285


   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] mik-laj commented on issue #14285: is_valid_plugin can no longer be used for unit testing plugins

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #14285:
URL: https://github.com/apache/airflow/issues/14285#issuecomment-786934272


   @soggycactus  This feature doesn't really do much work, so I don't think it's too useful for the end-user. From my experience, I know that it is best to check such things from the user's perspective, because this is the way to detect most problems.
   This means that you can run the code below to check if your plugin loads correctly.
   ```pytthon
   with mock.patch.dict('os.environ',  AIRFLOW__CORE__PLUGINS_FOLDER='/tmp/plugins_dir'):
       assert 'metastore_browser' in subprocess.check_output(['airflow', 'plugins'], timeout=15):
   ```
   


----------------------------------------------------------------
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.

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