2022-01-15 00:20:08 +00:00
|
|
|
{ lib
|
|
|
|
, home-assistant
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# some components' tests have additional dependencies
|
|
|
|
extraCheckInputs = with home-assistant.python.pkgs; {
|
2022-04-06 18:12:44 +01:00
|
|
|
alexa = [ av ];
|
2022-08-16 11:54:08 +01:00
|
|
|
bluetooth = [ pyswitchbot ];
|
2022-04-06 18:12:44 +01:00
|
|
|
camera = [ av ];
|
2022-01-15 00:20:08 +00:00
|
|
|
cloud = [ mutagen ];
|
|
|
|
config = [ pydispatcher ];
|
2022-04-06 18:12:44 +01:00
|
|
|
generic = [ av ];
|
2022-01-15 00:20:08 +00:00
|
|
|
google_translate = [ mutagen ];
|
2022-07-06 22:09:18 +01:00
|
|
|
homeassistant_yellow = [ bellows zha-quirks zigpy-deconz zigpy-xbee zigpy-zigate zigpy-znp ];
|
2022-03-02 19:25:38 +00:00
|
|
|
lovelace = [ PyChromecast ];
|
2022-04-06 18:12:44 +01:00
|
|
|
nest = [ av ];
|
2022-03-02 19:25:38 +00:00
|
|
|
onboarding = [ pymetno radios rpi-bad-power ];
|
2022-06-01 17:49:28 +01:00
|
|
|
raspberry_pi = [ rpi-bad-power ];
|
2022-04-17 18:05:47 +01:00
|
|
|
tomorrowio = [ pyclimacell ];
|
2022-02-09 18:57:58 +00:00
|
|
|
version = [ aioaseko ];
|
2022-01-15 00:20:08 +00:00
|
|
|
voicerss = [ mutagen ];
|
|
|
|
yandextts = [ mutagen ];
|
|
|
|
zha = [ pydeconz ];
|
|
|
|
zwave_js = [ homeassistant-pyozw ];
|
|
|
|
};
|
|
|
|
|
|
|
|
extraDisabledTestPaths = {
|
|
|
|
tado = [
|
|
|
|
# tado/test_{climate,water_heater}.py: Tries to connect to my.tado.com
|
|
|
|
"tests/components/tado/test_climate.py"
|
|
|
|
"tests/components/tado/test_water_heater.py"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2022-03-02 19:25:38 +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-07-06 22:09:18 +01:00
|
|
|
rfxtrx = [
|
|
|
|
# bytearrray mismatch
|
|
|
|
"test_rfy_cover"
|
|
|
|
];
|
2022-03-02 19:25:38 +00:00
|
|
|
};
|
|
|
|
|
2022-01-15 00:20:08 +00:00
|
|
|
extraPytestFlagsArray = {
|
|
|
|
asuswrt = [
|
2022-07-06 22:09:18 +01:00
|
|
|
# Sandbox network limitations, fails with unexpected error
|
2022-01-15 00:20:08 +00:00
|
|
|
"--deselect tests/components/asuswrt/test_config_flow.py::test_on_connect_failed"
|
|
|
|
];
|
2022-07-06 22:09:18 +01:00
|
|
|
history_stats = [
|
|
|
|
# Flaky: AssertionError: assert '0.0' == '12.0'
|
|
|
|
"--deselect tests/components/history_stats/test_sensor.py::test_end_time_with_microseconds_zeroed"
|
|
|
|
];
|
|
|
|
skybell = [
|
|
|
|
# Sandbox network limitations: Cannot connect to host cloud.myskybell.com:443
|
|
|
|
"--deselect tests/components/skybell/test_config_flow.py::test_flow_user_unknown_error"
|
|
|
|
];
|
|
|
|
stream = [
|
|
|
|
# Tries to write to /example and gets "Permission denied"
|
|
|
|
"--deselect tests/components/stream/test_recorder.py::test_record_lookback"
|
|
|
|
"--deselect tests/components/stream/test_recorder.py::test_recorder_log"
|
|
|
|
"--deselect tests/components/stream/test_worker.py::test_get_image"
|
|
|
|
];
|
2022-01-15 00:20:08 +00:00
|
|
|
};
|
|
|
|
in lib.listToAttrs (map (component: lib.nameValuePair component (
|
|
|
|
home-assistant.overridePythonAttrs (old: {
|
|
|
|
pname = "homeassistant-test-${component}";
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontInstall = true;
|
|
|
|
|
|
|
|
checkInputs = old.checkInputs
|
|
|
|
++ home-assistant.getPackages component home-assistant.python.pkgs
|
|
|
|
++ extraCheckInputs.${component} or [ ];
|
|
|
|
|
2022-03-02 19:25:38 +00:00
|
|
|
disabledTests = old.disabledTests ++ extraDisabledTests.${component} or [];
|
2022-01-15 00:20:08 +00:00
|
|
|
disabledTestPaths = old.disabledTestPaths ++ extraDisabledTestPaths.${component} or [ ];
|
|
|
|
|
2022-04-14 01:54:53 +01:00
|
|
|
# components are more often racy than the core
|
|
|
|
dontUsePytestXdist = true;
|
|
|
|
|
2022-01-15 00:20:08 +00:00
|
|
|
pytestFlagsArray = lib.remove "tests" old.pytestFlagsArray
|
2022-04-14 01:54:53 +01:00
|
|
|
++ [ "--numprocesses=4" ]
|
2022-01-15 00:20:08 +00:00
|
|
|
++ extraPytestFlagsArray.${component} or [ ]
|
|
|
|
++ [ "tests/components/${component}" ];
|
|
|
|
|
2022-02-02 20:53:50 +00:00
|
|
|
preCheck = old.preCheck + lib.optionalString (builtins.elem component [ "emulated_hue" "songpal" "system_log" ]) ''
|
2022-01-15 00:20:08 +00:00
|
|
|
patch -p1 < ${./patches/tests-mock-source-ip.patch}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = old.meta // {
|
|
|
|
broken = lib.elem component [
|
2022-07-06 22:09:18 +01:00
|
|
|
"blebox" # all tests fail with: AttributeError: Mock object has no attribute 'async_from_host'
|
2022-02-02 20:53:50 +00:00
|
|
|
"dnsip"
|
2022-04-06 18:12:44 +01:00
|
|
|
"ssdp"
|
|
|
|
"subaru"
|
2022-01-15 00:20:08 +00:00
|
|
|
];
|
|
|
|
# upstream only tests on Linux, so do we.
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
})
|
|
|
|
)) home-assistant.supportedComponentsWithTests)
|