New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block tests from opening sockets #55516
Conversation
.github/workflows/ci.yaml
Outdated
--disable-socket \ | ||
--allow-unix-socket \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not so nice.
There are other integration alternative: https://github.com/miketheman/pytest-socket#usage, the best option might be to do this in the top level conftest.py
:
import pytest_socket
def pytest_runtest_setup():
pytest_socket.disable_socket(allow_unix_socket=True)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the limitation to the top-level conftest.py is clearly better.
But why do we allow unix_sockets, I thought the tests should operate with mock and sort of "offline".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unix sockets are used by asyncio, so we have to allow it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The limitation is now added to the top-level conftest.py instead
A summary of tests failing in group 1: Common issues are:
|
This fixes the zeroconf mock and enables it for group 1: #55526 |
8f76d71
to
50a08ba
Compare
aca9afb
to
845e917
Compare
845e917
to
9c2ca2b
Compare
9c2ca2b
to
041e5a5
Compare
041e5a5
to
b1d488e
Compare
5d0a74b
to
31b57e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO: Awesomeness!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just awesome 馃憤
Let's merge this so we don't have to keep playing whack-a-mole. |
Proposed change
Block tests from opening sockets
The blocking is implemented by using the
pytest_socket
package which is enabled in apytest_runtest_setup
in the top-level conftest.py.Workarounds for two pytest_socket PRs, miketheman/pytest-socket#75, miketheman/pytest-socket#76 are added in the top-level conftest.py.
Related PRs
Type of change
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: