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 ];
|
2022-03-05 16:20:37 +00:00
|
|
|
lovelace = [ PyChromecast ];
|
2022-04-15 01:41:22 +00:00
|
|
|
nest = [ av ];
|
2022-03-05 16:20:37 +00:00
|
|
|
onboarding = [ pymetno radios rpi-bad-power ];
|
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 = {
|
|
|
|
roku = [
|
|
|
|
# homeassistant.components.roku.media_player:media_player.py:428 Media type music is not supported with format None (mime: audio/x-matroska)
|
|
|
|
"test_services_play_media_audio"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
extraPytestFlagsArray = {
|
2022-10-06 18:32:54 +00:00
|
|
|
dnsip = [
|
|
|
|
# AssertionError: assert <FlowResultType.FORM: 'form'> == <FlowResultTy...create_entry'>
|
|
|
|
"--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-02-02 18:25:31 +00:00
|
|
|
logbook = [
|
|
|
|
"--deselect tests/components/logbook/test_websocket_api.py::test_recorder_is_far_behind "
|
|
|
|
];
|
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"
|
|
|
|
];
|
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"
|
|
|
|
];
|
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 [ ];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
disabledTests = old.disabledTests ++ extraDisabledTests.${component} or [];
|
2022-01-19 23:45:15 +00:00
|
|
|
disabledTestPaths = old.disabledTestPaths ++ extraDisabledTestPaths.${component} or [ ];
|
|
|
|
|
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
|
2022-04-27 09:35:20 +00:00
|
|
|
++ [ "--numprocesses=4" ]
|
2022-01-19 23:45:15 +00:00
|
|
|
++ 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)
|