6 getComponentDeps = component: home-assistant.getPackages component home-assistant.python.pkgs;
8 # some components' tests have additional dependencies
9 extraCheckInputs = with home-assistant.python.pkgs; {
10 axis = getComponentDeps "deconz";
11 gardena_bluetooth = getComponentDeps "husqvarna_automower_ble";
15 hassio = getComponentDeps "homeassistant_yellow";
16 husqvarna_automower_ble = getComponentDeps "gardena_bluetooth";
40 tesla_fleet = getComponentDeps "teslemetry";
52 extraDisabledTestPaths = {
55 extraDisabledTests = {
57 # tries to retrieve file from github
58 "test_non_text_stdout_capture"
61 # missing operating_status attribute in entity
62 "test_sensor_entities"
65 # AssertionError: assert 'unknown_error' == 'template_error'
66 "test_render_template_with_timeout"
70 extraPytestFlagsArray = {
72 # Expected: Sorry, I am not aware of any device called missing entity on ground floor
73 # Actually: Sorry, I am not aware of any area called ground floor
74 "--deselect tests/components/conversation/test_default_agent.py::test_error_no_device_on_floor"
77 # Tries to resolve DNS entries
78 "--deselect tests/components/dnsip/test_config_flow.py::test_options_flow"
81 # Failed: Unused ignore translations: component.honeywell.config.abort.reauth_successful. Please remove them from the ignore_translations fixture.
82 "--deselect=tests/components/honeywell/test_config_flow.py::test_reauth_flow"
85 # AssertionError: assert 'audio/x-flac' == 'audio/flac'
86 "--deselect tests/components/jellyfin/test_media_source.py::test_resolve"
87 "--deselect tests/components/jellyfin/test_media_source.py::test_audio_codec_resolve"
88 # AssertionError: assert [+ received] == [- snapshot]
89 "--deselect tests/components/jellyfin/test_media_source.py::test_music_library"
92 # Failed: Unused ignore translations: component.jewish_calendar.config.abort.reconfigure_successful. Please remove them from the ignore_translations fixture.
93 "--deselect tests/components/jewish_calendar/test_config_flow.py::test_reconfigure"
96 # aioserial mock produces wrong state
97 "--deselect tests/components/modem_callerid/test_init.py::test_setup_entry"
100 # Failed: Unused ignore translations: component.nina.options.error.unknown. Please remove them from the ignore_translations fixture.
101 "--deselect tests/components/nina/test_config_flow.py::test_options_flow_unexpected_exception"
105 "ignore::sqlalchemy.exc.SAWarning"
108 # Snapshot 'test_all_entities[sensor.model0_electricity_consumption_today-entry]' does not exist!
109 "--deselect=tests/components/vicare/test_sensor.py::test_all_entities"
112 in lib.listToAttrs (map (component: lib.nameValuePair component (
113 home-assistant.overridePythonAttrs (old: {
114 pname = "homeassistant-test-${component}";
121 nativeCheckInputs = old.nativeCheckInputs
122 ++ home-assistant.getPackages component home-assistant.python.pkgs
123 ++ extraCheckInputs.${component} or [ ];
125 disabledTests = old.disabledTests or [] ++ extraDisabledTests.${component} or [];
126 disabledTestPaths = old.disabledTestPaths or [] ++ extraDisabledTestPaths.${component} or [ ];
128 # components are more often racy than the core
129 dontUsePytestXdist = true;
131 pytestFlagsArray = lib.remove "tests" old.pytestFlagsArray
132 ++ extraPytestFlagsArray.${component} or [ ]
133 ++ [ "tests/components/${component}" ];
135 preCheck = old.preCheck + lib.optionalString (builtins.elem component [ "emulated_hue" "songpal" "system_log" ]) ''
136 patch -p1 < ${./patches/tests-mock-source-ip.patch}
140 broken = lib.elem component [ ];
141 # upstream only tests on Linux, so do we.
142 platforms = lib.platforms.linux;
145 )) home-assistant.supportedComponentsWithTests)