You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Dev-iL (via GitHub)" <gi...@apache.org> on 2024/02/21 10:30:18 UTC
[I] test_settings.py not being evaluated [airflow]
Dev-iL opened a new issue, #37587:
URL: https://github.com/apache/airflow/issues/37587
### Apache Airflow version
main (development)
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
A PR was merged with incorrectly defined tests. These should've failed, didn't. It's possible that they weren't even evaluated.
### What you think should happen instead?
The build should've failed, alerting everyone involved about the issue.
### How to reproduce
```bash
airflow$ pytest tests/test_settings.py
```
### Operating System
Ubuntu 22.04
### Versions of Apache Airflow Providers
Irrelevant
### Deployment
Virtualenv installation
### Deployment details
Irrelevant
### Anything else?
This fixes the tests:
```python
@patch("airflow.settings.conf")
@patch("airflow.settings.is_sqlalchemy_v1")
def test_encoding_present_in_v1(is_v1, mock_conf):
is_v1.return_value = True
mock_conf.getjson.return_value = {}
engine_args = settings.prepare_engine_args()
assert "encoding" in engine_args
@patch("airflow.settings.conf")
@patch("airflow.settings.is_sqlalchemy_v1")
def test_encoding_absent_on_v2(is_v1, mock_conf):
is_v1.return_value = False
mock_conf.getjson.return_value = {}
engine_args = settings.prepare_engine_args()
assert "encoding" not in engine_args
```
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] test_settings.py not being evaluated [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on issue #37587:
URL: https://github.com/apache/airflow/issues/37587#issuecomment-1956630330
You don't have to create an issue if you could fix it and send the the PR. Airflow is PR friendly - create a PR rather than a task. You also might ask ad-hoc questions into the `#contributors` or `#new-contributors` Slack Channels. Join link https://s.apache.org/airflow-slack
We have to custom test collector and also selective checks which might exclude tests outside of specific directories.
So the solution would be fix the and move it into the [`tests/core/test_setting`](https://github.com/apache/airflow/blob/main/tests/core/test_settings.py)
--
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
Re: [I] test_settings.py not being evaluated [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #37587:
URL: https://github.com/apache/airflow/issues/37587#issuecomment-1956346666
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
--
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
Re: [I] test_settings.py not being evaluated [airflow]
Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis closed issue #37587: test_settings.py not being evaluated
URL: https://github.com/apache/airflow/issues/37587
--
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