git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #123456 from mweinelt/home-assistant-tests
commiteaf59b9de36288b9138b26dab181a082ce90855d authorMartin Weinelt <mweinelt@users.noreply.github.com> dateWed 19 May 2021, 18:33 (5 years ago) parentaac7a9127cc2b1
3 files changed+267−18
pkgs/development/python-modules/pyflume/default.nix+2−2 pkgs/servers/home-assistant/component-packages.nix+2−2 pkgs/servers/home-assistant/default.nix+263−14
pkgs/development/python-modules/pyflume/default.nix+2−2
@@ -12,14 +12,14 @@
1212
1313buildPythonPackage rec {
1414 pname = "pyflume";
15− version = "0.6.4";
15+ version = "0.7.0";
1616 disabled = pythonOlder "3.7";
1717
1818 src = fetchFromGitHub {
1919 owner = "ChrisMandich";
2020 repo = "PyFlume";
2121 rev = "v${version}";
22− sha256 = "1dm560hh6fl1waiwsq8m31apmvvwhc3y95bfdb7449bs8k96dmxq";
22+ sha256 = "129sz33a270v120bzl9l98nmvdzn7ns4cf9w2v18lmzlldbyz2vn";
2323 };
2424
2525 prePatch = ''
pkgs/servers/home-assistant/component-packages.nix+2−2
@@ -89,7 +89,7 @@
8989 "bloomsky" = ps: with ps; [ ];
9090 "blueprint" = ps: with ps; [ ];
9191 "bluesound" = ps: with ps; [ xmltodict ];
92− "bluetooth_le_tracker" = ps: with ps; [ ]; # missing inputs: pygatt[GATTTOOL]
92+ "bluetooth_le_tracker" = ps: with ps; [ pygatt ];
9393 "bluetooth_tracker" = ps: with ps; [ bt_proximity pybluez ];
9494 "bme280" = ps: with ps; [ smbus-cffi ]; # missing inputs: i2csense
9595 "bme680" = ps: with ps; [ bme680 smbus-cffi ];
@@ -755,7 +755,7 @@
755755 "sinch" = ps: with ps; [ ]; # missing inputs: clx-sdk-xms
756756 "sisyphus" = ps: with ps; [ ]; # missing inputs: sisyphus-control
757757 "sky_hub" = ps: with ps; [ ]; # missing inputs: pyskyqhub
758− "skybeacon" = ps: with ps; [ ]; # missing inputs: pygatt[GATTTOOL]
758+ "skybeacon" = ps: with ps; [ pygatt ];
759759 "skybell" = ps: with ps; [ skybellpy ];
760760 "slack" = ps: with ps; [ slackclient ];
761761 "sleepiq" = ps: with ps; [ sleepyq ];
pkgs/servers/home-assistant/default.nix+263−14
@@ -2,6 +2,7 @@
22, lib
33, fetchFromGitHub
44, python3
5+, inetutils
56, nixosTests
67
78# Look up dependencies of specified components in component-packages.nix
@@ -55,6 +56,46 @@ let
5556 (mkOverride "ring-doorbell" "0.6.2"
5657 "fbd537722a27b3b854c26506d894b7399bb8dc57ff36083285971227a2d46560")
5758
59+ # Pinned due to API changes in pyflunearyou>=2.0
60+ (self: super: {
61+ pyflunearyou = super.pyflunearyou.overridePythonAttrs (oldAttrs: rec {
62+ version = "1.0.7";
63+ src = fetchFromGitHub {
64+ owner = "bachya";
65+ repo = "pyflunearyou";
66+ rev = version;
67+ sha256 = "0hq55k298m9a90qb3lasw9bi093hzndrah00rfq94bp53aq0is99";
68+ };
69+ postPatch = ''
70+ substituteInPlace pyproject.toml \
71+ --replace "poetry.masonry.api" "poetry.core.masonry.api" \
72+ --replace 'msgpack = "^0.6.2"' 'msgpack = "*"' \
73+ --replace 'ujson = "^1.35"' 'ujson = "*"'
74+ '';
75+ });
76+ })
77+
78+ # Pinned due to API changes in pylast 4.2.1
79+ (mkOverride "pylast" "4.2.0"
80+ "0zd0dn2l738ndz62vpa751z0ldnm91dcz9zzbvxv53r08l0s9yf3")
81+
82+ # Pinned due to API changes in pyopenuv>=1.1.0
83+ (self: super: {
84+ pyopenuv = super.pyopenuv.overridePythonAttrs (oldAttrs: rec {
85+ version = "1.0.13";
86+ src = fetchFromGitHub {
87+ owner = "bachya";
88+ repo = "pyopenuv";
89+ rev = version;
90+ sha256 = "1gx9xjkyvqqy8410lnbshq1j5y4cb0cdc4m505g17rwdzdwb01y8";
91+ };
92+ postPatch = ''
93+ substituteInPlace pyproject.toml \
94+ --replace "poetry.masonry.api" "poetry.core.masonry.api"
95+ '';
96+ });
97+ })
98+
5899 # Pinned due to API changes in pyruckus>0.12
59100 (self: super: {
60101 pyruckus = super.pyruckus.overridePythonAttrs (oldAttrs: rec {
@@ -199,33 +240,69 @@ in with py.pkgs; buildPythonApplication rec {
199240 # services. Before adding new components to this list make sure we have all
200241 # its dependencies packaged and listed in ./component-packages.nix.
201242 componentTests = [
243+ "abode"
202244 "accuweather"
245+ "acmeda"
246+ "adguard"
247+ "advantage_air"
248+ "agent_dvr"
249+ "air_quality"
203250 "airly"
251+ "airnow"
252+ "airvisual"
253+ "alarm_control_panel"
254+ "alarmdecoder"
255+ "alert"
256+ "alexa"
257+ "almond"
258+ "ambiclimate"
259+ "ambient_station"
204260 "analytics"
205261 "androidtv"
206− "alert"
262+ "apache_kafka"
207263 "api"
264+ "apple_tv"
265+ "apprise"
266+ "arlo"
267+ "asuswrt"
268+ "august"
269+ "aurora"
208270 "auth"
209271 "automation"
272+ "awair"
273+ "aws"
210274 "axis"
211275 "bayesian"
212276 "binary_sensor"
277+ "blackbird"
278+ "blueprint"
279+ "bluetooth_le_tracker"
280+ "braviatv"
281+ "broadlink"
213282 "brother"
283+ "bsblan"
214284 "caldav"
215285 "calendar"
216286 "camera"
217287 "canary"
218288 "cast"
289+ "cert_expiry"
219290 "climacell"
220291 "climate"
221292 "cloud"
293+ "cloudflare"
222294 "comfoconnect"
223295 "command_line"
296+ "compensation"
224297 "config"
225298 "configurator"
226299 "conversation"
300+ "coronavirus"
227301 "counter"
228302 "cover"
303+ "daikin"
304+ "darksky"
305+ "datadog"
229306 "deconz"
230307 "default_config"
231308 "demo"
@@ -235,22 +312,42 @@ in with py.pkgs; buildPythonApplication rec {
235312 "device_sun_light_trigger"
236313 "device_tracker"
237314 "devolo_home_control"
315+ "dexcom"
238316 "dhcp"
317+ "dialogflow"
239318 "discovery"
240319 "dsmr"
320+ "dte_energy_bridge"
321+ "duckdns"
322+ "dyson"
323+ "eafm"
241324 "econet"
325+ "efergy"
326+ "emonitor"
242327 "emulated_hue"
243328 "esphome"
244− "fan"
329+ "everlights"
330+ "ezviz"
245331 "faa_delays"
332+ "facebook"
333+ "facebox"
334+ "fail2ban"
335+ "fan"
336+ "feedreader"
246337 "ffmpeg"
338+ "fido"
247339 "file"
248340 "filesize"
249341 "filter"
342+ "firmata"
343+ "flo"
344+ "flume"
345+ "flunearyou"
250346 "flux"
251347 "folder"
252348 "folder_watcher"
253349 "freebox"
350+ "freedns"
254351 "fritz"
255352 "fritzbox"
256353 "fritzbox_callmonitor"
@@ -259,59 +356,97 @@ in with py.pkgs; buildPythonApplication rec {
259356 "generic_thermostat"
260357 "geo_json_events"
261358 "geo_location"
359+ "geofency"
360+ "glances"
361+ "google"
362+ "google_assistant"
363+ "google_domains"
364+ "google_pubsub"
365+ "google_translate"
366+ "google_travel_time"
367+ "google_wifi"
368+ "gpslogger"
369+ "graphite"
262370 "group"
371+ "guardian"
372+ "harmony"
373+ "hassio"
263374 "hddtemp"
264375 "history"
265376 "history_stats"
266377 "home_connect"
267378 "home_plus_control"
379+ "homeassistant"
268380 "homekit"
269381 "homekit_controller"
270− "homeassistant"
271382 "homematic"
272383 "homematicip_cloud"
273384 "html5"
274385 "http"
275386 "hue"
387+ "humidifier"
276388 "hyperion"
389+ "ialarm"
277390 "iaqualink"
391+ "icloud"
278392 "ifttt"
279393 "image"
280394 "image_processing"
395+ "imap_email_content"
281396 "influxdb"
282397 "input_boolean"
283398 "input_datetime"
284− "input_text"
285399 "input_number"
286400 "input_select"
401+ "input_text"
402+ "insteon"
403+ "integration"
287404 "intent"
288405 "intent_script"
406+ "ios"
289407 "ipp"
408+ "iqvia"
290409 "islamic_prayer_times"
291410 "jewish_calendar"
411+ "kira"
292412 "kmtronic"
293413 "knx"
294414 "kodi"
415+ "lastfm"
416+ "lcn"
295417 "light"
296418 "litterrobot"
297419 "local_file"
298420 "local_ip"
421+ "locative"
299422 "lock"
300423 "logbook"
301424 "logentries"
302425 "logger"
426+ "london_air"
303427 "lovelace"
428+ "luftdaten"
304429 "lutron_caseta"
430+ "lyric"
431+ "mailbox"
305432 "manual"
306433 "manual_mqtt"
307434 "mazda"
308435 "media_player"
309436 "media_source"
437+ "meraki"
310438 "met"
311439 "met_eireann"
440+ "microsoft_face"
441+ "microsoft_face_detect"
442+ "microsoft_face_identify"
443+ "mikrotik"
444+ "min_max"
312445 "minecraft_server"
446+ "minio"
313447 "mobile_app"
314448 "modbus"
449+ "mold_indicator"
315450 "moon"
316451 "motioneye"
317452 "mqtt"
@@ -321,33 +456,66 @@ in with py.pkgs; buildPythonApplication rec {
321456 "mqtt_statestream"
322457 "mullvad"
323458 "mutesync"
459+ "my"
460+ "myq"
461+ "mysensors"
462+ "namecheapdns"
463+ "neato"
464+ "netatmo"
324465 "nexia"
466+ "no_ip"
325467 "notify"
326468 "notion"
469+ "nuki"
327470 "number"
471+ "nws"
328472 "nx584"
329473 "omnilogic"
474+ "onboarding"
330475 "ondilo_ico"
476+ "openalpr_cloud"
477+ "openalpr_local"
331478 "openerz"
479+ "openhardwaremonitor"
332480 "opentherm_gw"
481+ "openuv"
482+ "openweathermap"
483+ "opnsense"
333484 "ovo_energy"
485+ "owntracks"
334486 "ozw"
335487 "panel_custom"
336488 "panel_iframe"
337489 "persistent_notification"
338490 "person"
339491 "philips_js"
492+ "pi_hole"
493+ "picnic"
494+ "ping"
340495 "plaato"
496+ "plant"
497+ "plex"
341498 "plugwise"
499+ "poolsense"
500+ "profiler"
342501 "prometheus"
343502 "proximity"
344503 "push"
504+ "pushbullet"
345505 "pvpc_hourly_pricing"
346506 "python_script"
507+ "rachio"
508+ "radarr"
509+ "rainmachine"
347510 "random"
511+ "recollect_waste"
348512 "recorder"
513+ "reddit"
514+ "remote"
349515 "rest"
350516 "rest_command"
517+ "ring"
518+ "risco"
351519 "rituals_perfume_genie"
352520 "rmvtransport"
353521 "roku"
@@ -355,66 +523,125 @@ in with py.pkgs; buildPythonApplication rec {
355523 "rss_feed_template"
356524 "ruckus_unleashed"
357525 "safe_mode"
526+ "samsungtv"
358527 "scene"
359528 "screenlogic"
360529 "script"
361530 "search"
531+ "season"
532+ "sensor"
533+ "sentry"
534+ "sharkiq"
362535 "shell_command"
536+ "shelly"
363537 "shopping_list"
538+ "sigfox"
539+ "sighthound"
364540 "simplisafe"
365541 "simulated"
542+ "slack"
366543 "sleepiq"
367544 "sma"
368− "smhi"
369− "sensor"
370− "slack"
545+ "smappee"
371546 "smartthings"
372547 "smarttub"
548+ "smhi"
373549 "smtp"
374− "smappee"
550+ "snips"
375551 "solaredge"
552+ "soma"
553+ "somfy"
376554 "sonos"
555+ "soundtouch"
556+ "spaceapi"
557+ "speedtestdotnet"
377558 "spotify"
378559 "sql"
560+ "squeezebox"
379561 "ssdp"
562+ "startca"
563+ "statistics"
564+ "statsd"
380565 "stream"
566+ "stt"
381567 "subaru"
382568 "sun"
383569 "surepetcare"
384570 "switch"
571+ "switcher_kis"
385572 "system_health"
386573 "system_log"
574+ "tado"
387575 "tag"
388576 "tasmota"
389577 "tcp"
578+ "telegram"
579+ "tellduslive"
390580 "template"
391581 "tesla"
392582 "threshold"
583+ "tile"
393584 "time_date"
394585 "timer"
395586 "tod"
587+ "tomato"
588+ "toon"
589+ "tplink"
396590 "trace"
591+ "transmission"
592+ "trend"
397593 "tts"
594+ "tuya"
595+ "twentemilieu"
596+ "twilio"
597+ "twinkly"
598+ "twitch"
599+ "uk_transport"
600+ "unifi"
601+ "unifi_direct"
398602 "universal"
399603 "updater"
400604 "upnp"
401605 "uptime"
606+ "usgs_earthquakes_feed"
607+ "utility_meter"
608+ "uvc"
402609 "vacuum"
610+ "velbus"
611+ "vera"
403612 "verisure"
404613 "version"
405614 "vesync"
615+ "vizio"
616+ "voicerss"
617+ "volumio"
618+ "vultr"
619+ "wake_on_lan"
620+ "water_heater"
621+ "waze_travel_time"
406622 "weather"
407623 "webhook"
624+ "webostv"
408625 "websocket_api"
409626 "wemo"
627+ "wiffi"
628+ "wilight"
410629 "wled"
411630 "workday"
412631 "worldclock"
632+ "wsdot"
633+ "wunderground"
634+ "xiaomi"
635+ "xiaomi_aqara"
413636 "xiaomi_miio"
637+ "yamaha"
414638 "yandex_transport"
639+ "yandextts"
415640 "yeelight"
416641 "zeroconf"
642+ "zerproc"
417643 "zha"
644+ "zodiac"
418645 "zone"
419646 "zwave"
420647 "zwave_js"
@@ -423,19 +650,35 @@ in with py.pkgs; buildPythonApplication rec {
423650 ];
424651
425652 pytestFlagsArray = [
426− # limit amout of runners to reduce race conditions
427− "-n auto"
653+ # parallelize test run
654+ "--numprocesses auto"
655+ # assign tests grouped by file to workers
656+ "--dist loadfile"
428657 # retry racy tests that end in "RuntimeError: Event loop is closed"
429658 "--reruns 3"
430659 "--only-rerun RuntimeError"
431− # assign tests grouped by file to workers
432− "--dist loadfile"
433660 # enable full variable printing on error
434661 "--showlocals"
435− # tests are located in tests/
436− "tests"
437662 # screenlogic/test_config_flow.py: Tries to send out UDP broadcasts
438663 "--deselect tests/components/screenlogic/test_config_flow.py::test_form_cannot_connect"
664+ # asuswrt/test_config_flow.py: Sandbox network limitations, fails with unexpected error
665+ "--deselect tests/components/asuswrt/test_config_flow.py::test_on_connect_failed"
666+ # shelly/test_config_flow.py: Tries to join multicast group
667+ "--deselect tests/components/shelly/test_config_flow.py::test_form"
668+ "--deselect tests/components/shelly/test_config_flow.py::test_title_without_name"
669+ "--deselect tests/components/shelly/test_config_flow.py::test_form_auth"
670+ "--deselect tests/components/shelly/test_config_flow.py::test_form_errors_test_connection"
671+ "--deselect tests/components/shelly/test_config_flow.py::test_user_setup_ignored_device"
672+ "--deselect tests/components/shelly/test_config_flow.py::test_form_auth_errors_test_connection"
673+ "--deselect tests/components/shelly/test_config_flow.py::test_form_auth_errors_test_connection"
674+ "--deselect tests/components/shelly/test_config_flow.py::test_form_auth_errors_test_connection"
675+ "--deselect tests/components/shelly/test_config_flow.py::test_zeroconf"
676+ "--deselect tests/components/shelly/test_config_flow.py::test_zeroconf_sleeping_device"
677+ "--deselect tests/components/shelly/test_config_flow.py::test_zeroconf_sleeping_device_error"
678+ "--deselect tests/components/shelly/test_config_flow.py::test_zeroconf_sleeping_device_error"
679+ "--deselect tests/components/shelly/test_config_flow.py::test_zeroconf_require_auth"
680+ # tests are located in tests/
681+ "tests"
439682 # dynamically add packages required for component tests
440683 ] ++ map (component: "tests/components/" + component) componentTests;
441684
@@ -464,6 +707,9 @@ in with py.pkgs; buildPythonApplication rec {
464707 "test_executor_shutdown_can_interrupt_threads"
465708 # {'theme_color': '#03A9F4'} != {'theme_color': 'blue'}
466709 "test_webhook_handle_get_config"
710+ # onboarding tests rpi_power component, for which we are lacking rpi_bad_power library
711+ "test_onboarding_core_sets_up_rpi_power"
712+ "test_onboarding_core_no_rpi_power"
467713 ];
468714
469715 preCheck = ''
@@ -472,6 +718,9 @@ in with py.pkgs; buildPythonApplication rec {
472718 # the tests require the existance of a media dir
473719 mkdir /build/media
474720
721+ # put ping binary into PATH, e.g. for wake_on_lan tests
722+ export PATH=${inetutils}/bin:$PATH
723+
475724 # error out when component test directory is missing, otherwise hidden by xdist execution :(
476725 for component in ${lib.concatStringsSep " " (map lib.escapeShellArg componentTests)}; do
477726 test -d "tests/components/$component" || {