Commit Graph

511 Commits (dcef25c0fa74ef3811401071e6fb487b754130aa)

Author SHA1 Message Date
Erik Montnemery e47cbf3cf7
Use async_setup_recorder_instance fixture in recorder v32_migration tests (#121081)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-04 17:49:51 -05:00
Erik Montnemery 6df15ad8fc
Drop use of async_setup_recorder_instance fixture in recorder purge tests (#121193) 2024-07-04 10:39:24 -05:00
Erik Montnemery a1e6f8c2ec
Drop use of async_setup_recorder_instance fixture in recorder migration tests (#121196) 2024-07-04 10:39:13 -05:00
Erik Montnemery f1d6ad9073
Add test fixture to control recorder migration (#121180)
* Add test fixture to control recorder migration

* Update tests/components/recorder/conftest.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update tests/components/recorder/conftest.py

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-04 13:10:08 +02:00
Erik Montnemery 255778d0c7
Use recorder test fixtures in recorder init tests (#121176) 2024-07-04 04:54:40 -05: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 cc2782edc7
Use async_test_recorder fixture in recorder auto_repairs tests (#121125) 2024-07-04 01:38:01 +02:00
Erik Montnemery 408e524551
Add recorder test fixture for skipping tests by DB engine (#121118)
* Add recorder test fixture for skipping tests by DB engine

* Fix mistake
2024-07-04 00:02:46 +02:00
Erik Montnemery 5029da6919
Make the async_setup_recorder_instance fixture a context manager (#121086) 2024-07-03 14:05:34 -05:00
J. Nick Koston 44c89e6c3b
Cleanup v32 recorder migration test (#121083) 2024-07-03 10:45:19 -05:00
Erik Montnemery 46a488d871
Use async_setup_recorder_instance fixture in recorder auto_repairs tests (#121077) 2024-07-03 17:04:39 +02:00
Erik Montnemery 87f7703f3c
Use async_setup_recorder_instance fixture in recorder migration tests (#121050) 2024-07-03 08:56:05 -05:00
Marc Mueller f11b316dac
Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
J. Nick Koston c5804d362c
Remove legacy foreign key constraint from sqlite states table (#120779) 2024-06-29 07:50:53 -05:00
Joost Lekkerkerker c13786c952
Fix ruff manual-dict-comprehension PERF403 in tests (#120738)
Fix PERF403 in tests
2024-06-28 12:14:24 +02:00
G Johansson 753ab08b5e
Add capability to exclude all attributes from recording (#119725) 2024-06-22 19:30:28 +02:00
epenet 83b97d3218
Add missing argument type hints to recorder tests (#119672) 2024-06-14 09:25:26 +02:00
epenet 2f5f372f63
Remove pointless TODO in recorder tests (#119490) 2024-06-12 18:08:01 +02:00
epenet 0f0c2f0553
Fix redefined-argument-from-local pylint warning in tests (#119475) 2024-06-12 17:58:58 +02:00
epenet 7388271689
Fix unspecified-encoding warnings in tests (#119405) 2024-06-11 17:58:40 +02:00
epenet 2c7022950c
Fix import-outside-toplevel pylint warnings in tests (#119389) 2024-06-11 14:57:50 +02:00
Erik Montnemery def9d5b101
Fix statistic_during_period after core restart (#119323) 2024-06-10 21:44:55 +02:00
karwosts aa419686cb
Fix statistic_during_period wrongly prioritizing ST statistics over LT (#115291)
* Fix statistic_during_period wrongly prioritizing ST statistics over LT

* comment

* start of a test

* more testcases

* fix sts insertion range

* update from review

* remove unneeded comments

* update logic

* min/mean/max testing
2024-06-10 20:23:21 +02:00
epenet ac588ddc75
Use relative imports in tests [j-r] (#119282) 2024-06-10 13:32:31 +02:00
Sid 721b2c2ca8
Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
Marc Mueller 837ee7c4fb
Import Generator from typing_extensions (4) (#118992) 2024-06-06 17:41:37 +02:00
epenet b54a68750b
Add type hints for FixtureRequest in tests (#118779) 2024-06-04 10:37:54 +02:00
J. Nick Koston 35a1ecea27
Speed up statistics_during_period websocket api (#118672) 2024-06-03 18:08:46 -05:00
epenet 8772a59f5c
Add type hints for Recorder in test fixtures (#118685) 2024-06-03 10:17:51 +02:00
J. Nick Koston 134088e1f6
Revert "Add websocket API to get list of recorded entities (#92640)" (#118644)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-06-03 10:11:24 +02:00
epenet 1317837986
Improve type hints in tests (q-z) (#118381) 2024-05-30 08:48:02 +02:00
J. Nick Koston 0888233f06
Make Recorder dialect_name a cached_property (#117922) 2024-05-29 09:23:40 +02:00
Jan Bouwhuis c616fc036e
Move recorder chunk utils to shared collection utils (#118065) 2024-05-24 12:49:39 -10:00
epenet 44f715bd02
Use issue_registry fixture in component tests (#118041) 2024-05-24 15:54:20 +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
J. Nick Koston 3f053eddbd
Add websocket API to get list of recorded entities (#92640)
* Add API to get list of recorded entities

* update for latest codebase

* ruff

* Update homeassistant/components/recorder/websocket_api.py

* Update homeassistant/components/recorder/websocket_api.py

* Update homeassistant/components/recorder/websocket_api.py

* add suggested test
2024-05-15 08:41:56 +02:00
J. Nick Koston d06932bbc2
Refactor asyncio loop protection to improve performance (#117295) 2024-05-13 07:01:55 +09:00
Sid ac54cdcdb4
Enable Ruff RUF010 (#115371)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-08 23:54:49 +02:00
Erik Montnemery 1cea22b8ba
Fix search/replace mistake in recorder tests (#116933) 2024-05-06 09:03:21 -05:00
Erik Montnemery 2e945aed54
Convert recorder auto_repairs tests to use async API (#116927) 2024-05-06 08:25:48 -05:00
Erik Montnemery 5150557372
Convert recorder util tests to use async API (#116926) 2024-05-06 08:25:41 -05:00
Erik Montnemery 9807b2ec11
Convert recorder statistics tests to use async API (#116925) 2024-05-06 08:10:58 -05:00
Erik Montnemery d01d161fe2
Convert recorder history tests to use async API (#116909) 2024-05-06 08:10:45 -05:00
Erik Montnemery f5fe80bc90
Convert recorder init tests to use async API (#116918) 2024-05-06 07:59:39 -05:00
J. Nick Koston 6339c63176
Improve recorder and worker thread matching in RecorderPool (#116886)
* Improve recorder and worker thread matching in RecorderPool

Previously we would look at the name of the threads. This
was a brittle if because other integrations may name their
thread Recorder or DbWorker. Instead we now use explict thread
ids which ensures there will never be a conflict

* fix

* fixes

* fixes
2024-05-05 16:25:10 -04:00
Erik Montnemery e9b9d2d545
Convert recorder entity registry tests to use async API (#116448)
* Convert recorder entity registry tests to use async API

* Address review comment

* Make sure recorder is patch is set up before hass fixture
2024-05-03 14:10:58 +02:00
Erik Montnemery 27fcf72275
Convert history tests to use async API (#116447)
* Convert history tests to use async API

* Add new fixture to help patch recorder

* Modify

* Modify

* Update tests/conftest.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Rename fixture

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-03 08:14:46 +02:00
Erik Montnemery aa65f21be7
Fix flapping recorder tests (#116239) 2024-04-26 09:05:23 -05:00
Erik Montnemery 10be8f9683
Simplify timezone setting in recorder test (#116220) 2024-04-26 15:14:23 +02:00
karwosts 2ac44f6083
Make recorder.purge_entities require at least one entity filter value (#110066)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-04-22 20:10:18 +02:00