From 5bdc1c54ba3a735172b3a94e7c75b1c9e89dfe77 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 5 Feb 2021 17:07:53 +0100 Subject: [PATCH] home-assistant: improve reliability of tests by grouping tests by file --- pkgs/servers/home-assistant/default.nix | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 467d46f3354..977c58906ac 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -182,31 +182,23 @@ in with py.pkgs; buildPythonApplication rec { pytestFlagsArray = [ "-n auto" + # assign tests grouped by file to workers + "--dist loadfile" # don't bulk test all components "--ignore tests/components" - # prone to race conditions due to parallel file access - "--ignore tests/test_config.py" # pyotp since v2.4.0 complains about the short mock keys, hass pins v2.3.0 "--ignore tests/auth/mfa_modules/test_notify.py" "tests" ] ++ map (component: "tests/components/" + component) componentTests; disabledTests = [ - # AssertionError: assert 'unknown' == 'not_home' - "test_device_tracker_not_home" + # AssertionError: assert 1 == 0 + "test_merge" + # ModuleNotFoundError: No module named 'pyqwikswitch' + "test_merge_id_schema" # keyring.errors.NoKeyringError: No recommended backend was available. "test_secrets_from_unrelated_fails" "test_secrets_credstash" - # AssertionError: Expected 'start' to have been called once. Called 0 times. - "test_setup_and_stop" - # AssertionError: assert {} == {'test': } - "test_get_custom_components_internal" - # assert 0 == 1 where 0 = len([]) - "test_error_posted_as_event" - # RuntimeError: Event loop is closed - "test_config_path" - "test_info_endpoint_register_callback_timeout" - "test_scan_match_st" ]; preCheck = ''