potiuk commented on code in PR #51511:
URL: https://github.com/apache/airflow/pull/51511#discussion_r2260235178
##########
airflow-core/tests/unit/dag_processing/test_collection.py:
##########
@@ -340,10 +345,7 @@ def dag_to_lazy_serdag(self, dag: DAG) ->
LazyDeserializedDAG:
ser_dict = SerializedDAG.to_dict(dag)
return LazyDeserializedDAG(data=ser_dict)
- @pytest.mark.skipif(
- condition="FabAuthManager" not in conf.get("core", "auth_manager"),
- reason="This is only for FabAuthManager",
- )
+ @mark_fab_auth_manager_test
Review Comment:
The reason is that when developers run their own local manual airlfow
installation and tests, they often set `AIRFLOW__` variables in their own
environment (for example via `init.sh` in Breeze). And the problem is that
those variables when set might change behaviours of Airflow and make some tests
fail when those tests expect "defaults". So effectively that auto-used fixture
in Pytest simply cleans up all AIRFLOW___ variables (except selected few that
we know might and shoudl be changeable - such us metadata variables that
determine which database should be used for database tests).
If we don't do it, then someone who has AIRFLOW__ variable set in their env
and forgot about it, will have hard time diagnosing some test failures - and
others won't be able to help him because it's easy to not realize that your
environment has the variable set.
Treat it as "setting good known state of configuration" before tests. Part
of avoiding "works for me" syndrome.
--
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]