Taragolis commented on code in PR #38711:
URL: https://github.com/apache/airflow/pull/38711#discussion_r1551493385


##########
tests/conftest.py:
##########
@@ -1205,6 +1205,22 @@ def cleanup_providers_manager():
         ProvidersManager()._cleanup()
 
 
[email protected](scope="session", autouse=True)
+def _extend_secrets_to_skip_masking_for_tests():
+    """Additional words which should be skipped to be masked for tests."""
+    from airflow.utils.log import secrets_masker
+
+    extend_select = {"test", "password"}

Review Comment:
   We have banned `airflow` as masked password in tests, for avoid change it 
core, better monkey patch it in tests only



##########
tests/providers/amazon/aws/utils/test_waiter_with_logging.py:
##########
@@ -37,7 +37,16 @@ def generate_response(state: str) -> dict[str, Any]:
     }
 
 
+def filter_record_tuples(
+    record_tuples: list[tuple[str, int, str]],
+    logger_name: str,
+) -> Iterator[tuple[str, int, str]]:
+    return filter(lambda rt: rt[0] == logger_name, record_tuples)

Review Comment:
   We have same case in google tests in the past when some async task might be 
captured in logger
   
   ```console
   E       assert equals failed
   E         [                                [                               
   E           (                                                              
   E             'asyncio',                                                   
   E             40,                                                          
   E             "Task was destroyed but it                                   
   E         is pending!\ntask: <Task pendin                                  
   E         g name='Task-27' coro=<<async_g                                  
   E         enerator_asend without __name__                                  
   E         >()> wait_for=<Future pending c                                  
   E         b=[Task.task_wakeup()]>>",                                       
   E           ),                                                             
   E           (                                (                             
   E             'airflow.providers.amazon.a      'airflow.providers.amazon.a 
   E         ws.utils.waiter_with_logging',   ws.utils.waiter_with_logging',  
   E             20,                              20,                         
   E             'test status message: Pendi      'test status message: Pendi 
   E         ng',                             ng',                            
   E           ),                               ),                            
   E           (                                (                             
   E             'airflow.providers.amazon.a      'airflow.providers.amazon.a 
   E         ws.utils.waiter_with_logging',   ws.utils.waiter_with_logging',  
   E             20,                              20,                         
   E             'test status message: Pendi      'test status message: Pendi 
   E         ng',                             ng',                            
   E           ),                               ),                            
   E         ]                                ]
   ```
   
   the best way is capture only what is required



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to