@@ -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
@@ -239,33 +240,69 @@ in with py.pkgs; buildPythonApplication rec {
239240 # services. Before adding new components to this list make sure we have all
240241 # its dependencies packaged and listed in ./component-packages.nix.
241242 componentTests = [
243+ "abode"
242244 "accuweather"
245+ "acmeda"
246+ "adguard"
247+ "advantage_air"
248+ "agent_dvr"
249+ "air_quality"
243250 "airly"
251+ "airnow"
252+ "airvisual"
253+ "alarm_control_panel"
254+ "alarmdecoder"
255+ "alert"
256+ "alexa"
257+ "almond"
258+ "ambiclimate"
259+ "ambient_station"
244260 "analytics"
245261 "androidtv"
246− "alert"
262+ "apache_kafka"
247263 "api"
264+ "apple_tv"
265+ "apprise"
266+ "arlo"
267+ "asuswrt"
268+ "august"
269+ "aurora"
248270 "auth"
249271 "automation"
272+ "awair"
273+ "aws"
250274 "axis"
251275 "bayesian"
252276 "binary_sensor"
277+ "blackbird"
278+ "blueprint"
279+ "bluetooth_le_tracker"
280+ "braviatv"
281+ "broadlink"
253282 "brother"
283+ "bsblan"
254284 "caldav"
255285 "calendar"
256286 "camera"
257287 "canary"
258288 "cast"
289+ "cert_expiry"
259290 "climacell"
260291 "climate"
261292 "cloud"
293+ "cloudflare"
262294 "comfoconnect"
263295 "command_line"
296+ "compensation"
264297 "config"
265298 "configurator"
266299 "conversation"
300+ "coronavirus"
267301 "counter"
268302 "cover"
303+ "daikin"
304+ "darksky"
305+ "datadog"
269306 "deconz"
270307 "default_config"
271308 "demo"
@@ -275,22 +312,42 @@ in with py.pkgs; buildPythonApplication rec {
275312 "device_sun_light_trigger"
276313 "device_tracker"
277314 "devolo_home_control"
315+ "dexcom"
278316 "dhcp"
317+ "dialogflow"
279318 "discovery"
280319 "dsmr"
320+ "dte_energy_bridge"
321+ "duckdns"
322+ "dyson"
323+ "eafm"
281324 "econet"
325+ "efergy"
326+ "emonitor"
282327 "emulated_hue"
283328 "esphome"
284− "fan"
329+ "everlights"
330+ "ezviz"
285331 "faa_delays"
332+ "facebook"
333+ "facebox"
334+ "fail2ban"
335+ "fan"
336+ "feedreader"
286337 "ffmpeg"
338+ "fido"
287339 "file"
288340 "filesize"
289341 "filter"
342+ "firmata"
343+ "flo"
344+ "flume"
345+ "flunearyou"
290346 "flux"
291347 "folder"
292348 "folder_watcher"
293349 "freebox"
350+ "freedns"
294351 "fritz"
295352 "fritzbox"
296353 "fritzbox_callmonitor"
@@ -299,59 +356,97 @@ in with py.pkgs; buildPythonApplication rec {
299356 "generic_thermostat"
300357 "geo_json_events"
301358 "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"
302370 "group"
371+ "guardian"
372+ "harmony"
373+ "hassio"
303374 "hddtemp"
304375 "history"
305376 "history_stats"
306377 "home_connect"
307378 "home_plus_control"
379+ "homeassistant"
308380 "homekit"
309381 "homekit_controller"
310− "homeassistant"
311382 "homematic"
312383 "homematicip_cloud"
313384 "html5"
314385 "http"
315386 "hue"
387+ "humidifier"
316388 "hyperion"
389+ "ialarm"
317390 "iaqualink"
391+ "icloud"
318392 "ifttt"
319393 "image"
320394 "image_processing"
395+ "imap_email_content"
321396 "influxdb"
322397 "input_boolean"
323398 "input_datetime"
324− "input_text"
325399 "input_number"
326400 "input_select"
401+ "input_text"
402+ "insteon"
403+ "integration"
327404 "intent"
328405 "intent_script"
406+ "ios"
329407 "ipp"
408+ "iqvia"
330409 "islamic_prayer_times"
331410 "jewish_calendar"
411+ "kira"
332412 "kmtronic"
333413 "knx"
334414 "kodi"
415+ "lastfm"
416+ "lcn"
335417 "light"
336418 "litterrobot"
337419 "local_file"
338420 "local_ip"
421+ "locative"
339422 "lock"
340423 "logbook"
341424 "logentries"
342425 "logger"
426+ "london_air"
343427 "lovelace"
428+ "luftdaten"
344429 "lutron_caseta"
430+ "lyric"
431+ "mailbox"
345432 "manual"
346433 "manual_mqtt"
347434 "mazda"
348435 "media_player"
349436 "media_source"
437+ "meraki"
350438 "met"
351439 "met_eireann"
440+ "microsoft_face"
441+ "microsoft_face_detect"
442+ "microsoft_face_identify"
443+ "mikrotik"
444+ "min_max"
352445 "minecraft_server"
446+ "minio"
353447 "mobile_app"
354448 "modbus"
449+ "mold_indicator"
355450 "moon"
356451 "motioneye"
357452 "mqtt"
@@ -361,33 +456,66 @@ in with py.pkgs; buildPythonApplication rec {
361456 "mqtt_statestream"
362457 "mullvad"
363458 "mutesync"
459+ "my"
460+ "myq"
461+ "mysensors"
462+ "namecheapdns"
463+ "neato"
464+ "netatmo"
364465 "nexia"
466+ "no_ip"
365467 "notify"
366468 "notion"
469+ "nuki"
367470 "number"
471+ "nws"
368472 "nx584"
369473 "omnilogic"
474+ "onboarding"
370475 "ondilo_ico"
476+ "openalpr_cloud"
477+ "openalpr_local"
371478 "openerz"
479+ "openhardwaremonitor"
372480 "opentherm_gw"
481+ "openuv"
482+ "openweathermap"
483+ "opnsense"
373484 "ovo_energy"
485+ "owntracks"
374486 "ozw"
375487 "panel_custom"
376488 "panel_iframe"
377489 "persistent_notification"
378490 "person"
379491 "philips_js"
492+ "pi_hole"
493+ "picnic"
494+ "ping"
380495 "plaato"
496+ "plant"
497+ "plex"
381498 "plugwise"
499+ "poolsense"
500+ "profiler"
382501 "prometheus"
383502 "proximity"
384503 "push"
504+ "pushbullet"
385505 "pvpc_hourly_pricing"
386506 "python_script"
507+ "rachio"
508+ "radarr"
509+ "rainmachine"
387510 "random"
511+ "recollect_waste"
388512 "recorder"
513+ "reddit"
514+ "remote"
389515 "rest"
390516 "rest_command"
517+ "ring"
518+ "risco"
391519 "rituals_perfume_genie"
392520 "rmvtransport"
393521 "roku"
@@ -395,66 +523,125 @@ in with py.pkgs; buildPythonApplication rec {
395523 "rss_feed_template"
396524 "ruckus_unleashed"
397525 "safe_mode"
526+ "samsungtv"
398527 "scene"
399528 "screenlogic"
400529 "script"
401530 "search"
531+ "season"
532+ "sensor"
533+ "sentry"
534+ "sharkiq"
402535 "shell_command"
536+ "shelly"
403537 "shopping_list"
538+ "sigfox"
539+ "sighthound"
404540 "simplisafe"
405541 "simulated"
542+ "slack"
406543 "sleepiq"
407544 "sma"
408− "smhi"
409− "sensor"
410− "slack"
545+ "smappee"
411546 "smartthings"
412547 "smarttub"
548+ "smhi"
413549 "smtp"
414− "smappee"
550+ "snips"
415551 "solaredge"
552+ "soma"
553+ "somfy"
416554 "sonos"
555+ "soundtouch"
556+ "spaceapi"
557+ "speedtestdotnet"
417558 "spotify"
418559 "sql"
560+ "squeezebox"
419561 "ssdp"
562+ "startca"
563+ "statistics"
564+ "statsd"
420565 "stream"
566+ "stt"
421567 "subaru"
422568 "sun"
423569 "surepetcare"
424570 "switch"
571+ "switcher_kis"
425572 "system_health"
426573 "system_log"
574+ "tado"
427575 "tag"
428576 "tasmota"
429577 "tcp"
578+ "telegram"
579+ "tellduslive"
430580 "template"
431581 "tesla"
432582 "threshold"
583+ "tile"
433584 "time_date"
434585 "timer"
435586 "tod"
587+ "tomato"
588+ "toon"
589+ "tplink"
436590 "trace"
591+ "transmission"
592+ "trend"
437593 "tts"
594+ "tuya"
595+ "twentemilieu"
596+ "twilio"
597+ "twinkly"
598+ "twitch"
599+ "uk_transport"
600+ "unifi"
601+ "unifi_direct"
438602 "universal"
439603 "updater"
440604 "upnp"
441605 "uptime"
606+ "usgs_earthquakes_feed"
607+ "utility_meter"
608+ "uvc"
442609 "vacuum"
610+ "velbus"
611+ "vera"
443612 "verisure"
444613 "version"
445614 "vesync"
615+ "vizio"
616+ "voicerss"
617+ "volumio"
618+ "vultr"
619+ "wake_on_lan"
620+ "water_heater"
621+ "waze_travel_time"
446622 "weather"
447623 "webhook"
624+ "webostv"
448625 "websocket_api"
449626 "wemo"
627+ "wiffi"
628+ "wilight"
450629 "wled"
451630 "workday"
452631 "worldclock"
632+ "wsdot"
633+ "wunderground"
634+ "xiaomi"
635+ "xiaomi_aqara"
453636 "xiaomi_miio"
637+ "yamaha"
454638 "yandex_transport"
639+ "yandextts"
455640 "yeelight"
456641 "zeroconf"
642+ "zerproc"
457643 "zha"
644+ "zodiac"
458645 "zone"
459646 "zwave"
460647 "zwave_js"
@@ -463,19 +650,35 @@ in with py.pkgs; buildPythonApplication rec {
463650 ];
464651
465652 pytestFlagsArray = [
466− # limit amout of runners to reduce race conditions
467− "-n auto"
653+ # parallelize test run
654+ "--numprocesses auto"
655+ # assign tests grouped by file to workers
656+ "--dist loadfile"
468657 # retry racy tests that end in "RuntimeError: Event loop is closed"
469658 "--reruns 3"
470659 "--only-rerun RuntimeError"
471− # assign tests grouped by file to workers
472− "--dist loadfile"
473660 # enable full variable printing on error
474661 "--showlocals"
475− # tests are located in tests/
476− "tests"
477662 # screenlogic/test_config_flow.py: Tries to send out UDP broadcasts
478663 "--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"
479682 # dynamically add packages required for component tests
480683 ] ++ map (component: "tests/components/" + component) componentTests;
481684
@@ -504,6 +707,9 @@ in with py.pkgs; buildPythonApplication rec {
504707 "test_executor_shutdown_can_interrupt_threads"
505708 # {'theme_color': '#03A9F4'} != {'theme_color': 'blue'}
506709 "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"
507713 ];
508714
509715 preCheck = ''
@@ -512,6 +718,9 @@ in with py.pkgs; buildPythonApplication rec {
512718 # the tests require the existance of a media dir
513719 mkdir /build/media
514720
721+ # put ping binary into PATH, e.g. for wake_on_lan tests
722+ export PATH=${inetutils}/bin:$PATH
723+
515724 # error out when component test directory is missing, otherwise hidden by xdist execution :(
516725 for component in ${lib.concatStringsSep " " (map lib.escapeShellArg componentTests)}; do
517726 test -d "tests/components/$component" || {