From 56b394aa2a0c71b09240c641f1c93dbfa4339993 Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Tue, 14 Sep 2021 17:16:04 -0300 Subject: [PATCH] pythonPackages.openstacksdk: add missing dependency; fix aarch64 tests --- .../python-modules/openstacksdk/default.nix | 44 +++---------- .../python-modules/openstacksdk/tests.nix | 65 +++++++++++++++++++ 2 files changed, 74 insertions(+), 35 deletions(-) create mode 100644 pkgs/development/python-modules/openstacksdk/tests.nix diff --git a/pkgs/development/python-modules/openstacksdk/default.nix b/pkgs/development/python-modules/openstacksdk/default.nix index 5e7442ebc5f0..ec45fd8d09b8 100644 --- a/pkgs/development/python-modules/openstacksdk/default.nix +++ b/pkgs/development/python-modules/openstacksdk/default.nix @@ -1,26 +1,20 @@ { lib , buildPythonPackage +, callPackage , fetchPypi , appdirs , cryptography -, ddt , dogpile_cache -, hacking , jmespath , jsonpatch -, jsonschema , keystoneauth1 , munch , netifaces , os-service-types -, oslo-config -, oslotest , pbr -, prometheus-client -, requests-mock +, pyyaml , requestsexceptions -, stestr -, testscenarios +, stdenv }: buildPythonPackage rec { @@ -44,35 +38,15 @@ buildPythonPackage rec { os-service-types pbr requestsexceptions + pyyaml ]; - checkInputs = [ - ddt - hacking - jsonschema - oslo-config - oslotest - prometheus-client - requests-mock - stestr - testscenarios - ]; + # Checks moved to 'passthru.tests' to workaround slowness + doCheck = false; - checkPhase = '' - stestr run -e <(echo " - openstack.tests.unit.cloud.test_image.TestImage.test_create_image_task - openstack.tests.unit.image.v2.test_proxy.TestImageProxy.test_wait_for_task_error_396 - openstack.tests.unit.image.v2.test_proxy.TestImageProxy.test_wait_for_task_wait - openstack.tests.unit.test_resource.TestWaitForStatus.test_status_fails - openstack.tests.unit.test_resource.TestWaitForStatus.test_status_fails_different_attribute - openstack.tests.unit.test_resource.TestWaitForStatus.test_status_match - openstack.tests.unit.test_resource.TestWaitForStatus.test_status_match_with_none - openstack.tests.unit.test_stats.TestStats.test_list_projects - openstack.tests.unit.test_stats.TestStats.test_projects - openstack.tests.unit.test_stats.TestStats.test_servers - openstack.tests.unit.test_stats.TestStats.test_servers_no_detail - ") - ''; + passthru.tests = { + tests = callPackage ./tests.nix { }; + }; pythonImportsCheck = [ "openstack" ]; diff --git a/pkgs/development/python-modules/openstacksdk/tests.nix b/pkgs/development/python-modules/openstacksdk/tests.nix new file mode 100644 index 000000000000..7a379d3a019e --- /dev/null +++ b/pkgs/development/python-modules/openstacksdk/tests.nix @@ -0,0 +1,65 @@ +{ buildPythonPackage +, ddt +, hacking +, jsonschema +, lib +, openstacksdk +, oslo-config +, oslotest +, prometheus-client +, requests-mock +, stdenv +, stestr +, testscenarios +}: + +buildPythonPackage rec { + pname = "openstacksdk-tests"; + inherit (openstacksdk) version; + + src = openstacksdk.src; + + dontBuild = true; + dontInstall = true; + + checkInputs = [ + ddt + hacking + jsonschema + openstacksdk + oslo-config + oslotest + prometheus-client + requests-mock + stestr + testscenarios + ]; + + checkPhase = + let aarch64TestsExcluded = lib.optionalString stdenv.hostPlatform.isAarch64 '' + openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_node_set_provision_state_with_retries + openstack.tests.unit.cloud.test_role_assignment.TestRoleAssignment.test_grant_role_user_domain_exists + openstack.tests.unit.cloud.test_volume_backups.TestVolumeBackups.test_delete_volume_backup_force + openstack.tests.unit.object_store.v1.test_proxy.TestTempURLBytesPathAndKey.test_set_account_temp_url_key_second + openstack.tests.unit.cloud.test_security_groups.TestSecurityGroups.test_delete_security_group_neutron_not_found + ''; in + '' + stestr run -e <(echo "${aarch64TestsExcluded} + openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_wait_for_baremetal_node_lock_locked + openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_inspect_machine_inspect_failed + openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_inspect_machine_available_wait + openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_inspect_machine_wait + openstack.tests.unit.cloud.test_image.TestImage.test_create_image_task + openstack.tests.unit.image.v2.test_proxy.TestImageProxy.test_wait_for_task_error_396 + openstack.tests.unit.image.v2.test_proxy.TestImageProxy.test_wait_for_task_wait + openstack.tests.unit.test_resource.TestWaitForStatus.test_status_fails + openstack.tests.unit.test_resource.TestWaitForStatus.test_status_fails_different_attribute + openstack.tests.unit.test_resource.TestWaitForStatus.test_status_match + openstack.tests.unit.test_resource.TestWaitForStatus.test_status_match_with_none + openstack.tests.unit.test_stats.TestStats.test_list_projects + openstack.tests.unit.test_stats.TestStats.test_projects + openstack.tests.unit.test_stats.TestStats.test_servers + openstack.tests.unit.test_stats.TestStats.test_servers_no_detail + ") + ''; +}