2022-01-19 23:45:15 +00:00
|
|
|
{ lib
|
|
|
|
, home-assistant
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# some components' tests have additional dependencies
|
|
|
|
extraCheckInputs = with home-assistant.python.pkgs; {
|
2022-04-15 01:41:22 +00:00
|
|
|
alexa = [ av ];
|
2022-08-21 13:32:41 +00:00
|
|
|
bluetooth = [ pyswitchbot ];
|
2022-09-11 15:47:08 +00:00
|
|
|
bthome = [ xiaomi-ble ];
|
2022-04-15 01:41:22 +00:00
|
|
|
camera = [ av ];
|
2022-01-19 23:45:15 +00:00
|
|
|
cloud = [ mutagen ];
|
|
|
|
config = [ pydispatcher ];
|
2022-04-15 01:41:22 +00:00
|
|
|
generic = [ av ];
|
2022-01-19 23:45:15 +00:00
|
|
|
google_translate = [ mutagen ];
|
2022-10-06 18:32:54 +00:00
|
|
|
google_sheets = [ oauth2client ];
|
2023-01-11 07:51:40 +00:00
|
|
|
govee_ble = [ ibeacon-ble ];
|
2022-12-17 10:02:37 +00:00
|
|
|
hassio = [ bellows zha-quirks zigpy-deconz zigpy-xbee zigpy-zigate zigpy-znp ];
|
|
|
|
homeassistant_sky_connect = [ bellows zha-quirks zigpy-deconz zigpy-xbee zigpy-zigate zigpy-znp zwave-js-server-python ];
|
2022-07-14 12:49:19 +00:00
|
|
|
homeassistant_yellow = [ bellows zha-quirks zigpy-deconz zigpy-xbee zigpy-zigate zigpy-znp ];
|
2023-03-15 16:39:30 +00:00
|
|
|
lovelace = [ pychromecast ];
|
2023-03-04 12:14:45 +00:00
|
|
|
mopeka = [ pyswitchbot ];
|
2022-04-15 01:41:22 +00:00
|
|
|
nest = [ av ];
|
2022-03-05 16:20:37 +00:00
|
|
|
onboarding = [ pymetno radios rpi-bad-power ];
|
2023-03-04 12:14:45 +00:00
|
|
|
otbr = [ bellows zha-quirks zigpy-deconz zigpy-xbee zigpy-zigate zigpy-znp ];
|
2022-06-16 17:23:12 +00:00
|
|
|
raspberry_pi = [ rpi-bad-power ];
|
2022-12-17 10:02:37 +00:00
|
|
|
shelly = [ pyswitchbot ];
|
2022-10-06 18:32:54 +00:00
|
|
|
tilt_ble = [ govee-ble ibeacon-ble ];
|
2022-04-27 09:35:20 +00:00
|
|
|
tomorrowio = [ pyclimacell ];
|
2022-02-20 05:27:41 +00:00
|
|
|
version = [ aioaseko ];
|
2022-09-11 15:47:08 +00:00
|
|
|
xiaomi_miio = [ arrow ];
|
2022-01-19 23:45:15 +00:00
|
|
|
voicerss = [ mutagen ];
|
|
|
|
yandextts = [ mutagen ];
|
|
|
|
zha = [ pydeconz ];
|
|
|
|
zwave_js = [ homeassistant-pyozw ];
|
|
|
|
};
|
|
|
|
|
|
|
|
extraDisabledTestPaths = {
|
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
extraDisabledTests = {
|
2023-04-12 12:48:02 +00:00
|
|
|
vesync = [
|
|
|
|
# homeassistant.components.vesync:config_validation.py:863 The 'vesync' option has been removed, please remove it from your configuration
|
|
|
|
"test_async_get_config_entry_diagnostics__single_humidifier"
|
|
|
|
"test_async_get_device_diagnostics__single_fan"
|
2022-03-05 16:20:37 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
extraPytestFlagsArray = {
|
2023-07-15 17:15:38 +00:00
|
|
|
conversation = [
|
|
|
|
"--deselect tests/components/conversation/test_init.py::test_get_agent_list"
|
|
|
|
];
|
2022-10-06 18:32:54 +00:00
|
|
|
dnsip = [
|
2023-04-12 12:48:02 +00:00
|
|
|
# Tries to resolve DNS entries
|
2022-10-06 18:32:54 +00:00
|
|
|
"--deselect tests/components/dnsip/test_config_flow.py::test_options_flow"
|
|
|
|
];
|
2022-07-14 12:49:19 +00:00
|
|
|
history_stats = [
|
|
|
|
# Flaky: AssertionError: assert '0.0' == '12.0'
|
|
|
|
"--deselect tests/components/history_stats/test_sensor.py::test_end_time_with_microseconds_zeroed"
|
|
|
|
];
|
2023-03-04 12:14:45 +00:00
|
|
|
modbus = [
|
2023-04-12 12:48:02 +00:00
|
|
|
# homeassistant.components.modbus.modbus:modbus.py:317 Pymodbus: modbusTest: Modbus Error: test connect exception
|
2023-03-04 12:14:45 +00:00
|
|
|
"--deselect tests/components/modbus/test_init.py::test_pymodbus_connect_fail"
|
|
|
|
];
|
2022-11-04 12:27:35 +00:00
|
|
|
modem_callerid = [
|
|
|
|
# aioserial mock produces wrong state
|
|
|
|
"--deselect tests/components/modem_callerid/test_init.py::test_setup_entry"
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
sonos = [
|
|
|
|
# KeyError: 'sonos_media_player'
|
|
|
|
"--deselect tests/components/sonos/test_init.py::test_async_poll_manual_hosts_warnings"
|
|
|
|
"--deselect tests/components/sonos/test_init.py::test_async_poll_manual_hosts_3"
|
|
|
|
];
|
2022-12-17 10:02:37 +00:00
|
|
|
unifiprotect = [
|
|
|
|
# "TypeError: object Mock can't be used in 'await' expression
|
|
|
|
"--deselect tests/components/unifiprotect/test_repairs.py::test_ea_warning_fix"
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
zha = [
|
|
|
|
"--deselect tests/components/zha/test_config_flow.py::test_formation_strategy_restore_manual_backup_non_ezsp"
|
|
|
|
"--deselect tests/components/zha/test_config_flow.py::test_formation_strategy_restore_automatic_backup_non_ezsp"
|
|
|
|
];
|
2022-01-19 23:45:15 +00:00
|
|
|
};
|
|
|
|
in lib.listToAttrs (map (component: lib.nameValuePair component (
|
|
|
|
home-assistant.overridePythonAttrs (old: {
|
|
|
|
pname = "homeassistant-test-${component}";
|
2022-09-30 11:47:45 +00:00
|
|
|
format = "other";
|
2022-01-19 23:45:15 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontInstall = true;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = old.nativeCheckInputs
|
2022-01-19 23:45:15 +00:00
|
|
|
++ home-assistant.getPackages component home-assistant.python.pkgs
|
|
|
|
++ extraCheckInputs.${component} or [ ];
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
disabledTests = old.disabledTests or [] ++ extraDisabledTests.${component} or [];
|
|
|
|
disabledTestPaths = old.disabledTestPaths or [] ++ extraDisabledTestPaths.${component} or [ ];
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
# components are more often racy than the core
|
|
|
|
dontUsePytestXdist = true;
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
pytestFlagsArray = lib.remove "tests" old.pytestFlagsArray
|
|
|
|
++ extraPytestFlagsArray.${component} or [ ]
|
|
|
|
++ [ "tests/components/${component}" ];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
preCheck = old.preCheck + lib.optionalString (builtins.elem component [ "emulated_hue" "songpal" "system_log" ]) ''
|
2022-01-19 23:45:15 +00:00
|
|
|
patch -p1 < ${./patches/tests-mock-source-ip.patch}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = old.meta // {
|
|
|
|
broken = lib.elem component [
|
|
|
|
];
|
|
|
|
# upstream only tests on Linux, so do we.
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
})
|
|
|
|
)) home-assistant.supportedComponentsWithTests)
|