potiuk commented on PR #31406:
URL: https://github.com/apache/airflow/pull/31406#issuecomment-1567848588

   > > Would you be able to add a unit test to make sure this doesn't break 
again, or is that a major operation for a query like this?
   > 
   > I have a problem with running tests locally and I'm not experienced with 
python. So I found a bug and fixed it, but writing tests may be a problem.
   
   Yes. Running tests should be really straightforward. And it should be part 
of the PR @mdembiczak 
   
   Breeze give you a setup that does not require any special setup/env (except 
docker and docker compose installed) so you should be able to just install it. 
Run `breeze` and then run `pytest tests/..../test_nam.py` and it should work. 
Also most tests that even do not require breeze (majority of our unit tests in 
core and this is one that you are going to modify) is likely to be able to run 
in just standard Local Virtualenv: 
https://github.com/apache/airflow/blob/main/LOCAL_VIRTUALENV.rst and you should 
be able to run it easily within any IDE of your choice. We have instructions 
(including setup screenshots) for Pycharm 
https://github.com/apache/airflow/blob/main/CONTRIBUTORS_QUICK_START_PYCHARM.rst
 VSCOde 
https://github.com/apache/airflow/blob/main/CONTRIBUTORS_QUICK_START_VSCODE.rst 
and even gitpod or codespaces.
   
   It might seem not needed if you look at it from your side @mdembiczak  but 
this is crucial part of the fix to also provide a unit test for it. 
   
   Whe we absolutely need tests ? Because when we cherry-pick the changes to 
released airflow we run the tests to see if the cherry-picked fix is actually 
still working there. It might be that it is breaking something else in that 
branch so only having a unit test together with the change is a way to see if 
it still works after we cherry-pick it. Also we might in the future introduce 
other changes that might cause regressions and having unit tests is the way to 
prevent the regressions. We are as much into fixing the issues as we are about 
preventing them from re-occuring in the future.
   
   If you need any help with that and if you describe what problems you had 
when trying to run the tests and add a new one, we will be happy to help, but 
we need the test for the above reasons.
   
   
   
   


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