Closed agners closed 2 months ago
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
We should follow this up with a change to devcontainer and switch what package it is installing here: https://github.com/home-assistant/devcontainer/blob/7ae0e50db3cadb3dca003175baa5288801e5874a/supervisor/Dockerfile#L15
But tested in current devcontainer and still works fine because dbus-x11
depends on the other
We should follow this up with a change to devcontainer and switch what package it is installing here: https://github.com/home-assistant/devcontainer/blob/7ae0e50db3cadb3dca003175baa5288801e5874a/supervisor/Dockerfile#L15
Addressed with: https://github.com/home-assistant/devcontainer/pull/100
Proposed change
This PR minimizes the D-Bus requirements for tests. It does this by using dbus-daemon directly instead of dbus-launch. The latter is meant for graphical applications and therefor has X11 dependencies. It also leaves the D-Bus daemon running after the tests are done. This will accumulate dbus-daemon processes over time which is not ideal.
I've also considered using dbus-run-session since it is meant to launch processes with a private D-Bus session. For Python tests one could launch it like so: dbus-run-session -- python3 -m pytest ...
Then
DBUS_SESSION_BUS_ADDRESS
would be used automatically by theMessageBus
class. However, to keep the current behavior of the tests, launching the D-Bus daemon manually is the better option.Type of change
Additional information
Checklist
ruff format supervisor tests
)If API endpoints of add-on configuration are added/changed:
Summary by CodeRabbit
dbus_session
function to return a session address, improving connection capabilities to the D-Bus session.dbus_session
function for asynchronous execution, optimizing resource management.