diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index b648520a9febbf..bb5af00bb8fcd1 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -2,6 +2,7 @@ , lib , fetchFromGitHub , python3 +, inetutils , nixosTests # Look up dependencies of specified components in component-packages.nix @@ -239,33 +240,69 @@ in with py.pkgs; buildPythonApplication rec { # services. Before adding new components to this list make sure we have all # its dependencies packaged and listed in ./component-packages.nix. componentTests = [ + "abode" "accuweather" + "acmeda" + "adguard" + "advantage_air" + "agent_dvr" + "air_quality" "airly" + "airnow" + "airvisual" + "alarm_control_panel" + "alarmdecoder" + "alert" + "alexa" + "almond" + "ambiclimate" + "ambient_station" "analytics" "androidtv" - "alert" + "apache_kafka" "api" + "apple_tv" + "apprise" + "arlo" + "asuswrt" + "august" + "aurora" "auth" "automation" + "awair" + "aws" "axis" "bayesian" "binary_sensor" + "blackbird" + "blueprint" + "bluetooth_le_tracker" + "braviatv" + "broadlink" "brother" + "bsblan" "caldav" "calendar" "camera" "canary" "cast" + "cert_expiry" "climacell" "climate" "cloud" + "cloudflare" "comfoconnect" "command_line" + "compensation" "config" "configurator" "conversation" + "coronavirus" "counter" "cover" + "daikin" + "darksky" + "datadog" "deconz" "default_config" "demo" @@ -275,22 +312,42 @@ in with py.pkgs; buildPythonApplication rec { "device_sun_light_trigger" "device_tracker" "devolo_home_control" + "dexcom" "dhcp" + "dialogflow" "discovery" "dsmr" + "dte_energy_bridge" + "duckdns" + "dyson" + "eafm" "econet" + "efergy" + "emonitor" "emulated_hue" "esphome" - "fan" + "everlights" + "ezviz" "faa_delays" + "facebook" + "facebox" + "fail2ban" + "fan" + "feedreader" "ffmpeg" + "fido" "file" "filesize" "filter" + "firmata" + "flo" + "flume" + "flunearyou" "flux" "folder" "folder_watcher" "freebox" + "freedns" "fritz" "fritzbox" "fritzbox_callmonitor" @@ -299,59 +356,97 @@ in with py.pkgs; buildPythonApplication rec { "generic_thermostat" "geo_json_events" "geo_location" + "geofency" + "glances" + "google" + "google_assistant" + "google_domains" + "google_pubsub" + "google_translate" + "google_travel_time" + "google_wifi" + "gpslogger" + "graphite" "group" + "guardian" + "harmony" + "hassio" "hddtemp" "history" "history_stats" "home_connect" "home_plus_control" + "homeassistant" "homekit" "homekit_controller" - "homeassistant" "homematic" "homematicip_cloud" "html5" "http" "hue" + "humidifier" "hyperion" + "ialarm" "iaqualink" + "icloud" "ifttt" "image" "image_processing" + "imap_email_content" "influxdb" "input_boolean" "input_datetime" - "input_text" "input_number" "input_select" + "input_text" + "insteon" + "integration" "intent" "intent_script" + "ios" "ipp" + "iqvia" "islamic_prayer_times" "jewish_calendar" + "kira" "kmtronic" "knx" "kodi" + "lastfm" + "lcn" "light" "litterrobot" "local_file" "local_ip" + "locative" "lock" "logbook" "logentries" "logger" + "london_air" "lovelace" + "luftdaten" "lutron_caseta" + "lyric" + "mailbox" "manual" "manual_mqtt" "mazda" "media_player" "media_source" + "meraki" "met" "met_eireann" + "microsoft_face" + "microsoft_face_detect" + "microsoft_face_identify" + "mikrotik" + "min_max" "minecraft_server" + "minio" "mobile_app" "modbus" + "mold_indicator" "moon" "motioneye" "mqtt" @@ -361,33 +456,66 @@ in with py.pkgs; buildPythonApplication rec { "mqtt_statestream" "mullvad" "mutesync" + "my" + "myq" + "mysensors" + "namecheapdns" + "neato" + "netatmo" "nexia" + "no_ip" "notify" "notion" + "nuki" "number" + "nws" "nx584" "omnilogic" + "onboarding" "ondilo_ico" + "openalpr_cloud" + "openalpr_local" "openerz" + "openhardwaremonitor" "opentherm_gw" + "openuv" + "openweathermap" + "opnsense" "ovo_energy" + "owntracks" "ozw" "panel_custom" "panel_iframe" "persistent_notification" "person" "philips_js" + "pi_hole" + "picnic" + "ping" "plaato" + "plant" + "plex" "plugwise" + "poolsense" + "profiler" "prometheus" "proximity" "push" + "pushbullet" "pvpc_hourly_pricing" "python_script" + "rachio" + "radarr" + "rainmachine" "random" + "recollect_waste" "recorder" + "reddit" + "remote" "rest" "rest_command" + "ring" + "risco" "rituals_perfume_genie" "rmvtransport" "roku" @@ -395,66 +523,125 @@ in with py.pkgs; buildPythonApplication rec { "rss_feed_template" "ruckus_unleashed" "safe_mode" + "samsungtv" "scene" "screenlogic" "script" "search" + "season" + "sensor" + "sentry" + "sharkiq" "shell_command" + "shelly" "shopping_list" + "sigfox" + "sighthound" "simplisafe" "simulated" + "slack" "sleepiq" "sma" - "smhi" - "sensor" - "slack" + "smappee" "smartthings" "smarttub" + "smhi" "smtp" - "smappee" + "snips" "solaredge" + "soma" + "somfy" "sonos" + "soundtouch" + "spaceapi" + "speedtestdotnet" "spotify" "sql" + "squeezebox" "ssdp" + "startca" + "statistics" + "statsd" "stream" + "stt" "subaru" "sun" "surepetcare" "switch" + "switcher_kis" "system_health" "system_log" + "tado" "tag" "tasmota" "tcp" + "telegram" + "tellduslive" "template" "tesla" "threshold" + "tile" "time_date" "timer" "tod" + "tomato" + "toon" + "tplink" "trace" + "transmission" + "trend" "tts" + "tuya" + "twentemilieu" + "twilio" + "twinkly" + "twitch" + "uk_transport" + "unifi" + "unifi_direct" "universal" "updater" "upnp" "uptime" + "usgs_earthquakes_feed" + "utility_meter" + "uvc" "vacuum" + "velbus" + "vera" "verisure" "version" "vesync" + "vizio" + "voicerss" + "volumio" + "vultr" + "wake_on_lan" + "water_heater" + "waze_travel_time" "weather" "webhook" + "webostv" "websocket_api" "wemo" + "wiffi" + "wilight" "wled" "workday" "worldclock" + "wsdot" + "wunderground" + "xiaomi" + "xiaomi_aqara" "xiaomi_miio" + "yamaha" "yandex_transport" + "yandextts" "yeelight" "zeroconf" + "zerproc" "zha" + "zodiac" "zone" "zwave" "zwave_js" @@ -463,19 +650,35 @@ in with py.pkgs; buildPythonApplication rec { ]; pytestFlagsArray = [ - # limit amout of runners to reduce race conditions - "-n auto" + # parallelize test run + "--numprocesses auto" + # assign tests grouped by file to workers + "--dist loadfile" # retry racy tests that end in "RuntimeError: Event loop is closed" "--reruns 3" "--only-rerun RuntimeError" - # assign tests grouped by file to workers - "--dist loadfile" # enable full variable printing on error "--showlocals" - # tests are located in tests/ - "tests" # screenlogic/test_config_flow.py: Tries to send out UDP broadcasts "--deselect tests/components/screenlogic/test_config_flow.py::test_form_cannot_connect" + # asuswrt/test_config_flow.py: Sandbox network limitations, fails with unexpected error + "--deselect tests/components/asuswrt/test_config_flow.py::test_on_connect_failed" + # shelly/test_config_flow.py: Tries to join multicast group + "--deselect tests/components/shelly/test_config_flow.py::test_form" + "--deselect tests/components/shelly/test_config_flow.py::test_title_without_name" + "--deselect tests/components/shelly/test_config_flow.py::test_form_auth" + "--deselect tests/components/shelly/test_config_flow.py::test_form_errors_test_connection" + "--deselect tests/components/shelly/test_config_flow.py::test_user_setup_ignored_device" + "--deselect tests/components/shelly/test_config_flow.py::test_form_auth_errors_test_connection" + "--deselect tests/components/shelly/test_config_flow.py::test_form_auth_errors_test_connection" + "--deselect tests/components/shelly/test_config_flow.py::test_form_auth_errors_test_connection" + "--deselect tests/components/shelly/test_config_flow.py::test_zeroconf" + "--deselect tests/components/shelly/test_config_flow.py::test_zeroconf_sleeping_device" + "--deselect tests/components/shelly/test_config_flow.py::test_zeroconf_sleeping_device_error" + "--deselect tests/components/shelly/test_config_flow.py::test_zeroconf_sleeping_device_error" + "--deselect tests/components/shelly/test_config_flow.py::test_zeroconf_require_auth" + # tests are located in tests/ + "tests" # dynamically add packages required for component tests ] ++ map (component: "tests/components/" + component) componentTests; @@ -504,6 +707,9 @@ in with py.pkgs; buildPythonApplication rec { "test_executor_shutdown_can_interrupt_threads" # {'theme_color': '#03A9F4'} != {'theme_color': 'blue'} "test_webhook_handle_get_config" + # onboarding tests rpi_power component, for which we are lacking rpi_bad_power library + "test_onboarding_core_sets_up_rpi_power" + "test_onboarding_core_no_rpi_power" ]; preCheck = '' @@ -512,6 +718,9 @@ in with py.pkgs; buildPythonApplication rec { # the tests require the existance of a media dir mkdir /build/media + # put ping binary into PATH, e.g. for wake_on_lan tests + export PATH=${inetutils}/bin:$PATH + # error out when component test directory is missing, otherwise hidden by xdist execution :( for component in ${lib.concatStringsSep " " (map lib.escapeShellArg componentTests)}; do test -d "tests/components/$component" || {