hass-core/tests/components/recorder
J. Nick Koston 00c1a3fd4e
Ensure legacy event foreign key is removed from the states table when a previous rebuild failed (#123388)
* Ensure legacy event foreign key is removed from the states table

If the system ran out of disk space removing the FK, it would
fail. #121938 fixed that to try again, however that PR was made
ineffective by #122069 since it will never reach the check.

To solve this, the migration version is incremented to 2, and
the migration is no longer marked as done unless the rebuild
/fk removal is successful.

* fix logic for mysql

* fix test

* asserts

* coverage

* coverage

* narrow test

* fixes

* split tests

* should have skipped

* fixture must be used
2024-08-09 06:19:12 +02:00
..
auto_repairs Avoid nesting sessions in recorder auto repairs tests (#122596) 2024-07-25 12:52:13 -05:00
table_managers Bump ruff to 0.3.4 (#112690) 2024-03-26 00:02:16 +01:00
__init__.py
common.py Run statistics on 5-minute intervals in tests (#122592) 2024-07-25 17:32:49 +02:00
conftest.py Refactor recorder schema migration (#122372) 2024-07-22 16:53:54 +02:00
db_schema_0.py Fix import-outside-toplevel pylint warnings in tests (#119389) 2024-06-11 14:57:50 +02:00
db_schema_9.py Update pylint to 3.2.5 (#122126) 2024-07-18 15:54:54 +02:00
db_schema_16.py Enable Ruff PGH rules (#115091) 2024-04-08 15:42:22 +02:00
db_schema_18.py Enable Ruff PGH rules (#115091) 2024-04-08 15:42:22 +02:00
db_schema_22.py Enable Ruff PGH rules (#115091) 2024-04-08 15:42:22 +02:00
db_schema_23.py Enable Ruff PGH rules (#115091) 2024-04-08 15:42:22 +02:00
db_schema_23_with_newer_columns.py Enable Ruff PGH rules (#115091) 2024-04-08 15:42:22 +02:00
db_schema_25.py Add first batch of Ruff PYI rules (#115100) 2024-04-07 11:30:50 -10:00
db_schema_28.py Add first batch of Ruff PYI rules (#115100) 2024-04-07 11:30:50 -10:00
db_schema_30.py Improve type hints in recorder result_processor (#121593) 2024-07-09 21:12:03 +02:00
db_schema_32.py Improve type hints in recorder result_processor (#121593) 2024-07-09 21:12:03 +02:00
db_schema_42.py Improve type hints in recorder result_processor (#121593) 2024-07-09 21:12:03 +02:00
db_schema_43.py Improve type hints in recorder result_processor (#121593) 2024-07-09 21:12:03 +02:00
test_backup.py Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
test_entity_registry.py Make the async_setup_recorder_instance fixture a context manager (#121086) 2024-07-03 14:05:34 -05:00
test_filters.py Update import locations in tests (#122216) 2024-07-20 11:16:04 +02:00
test_filters_with_entityfilter.py Update import locations in tests (#122216) 2024-07-20 11:16:04 +02:00
test_filters_with_entityfilter_schema_37.py Update import locations in tests (#122216) 2024-07-20 11:16:04 +02:00
test_history.py Add recorder test fixture for skipping tests by DB engine (#121118) 2024-07-04 00:02:46 +02:00
test_history_db_schema_30.py Make the async_setup_recorder_instance fixture a context manager (#121086) 2024-07-03 14:05:34 -05:00
test_history_db_schema_32.py Make the async_setup_recorder_instance fixture a context manager (#121086) 2024-07-03 14:05:34 -05:00
test_history_db_schema_42.py Add recorder test fixture for skipping tests by DB engine (#121118) 2024-07-04 00:02:46 +02:00
test_init.py Refactor recorder schema migration (#122372) 2024-07-22 16:53:54 +02:00
test_migrate.py Ensure legacy event foreign key is removed from the states table when a previous rebuild failed (#123388) 2024-08-09 06:19:12 +02:00
test_migration_from_schema_32.py Fix recorder datetime annotations (#122214) 2024-07-20 11:10:25 +02:00
test_migration_run_time_migrations_remember.py Refactor recorder data migration (#121009) 2024-07-16 21:50:19 +02:00
test_models.py Update ulid-transform to 0.10.1 (#121321) 2024-07-05 14:07:39 -05:00
test_models_legacy.py Add empty line after module docstring [tests q-s] (#112711) 2024-03-08 14:47:22 +01:00
test_pool.py Improve recorder and worker thread matching in RecorderPool (#116886) 2024-05-05 16:25:10 -04:00
test_purge.py Avoid nesting sessions in recorder purge tests (#122581) 2024-07-25 13:12:10 +02:00
test_purge_v32_schema.py Avoid nesting sessions in recorder purge tests (#122581) 2024-07-25 13:12:10 +02:00
test_statistics.py Add test of recorder platform with statistics support (#122754) 2024-07-29 11:57:53 +02:00
test_statistics_v23_migration.py Add recorder test fixture to enable persistent SQLite database (#121137) 2024-07-04 09:59:37 +02:00
test_system_health.py Add recorder test fixture for skipping tests by DB engine (#121118) 2024-07-04 00:02:46 +02:00
test_util.py Warn that the minimum SQLite version will change to 3.40.1 as of 2025.2 (#104298) 2024-07-31 08:13:04 -05:00
test_v32_migration.py Ensure legacy event foreign key is removed from the states table when a previous rebuild failed (#123388) 2024-08-09 06:19:12 +02:00
test_websocket_api.py Remove support for live schema migration of old recorder databases (#122399) 2024-07-29 15:52:18 +02:00