Commit Graph
75 Commits
Author SHA1 Message Date
Marc MuellerandGitHub 5e377b89fc Update pytest-asyncio to 1.0.0 (#145988)
* Update pytest-asyncio to 1.0.0

* Remove event_loop fixture uses
2025-06-02 06:12:22 +02:00
Erik MontnemeryandGitHub b192ca4bad Make it possible to subscribe to frontend user store (#144724) 2025-05-12 16:01:42 +02:00
Erik MontnemeryandGitHub dfd86d56ec Convert test fixtures to async (#142052) 2025-04-02 14:05:07 +02:00
Paul BotteinandGitHub e8975cffe6 Update hash regex for frontend file in tests (#131742) 2024-11-27 18:07:26 +01:00
Bram KragtenandGitHub 6788c43775 Add static routes for frontend modern and legacy service workers (#120488) (#122174)
* Bump frontend to 20240719.0

* restore #120488
2024-07-19 14:40:50 +02:00
Bram KragtenandGitHub c28a138dfe Revert "Add static routes for frontend modern and legacy service workers" (#122172) 2024-07-19 12:55:40 +02:00
Steve RepsherandGitHub e50802aca3 Add static routes for frontend modern and legacy service workers (#120488) 2024-07-19 10:53:37 +02:00
Marc MuellerandGitHub 2f0dd6f704 Import Generator from collections.abc (2) (#120915) 2024-07-01 11:58:49 +02:00
epenetandGitHub c7906f90a3 Improve type hints in frontend tests (#120739) 2024-06-28 13:36:26 +02:00
Erik MontnemeryandGitHub a10f9a5f6d Allow opting out of warnings when removing unknown frontend panel (#119824) 2024-06-21 15:56:22 +02:00
7940303149 Add WS command frontend/subscribe_extra_js (#119833)
Co-authored-by: Robert Resch <[email protected]>
2024-06-18 16:18:42 +02:00
J. Nick KostonandGitHub faa55de538 Fix blocking I/O in the event loop when registering static paths (#119629) 2024-06-18 08:18:31 +02:00
Erik MontnemeryandGitHub 8af5748716 Add frontend.remove_extra_js_url (#119831) 2024-06-17 15:15:00 +02:00
Erik MontnemeryandGitHub c0a3b507c0 Add tests of frontend.add_extra_js_url (#119826) 2024-06-17 14:39:07 +02:00
epenetandGitHub fbaba3753b Fix root-import pylint warning in components (#119294)
* Fix root-import pylint warning in components

* Adjust

* Adjust
2024-06-10 15:14:49 +02:00
epenetandGitHub 492b158818 Add return type hints in tests (a-i) (#118939) 2024-06-06 12:17:08 +02:00
epenetandGitHub 092cdcfe91 Improve type hints in tests (a-h) (#118379) 2024-05-30 08:46:18 +02:00
epenetandGitHub 461ac1e0bc Add ClientSessionGenerator type hints in tests (#118377) 2024-05-29 14:49:14 +02:00
epenetandGitHub a59621bf9e Add more type hints to pylint plugin (#118319) 2024-05-28 18:37:38 +02:00
Jan-Philipp BeneckeandGitHub 08529b3806 Remove deprecated hass.components from frontend tests (#114011) 2024-03-22 17:35:43 +01:00
Marc MuellerandGitHub c88b337600 Add empty line after module docstring [tests f-k] (#112709) 2024-03-08 14:50:04 +01:00
J. Nick KostonandGitHub 5b8591ec7e Avoid reschedule churn in Storage.async_delay_save (#111091)
* Avoid circular import in Storage.async_delay_save

We call Storage.async_delay_save for every entity being added or removed
from the registry. The late import took more time than everything else
in the function.

* Avoid reschedule churn in Storage.async_delay_save

When we are adding or removing entities we will call async_delay_save
quite often which has to add and remove a TimerHandle on the event loop
which can add up when there are a lot of registry items changing.

If the timer handle still has 80% of the time remaining on it
we will avoid resceduling and let it fire at the time the
original async_delay_save call was made. This ensures we
do not force the event loop to rebuild its heapq because
too many timer handlers were cancelled at once

* div0

* add coverage for 0 since we had none

* fix bad conflict

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* more test fixes

* mqtt tests rely on event loop overhead
2024-02-24 08:46:00 +01:00
01372024f5 Add icon translations support (#103294)
Co-authored-by: Robert Resch <[email protected]>
Co-authored-by: Paul Bottein <[email protected]>
2024-01-19 16:56:56 +01:00
Bram KragtenandGitHub f5a6c88051 Don't load themes in safe mode (#102683) 2023-10-24 23:00:14 +02:00
Erik MontnemeryandGitHub 97cc05d0b4 Make it possible to restart core in safe mode (#102606) 2023-10-24 14:47:58 +02:00
Erik MontnemeryandGitHub e20d4abfe1 Test extra javascript functionality in frontend (#102643) 2023-10-24 11:31:16 +02:00
Erik MontnemeryandGitHub 421832e09c Remove unused test fixture from frontend tests (#102642) 2023-10-24 11:13:44 +02:00
Erik MontnemeryandGitHub c481fdb7d0 Rename safe mode to recovery mode (#102580) 2023-10-23 20:33:08 +02:00
Ville SkyttäandGitHub 70c49824d7 Import util.dt as dt_util in components/[e-f]* (#93758) 2023-05-30 00:00:11 +03:00
Paulus SchoutsenandGitHub 79101b31d5 Fix frontend test again (#90754) 2023-04-04 00:11:20 -04:00
Paulus SchoutsenandGitHub c5a87addc1 Fix frontend test (#90679) 2023-04-02 14:28:52 -04:00
epenetandGitHub 1e352b60df Add type hints to integration tests (part 11) (#87996) 2023-02-13 14:22:49 +01:00
epenetandGitHub b68f502769 Add type hints to integration tests (part 7) (#87980) 2023-02-13 09:53:09 +01:00
epenetandGitHub 7a4d15a657 Add type hints to integration tests (f-g) (#87700) 2023-02-08 13:33:52 +01:00
Joakim PlateandGitHub c576a68d33 Upgrade pytest-aiohttp (#82475)
* Upgrade pytest-aiohttp

* Make sure executors, tasks and timers are closed

Some test will trigger warnings on garbage collect, these warnings
spills over into next test.

Some test trigger tasks that raise errors on shutdown, these spill
over into next test.

This is to mimic older pytest-aiohttp and it's behaviour on test
cleanup.

Discussions on similar changes for pytest-aiohttp are here:
https://github.com/pytest-dev/pytest-asyncio/pull/309

* Replace loop with event_loop

* Make sure time is frozen for tests

* Make sure the ConditionType is not async

  /home-assistant/homeassistant/helpers/template.py:2082: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
    def wrapper(*args, **kwargs):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

* Increase litejet press tests with a factor 10

The times are simulated anyway, and we can't stop the normal
event from occuring.

* Use async handlers for aiohttp

tests/components/motioneye/test_camera.py::test_get_still_image_from_camera
tests/components/motioneye/test_camera.py::test_get_still_image_from_camera
tests/components/motioneye/test_camera.py::test_get_stream_from_camera
tests/components/motioneye/test_camera.py::test_get_stream_from_camera
tests/components/motioneye/test_camera.py::test_camera_option_stream_url_template
tests/components/motioneye/test_camera.py::test_camera_option_stream_url_template
  /Users/joakim/src/hass/home-assistant/venv/lib/python3.9/site-packages/aiohttp/web_urldispatcher.py:189: DeprecationWarning: Bare functions are deprecated, use async ones
    warnings.warn(

* Switch to freezegun in modbus tests

The tests allowed clock to tick in between steps

* Make sure skybell object are fully mocked

Old tests would trigger attempts to post to could services:

```
DEBUG:aioskybell:HTTP post https://cloud.myskybell.com/api/v3/login/ Request with headers: {'content-type': 'application/json', 'accept': '*/*', 'x-skybell-app-id': 'd2b542c7-a7e4-4e1e-b77d-2b76911c7c46', 'x-skybell-client-id': '1f36a3c0-6dee-4997-a6db-4e1c67338e57'}
```

* Fix sorting that broke after rebase
2022-11-29 22:36:36 +01:00
J. Nick KostonandGitHub 332cf3cd2d Resolve and caches paths for CachingStaticResource in the executor (#74474) 2022-07-06 13:49:48 -05:00
J. Nick KostonandGitHub a614ddca28 Support requesting translations for multiple integrations in a single request (#71979) 2022-05-17 01:23:11 -05:00
Ville SkyttäandGitHub b1360ffafb Use http.HTTPStatus in components/f* (#58244) 2021-10-22 22:10:47 +02:00
Erik MontnemeryandGitHub f6682ba99d Block tests from opening sockets (#55516) 2021-10-05 14:46:09 -10:00
Philip AllgaierandGitHub d8ff52e55b Add support for custom themes to use dark mode (#46532) 2021-05-25 13:26:24 +02:00
J. Nick KostonandGitHub 344717d07d Reduce time to first byte for frontend index (#49396)
Cache template and manifest.json generation
2021-04-18 21:17:30 -07:00
Paulus SchoutsenandGitHub 87d40ff815 Do not cache frontend files during dev (#45698) 2021-01-30 00:05:06 +01:00
Franck NijhofandGitHub 65cf2fcb6f Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Philip AllgaierandGitHub 9c1eb78a0f Adjust safe_theme for better readability (#40223) 2020-09-23 18:57:35 +02:00
Paulus SchoutsenandGitHub c6cba5ebc8 Remove HTML support from frontend (#39799) 2020-09-08 15:42:50 +02:00
Paulus SchoutsenandGitHub fbbfd46fb8 Add .well-known/password-change (#39613) 2020-09-03 18:13:33 +02:00
d66ddeb69e Allow to set default dark theme and persist frontend default themes (#38548)
Co-authored-by: Paulus Schoutsen <[email protected]>
2020-08-05 17:42:23 +02:00
Paulus SchoutsenandGitHub ec47216388 Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Paulus SchoutsenandGitHub f436e29a0d Add frontend version WS command (#34701) 2020-04-25 17:30:15 -07:00
Paulus SchoutsenandGitHub 98f1548f2d Allow fetching translations by categories (#34329) 2020-04-18 17:13:13 -07:00