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 2022/10/22 10:24:26 UTC

[GitHub] [airflow] Taragolis opened a new pull request, #27198: Fix test get credentials for assume role in amazon provider

Taragolis opened a new pull request, #27198:
URL: https://github.com/apache/airflow/pull/27198

   Follow-up: https://github.com/apache/airflow/pull/26946 and https://github.com/apache/airflow/pull/27177
   
   Seems like in new version of `moto` also changed STS mock responses of get caller identity.
   Remove check that Role Session Name is part of UserID. My fault that I added it initially because it might depend on internal implementation of `moto`. We actually check that pass this parameters during session creation within **another test case**:
   
   https://github.com/apache/airflow/blob/5e542e7532521665dadc4d428c53cbc8e7e57c66/tests/providers/amazon/aws/hooks/test_base_aws.py#L362-L371
   
   


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


[GitHub] [airflow] potiuk commented on pull request #27198: Fix test get credentials for assume role in amazon provider

Posted by GitBox <gi...@apache.org>.
potiuk commented on PR #27198:
URL: https://github.com/apache/airflow/pull/27198#issuecomment-1288128308

   Yeah. Thanks for fixing it. My ❤️ for moto grows. 


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


[GitHub] [airflow] dstandish merged pull request #27198: Fix test get credentials for assume role in amazon provider

Posted by GitBox <gi...@apache.org>.
dstandish merged PR #27198:
URL: https://github.com/apache/airflow/pull/27198


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


[GitHub] [airflow] Taragolis commented on pull request #27198: Fix test get credentials for assume role in amazon provider

Posted by GitBox <gi...@apache.org>.
Taragolis commented on PR #27198:
URL: https://github.com/apache/airflow/pull/27198#issuecomment-1287756983

   Additional findings or ideas which could be done in separate PR's
   
   ### SkipIf decorator wouldn't work in case of `moto` decorators. Because all decorators should be applied first
   
   ```python
   try:
       from moto import mock_sts
   except ImportError:
       mock_sts = None
   
   ...
   
   @pytest.mark.skipif(mock_sts is None, reason="mock_sts package not present")
   @mock_sts
   def some_test_case():
       ...
   ```
   
   We got an error `TypeError: 'NoneType' object is not callable` possible solutions:
   1. Do not use try..except - if some mock decorators removed or specific `moto` extra package not installed we just got ImportError which more clear
   2. Use inside of fixtures
   3. Create own decorator which check that specific mock client exists or not
   
   ### New major version `moto` might broke tests in the future
   
   Might be better pin `moto~=4.0.0` in [setup.py](https://github.com/apache/airflow/blob/5e542e7532521665dadc4d428c53cbc8e7e57c66/setup.py#L379)?
   
   


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


[GitHub] [airflow] pierrejeambrun commented on pull request #27198: Fix test get credentials for assume role in amazon provider

Posted by GitBox <gi...@apache.org>.
pierrejeambrun commented on PR #27198:
URL: https://github.com/apache/airflow/pull/27198#issuecomment-1287791240

   Moto and it's internals 🤯 


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