Commit Graph

281 Commits (a67c5e1fba491ed94216bd3d422a9c3e1ec2ab9c)

Author SHA1 Message Date
epenet ef767c2b9f
Improve tests for frame helper (#130046)
* Improve tests for frame helper

* Improve comments

* Add ids

* Apply suggestions from code review
2024-11-07 17:35:58 +01:00
epenet 91157c21ef
Reapply "Fix unused snapshots not triggering failure in CI" (#129311) 2024-11-04 18:59:27 +01:00
Franck Nijhof 35b7c3038a
Revert "Fix unused snapshots not triggering failure in CI" (#129223)
Revert "Fix unused snapshots not triggering failure in CI (#128162)"

This reverts commit e888a95bd1.
2024-10-26 16:12:47 +02:00
epenet e888a95bd1
Fix unused snapshots not triggering failure in CI (#128162) 2024-10-26 07:15:51 +02:00
Erik Montnemery f1e8675756
Set autouse flag on session scope bluetooth fixture (#126589) 2024-09-24 08:43:32 +02:00
epenet 02cb6a6af7
Force root import of references from other components (#125816)
* Force root import of references from other components

* Improve

* Adjust

* Tweak exceptions

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Adjust

* More

* Ignore violations in test

* Improve
2024-09-16 11:28:42 +02:00
Erik Montnemery 2a1df2063d
Separate recorder test fixtures disabling context id migration (#125324)
* Separate recorder test fixtures disabling context id migration

* Fix test
2024-09-09 08:16:30 +02:00
Erik Montnemery ce2ffde22e
Update sensor recorder tests to async (#124061) 2024-08-18 13:20:58 -05:00
J. Nick Koston b15ea58851
Relocate code to get scheduled TimerHandles (#123546) 2024-08-12 09:15:33 +02:00
Erik Montnemery 6840f27bc6
Verify respx mock routes are cleaned up when tests finish (#122852) 2024-07-30 17:12:58 +02:00
Erik Montnemery ea75c8864f
Remove support for live schema migration of old recorder databases (#122399)
* Remove support for live schema migration of old recorder databases

* Update test
2024-07-29 15:52:18 +02:00
Erik Montnemery 5dbd7684ce
Fail tests if recorder creates nested sessions (#122579)
* Fail tests if recorder creates nested sessions

* Adjust import order

* Move get_instance
2024-07-25 21:18:55 +02:00
Erik Montnemery 6223fe93c8
Fix typo in conftest.py (#122583) 2024-07-25 12:08:52 +02:00
Erik Montnemery 20fc5233a1
Add recorder data migrator class to clean up states table (#122069) 2024-07-22 13:04:01 -05:00
Erik Montnemery 2f47312eeb
Fix recorder setup hanging if non live schema migration fails (#122242) 2024-07-20 13:10:23 +02:00
Erik Montnemery 436a38c1d2
Revert "Fix recorder setup hanging if non live schema migration fails" (#122232) 2024-07-20 12:29:08 +02:00
Erik Montnemery 153b69c971
Fix recorder setup hanging if non live schema migration fails (#122207) 2024-07-20 11:17:40 +02:00
Marc Mueller a6068dcdf2
Update import locations in tests (#122216) 2024-07-20 11:16:04 +02:00
Erik Montnemery 6921e053e4
Move recorder data migration implementation to migrators (#122045) 2024-07-17 10:59:58 +02:00
Erik Montnemery 9970b7eece
Refactor recorder data migration (#121009)
* Refactor recorder data migration

* Fix stale docstrings

* Don't store a session object in BaseRunTimeMigration instances

* Simplify logic in EntityIDMigration.migration_done

* Fix tests
2024-07-16 21:50:19 +02:00
J. Nick Koston 19d2d023ab
Ensure states table rebuild still happens if the event_id index was removed (#121938)
* Ensure states table rebuild still happens if the event_id index was removed

If ix_states_event_id was removed by the foreign key still
exists, the states table would not get rebuilt. This should
not happen under normal circumstances and seems to only be
possible if the index was removed manually or Home
Assistant was restarted forcefully in the middle
of a previous migration from years ago.

* cover

* fix tests

* mysql wont allow at that point but thats ok as long as its gone at the end
2024-07-14 23:20:52 +02:00
Erik Montnemery d55d02623a
Add recorder test fixture to enable persistent SQLite database (#121137)
* Add recorder test fixture to enable persistent SQLite database

* Fix tests directly using async_test_home_assistant context manager
2024-07-04 09:59:37 +02:00
Erik Montnemery 5029da6919
Make the async_setup_recorder_instance fixture a context manager (#121086) 2024-07-03 14:05:34 -05:00
Erik Montnemery 87f7703f3c
Use async_setup_recorder_instance fixture in recorder migration tests (#121050) 2024-07-03 08:56:05 -05:00
epenet 61b2e4ca32
Add Context to service_calls fixture (#120923) 2024-07-01 14:05:30 +02:00
Marc Mueller ca55986057
Import Generator from collections.abc (1) (#120914) 2024-07-01 11:51:51 +02:00
Joost Lekkerkerker b56c4a757c
Bump ruff to 0.5.0 (#120749) 2024-06-28 15:23:21 +02:00
Erik Montnemery 4a86693254
Verify default timezone is restored when test ends (#116216) 2024-06-26 09:41:16 +02:00
Erik Montnemery e32a27a8ff
Remove hass_recorder test fixture (#120295) 2024-06-24 11:14:08 +02:00
Jan Bouwhuis f1fd52bc30
Fix issue in mqtt fixture calling disconnect handler (#120246) 2024-06-23 10:37:08 -05:00
Robert Resch bae008b0e2
Remove legacy_api_password auth provider (#119976) 2024-06-19 22:46:30 +02:00
epenet 9f41133bbc
Add missing argument type to core tests (#119667) 2024-06-14 08:42:01 +02:00
J. Nick Koston d52ce03aa4
Ensure asyncio blocking checks are undone after tests run (#119542)
* Ensure asyncio blocking checks are undone after tests run

* no reason to ever enable twice

* we are patching objects, make it more generic

* make sure bootstrap unblocks as well

* move disable to tests only

* re-protect

* Update tests/test_block_async_io.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Revert "Update tests/test_block_async_io.py"

This reverts commit 2d46028e21.

* tweak name

* fixture only

* Update tests/conftest.py

* Update tests/conftest.py

* Apply suggestions from code review

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-06-13 08:52:01 +02:00
epenet 9e8f9abbf7
Ignore misplaced-bare-raise warnings in tests (#119403) 2024-06-11 17:59:54 +02:00
epenet fce4fc663e
Fix import-outside-toplevel pylint warnings in core tests (#119394) 2024-06-11 16:10:34 +02:00
epenet 572700a326
Ignore c-extension-no-member pylint warnings in tests (#119378) 2024-06-11 12:57:43 +02:00
epenet 8cbfc5a58b
Use service_calls fixture in arcam_fmj tests (#119274) 2024-06-10 13:09:51 +02:00
epenet 5166426d0a
Add type hints for service_calls fixture in pylint plugin (#118356) 2024-06-08 16:32:27 +02:00
Marc Mueller 279483ddb0
Import Generator from typing_extensions (2) (#118989) 2024-06-06 17:24:22 +02:00
J. Nick Koston 67b3be8432
Remove useless threading locks in mqtt (#118737) 2024-06-04 14:21:03 -05:00
epenet 37fc16d7b6
Fix incorrect `patch` type hint in main conftest (#118461) 2024-06-02 15:34:30 +02:00
epenet a5dc4cb1c7
Fix incorrect `zeroconf` type hint in tests (#118465)
* Fix incorrect `mock_async_zeroconf` type hint

* Adjust thread

* One more

* Fix mock_zeroconf also

* Adjust

* Adjust
2024-05-30 21:57:09 +02:00
Jan Bouwhuis bfc3194661
Fix mqtt not publishing null payload payload to remove discovery (#118261) 2024-05-27 12:53:22 -10:00
J. Nick Koston 226d010ab2
Simplify mqtt connection state dispatcher (#118184) 2024-05-26 10:21:21 -10:00
Marc Mueller 1ad8151bd1
Use PEP 695 type alias in tests (#117797) 2024-05-20 19:03:04 +02:00
J. Nick Koston 5a609c34bb
Fix blocking I/O in the event loop when loading timezones (#117721) 2024-05-20 11:06:03 +02:00
Marc Mueller 25d1ca747b
Use PEP 695 for decorator typing (3) (#117640) 2024-05-17 16:27:32 +02:00
J. Nick Koston b061e7d1aa
Small speed up to setting up integrations and config entries (#117278)
* Small speed up to setting up integration and config entries

When profiling tests, I noticed many calls to get_running_loop. In the places
where we are already in a coro, pass the existing loop so it does not have to
be looked up. I did not do this for places were we are not in a coro since there
is risk that an integration could be doing a non-thread-safe call and its better
that the code raises when trying to fetch the running loop vs the performance
improvement for these cases.

* fix merge

* missed some
2024-05-11 22:39:20 -04:00
J. Nick Koston 481de8cdc9
Ensure config entry operations are always holding the lock (#117214)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-12 08:20:08 +09:00
J. Nick Koston d7aa24fa50
Only load translations for an integration once per test session (#117118) 2024-05-11 12:00:02 +09:00