potiuk commented on code in PR #32394:
URL: https://github.com/apache/airflow/pull/32394#discussion_r1254846980
##########
helm_tests/airflow_aux/test_pod_template_file.py:
##########
@@ -29,7 +29,7 @@
@pytest.fixture(scope="class", autouse=True)
def isolate_chart(request):
- chart_dir = Path(__file__).parents[3] / "chart"
+ chart_dir = Path(__file__).parents[3] / "airflow" / "chart"
Review Comment:
```suggestion
chart_dir = Path(__file__).parents[2] / "chart"
```
This is how it should be. Having "airflow" hard-coded, you assume that that
Airflow has been checked out as "airflow" directory, which does not necessarily
needs to be true. This would cause subtle problems that could be very difficult
to fix when you will be running the tests in loca environment.
You can easily checkout airflow with a different "folder" name or even
create a work-tree if you work on different branches in the same directory
where you keep several different versions of airflow checked out.
For example I have:
```
code
| - airflow -> here I mostly work on main
| - airflow-copy -> here I mostly work on v2-6-test branch or similar
```
The airflow-copy is a worktree of the "airflow" repoository - which means
that I have one git repository but I can have different branches of the same
repo checked out in different folders.
If you do `parents[3] / "airflow" / "chart"`, what will happen is that when
I run tests in "airflow-copy", it will copy chart from the "airflow-copy",
which might be an old tag or branch. That would be extremely difficult bug to
trace in those cases.
--
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]