From 71284ddc5fc44edcded7b7eea770baf46042b4ae Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 27 May 2016 16:19:31 +0200 Subject: [PATCH] Run Python 3 unit tests in parallel Replace testtools.run test runner with os-testr for Python 3 to run tests in parallel. Replace also the whitelist with a blacklist to quickly identify tests which still must be ported to Python 3. Blacklist backup.test_backup_models: even if it worked when run with testtools.run, it fails when run using os-testr. We can investigate this issue later, it's more important to reduce the duration of the py34 job to reduce the risk of random timeout. Add a dependency to os-testr. Partially implements: blueprint trove-python3 Change-Id: I5ea7ebf7eec15b75a5fed07aab7bd15e5e6cd6d6 --- blacklist-py3.txt | 12 ++++++ test-requirements.txt | 1 + tox.ini | 87 +------------------------------------------ 3 files changed, 14 insertions(+), 86 deletions(-) create mode 100644 blacklist-py3.txt diff --git a/blacklist-py3.txt b/blacklist-py3.txt new file mode 100644 index 0000000000..acde263db3 --- /dev/null +++ b/blacklist-py3.txt @@ -0,0 +1,12 @@ +# Use a blacklist of tests known to fail on Python 3, until +# all unit tests will pass on Python 3. +backup.test_backup_models +cluster.test_galera_cluster +cluster.test_redis_cluster +common.test_pagination +guestagent.test_cassandra_manager +guestagent.test_dbaas +guestagent.test_mongodb_manager +guestagent.test_operating_system +guestagent.test_volume +mgmt.test_datastores diff --git a/test-requirements.txt b/test-requirements.txt index c260c715e1..c3ca3dd4f0 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -27,3 +27,4 @@ psycopg2>=2.5 # LGPL/ZPL cassandra-driver>=2.1.4 # Apache-2.0 pycrypto>=2.6 # Public Domain couchdb>=0.8 # Apache-2.0 +os-testr>=0.7.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 5562d2ef08..130093327a 100644 --- a/tox.ini +++ b/tox.ini @@ -27,93 +27,8 @@ commands = xargs -0 -n 1 msgfmt --check-format -o /dev/null" [testenv:py34] -# Use a whitelist of tests known to pass on Python 3, until -# all unit tests will pass on Python 3. commands = - python -bb -m testtools.run \ - trove/tests/unittests/api/common/test_extensions.py \ - trove/tests/unittests/api/common/test_limits.py \ - trove/tests/unittests/api/test_versions.py \ - trove/tests/unittests/backup/test_backup_controller.py \ - trove/tests/unittests/backup/test_backup_models.py \ - trove/tests/unittests/backup/test_backupagent.py \ - trove/tests/unittests/backup/test_storage.py \ - trove/tests/unittests/cluster/test_cassandra_cluster.py \ - trove/tests/unittests/cluster/test_cluster.py \ - trove/tests/unittests/cluster/test_cluster_controller.py \ - trove/tests/unittests/cluster/test_cluster_models.py \ - trove/tests/unittests/cluster/test_cluster_pxc_controller.py \ - trove/tests/unittests/cluster/test_cluster_redis_controller.py \ - trove/tests/unittests/cluster/test_cluster_vertica_controller.py \ - trove/tests/unittests/cluster/test_cluster_views.py \ - trove/tests/unittests/cluster/test_mongodb_cluster.py \ - trove/tests/unittests/cluster/test_vertica_cluster.py \ - trove/tests/unittests/common/test_common_extensions.py \ - trove/tests/unittests/common/test_context.py \ - trove/tests/unittests/common/test_crypto_utils.py \ - trove/tests/unittests/common/test_exception.py \ - trove/tests/unittests/common/test_notification.py \ - trove/tests/unittests/common/test_remote.py \ - trove/tests/unittests/common/test_stream_codecs.py \ - trove/tests/unittests/common/test_template.py \ - trove/tests/unittests/common/test_utils.py \ - trove/tests/unittests/common/test_wsgi.py \ - trove/tests/unittests/conductor/test_conf.py \ - trove/tests/unittests/conductor/test_methods.py \ - trove/tests/unittests/configuration/test_configuration_controller.py \ - trove/tests/unittests/datastore/test_capability.py \ - trove/tests/unittests/datastore/test_datastore.py \ - trove/tests/unittests/datastore/test_datastore_version_metadata.py \ - trove/tests/unittests/datastore/test_datastore_versions.py \ - trove/tests/unittests/db/test_migration_utils.py \ - trove/tests/unittests/dns/test_designate_driver.py \ - trove/tests/unittests/guestagent/test_agent_heartbeats_models.py \ - trove/tests/unittests/guestagent/test_api.py \ - trove/tests/unittests/guestagent/test_backups.py \ - trove/tests/unittests/guestagent/test_configuration.py \ - trove/tests/unittests/guestagent/test_couchbase_manager.py \ - trove/tests/unittests/guestagent/test_couchdb_manager.py \ - trove/tests/unittests/guestagent/test_db2_manager.py \ - trove/tests/unittests/guestagent/test_dbmodels.py \ - trove/tests/unittests/guestagent/test_galera_cluster_api.py \ - trove/tests/unittests/guestagent/test_galera_manager.py \ - trove/tests/unittests/guestagent/test_guestagent_utils.py \ - trove/tests/unittests/guestagent/test_manager.py \ - trove/tests/unittests/guestagent/test_mariadb_manager.py \ - trove/tests/unittests/guestagent/test_models.py \ - trove/tests/unittests/guestagent/test_mongodb_cluster_manager.py \ - trove/tests/unittests/guestagent/test_mysql_manager.py \ - trove/tests/unittests/guestagent/test_pkg.py \ - trove/tests/unittests/guestagent/test_query.py \ - trove/tests/unittests/guestagent/test_redis_manager.py \ - trove/tests/unittests/guestagent/test_service.py \ - trove/tests/unittests/guestagent/test_vertica_api.py \ - trove/tests/unittests/guestagent/test_vertica_manager.py \ - trove/tests/unittests/instance/test_instance_controller.py \ - trove/tests/unittests/instance/test_instance_models.py \ - trove/tests/unittests/instance/test_instance_status.py \ - trove/tests/unittests/instance/test_instance_views.py \ - trove/tests/unittests/mgmt/test_clusters.py \ - trove/tests/unittests/mgmt/test_datastore_controller.py \ - trove/tests/unittests/mgmt/test_datastores.py \ - trove/tests/unittests/mgmt/test_models.py \ - trove/tests/unittests/module/test_module_controller.py \ - trove/tests/unittests/module/test_module_models.py \ - trove/tests/unittests/module/test_module_views.py \ - trove/tests/unittests/mysql/test_common.py \ - trove/tests/unittests/mysql/test_user_controller.py \ - trove/tests/unittests/network/test_neutron_driver.py \ - trove/tests/unittests/quota/test_quota.py \ - trove/tests/unittests/router/test_router.py \ - trove/tests/unittests/secgroups/test_security_group.py \ - trove/tests/unittests/taskmanager/test_api.py \ - trove/tests/unittests/taskmanager/test_clusters.py \ - trove/tests/unittests/taskmanager/test_galera_clusters.py \ - trove/tests/unittests/taskmanager/test_manager.py \ - trove/tests/unittests/taskmanager/test_models.py \ - trove/tests/unittests/taskmanager/test_vertica_clusters.py \ - trove/tests/unittests/upgrade/test_controller.py \ - trove/tests/unittests/upgrade/test_models.py + ostestr --blacklist_file=blacklist-py3.txt [testenv:debug]