py34: Get rid of py3-testlist

We're close to the end of porting all unit tests
to be compatible with python34. However, ~8 tests are skipped
specifically in python34 because of bugs mostly in mox3.
Those tests will likely have to be converted to mock in
the future. Note that from now on, every test added will have
to be python34 compatible.

Also, fix __str__ function of ExceptionGroup in test_scheduler.
It intentionally uses str so as to not flatten the unicode
literal in python2.7 and also be compatible with python3.4

blueprint heat-python34-support

Change-Id: Id9b8aa11b17c96895092dd701b761a479df09282
This commit is contained in:
Sirushti Murugesan 2015-09-22 21:41:31 +05:30
parent 413b71dc9d
commit 3f635a26a4
5 changed files with 5 additions and 194 deletions

View File

@ -124,7 +124,7 @@ class ExceptionGroup(Exception):
self.exceptions = list(exceptions) self.exceptions = list(exceptions)
def __str__(self): def __str__(self):
return six.text_type([six.text_type(ex) for ex in self.exceptions]) return str([str(ex) for ex in self.exceptions])
@six.python_2_unicode_compatible @six.python_2_unicode_compatible

View File

@ -31,7 +31,6 @@ from oslo_db.sqlalchemy import utils
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
import six import six
import sqlalchemy import sqlalchemy
import testtools
from heat.db.sqlalchemy import migrate_repo from heat.db.sqlalchemy import migrate_repo
from heat.db.sqlalchemy import migration from heat.db.sqlalchemy import migration
@ -67,7 +66,6 @@ class HeatMigrationsCheckers(test_migrations.WalkVersionsMixin,
def migrate_engine(self): def migrate_engine(self):
return self.engine return self.engine
@testtools.skipIf(six.PY3, "skip until a new release of oslo.db is cut")
def test_walk_versions(self): def test_walk_versions(self):
self.walk_versions(self.snake_walk, self.downgrade) self.walk_versions(self.snake_walk, self.downgrade)

View File

@ -12,8 +12,10 @@
# under the License. # under the License.
import contextlib import contextlib
import testtools
import eventlet import eventlet
import six
from heat.common import timeutils from heat.common import timeutils
from heat.engine import dependencies from heat.engine import dependencies
@ -60,7 +62,7 @@ class ExceptionGroupTest(common.HeatTestCase):
ex2 = Exception("ex 2") ex2 = Exception("ex 2")
exception_group = scheduler.ExceptionGroup([ex1, ex2]) exception_group = scheduler.ExceptionGroup([ex1, ex2])
self.assertEqual("[u'ex 1', u'ex 2']", str(exception_group)) self.assertEqual("['ex 1', 'ex 2']", six.text_type(exception_group))
class DependencyTaskGroupTest(common.HeatTestCase): class DependencyTaskGroupTest(common.HeatTestCase):
@ -312,6 +314,7 @@ class DependencyTaskGroupTest(common.HeatTestCase):
self.assertEqual(e1, exc) self.assertEqual(e1, exc)
@testtools.skipIf(six.PY3, "mox3 bug")
class TaskTest(common.HeatTestCase): class TaskTest(common.HeatTestCase):
def setUp(self): def setUp(self):

View File

@ -1,182 +0,0 @@
rackspace.tests
heat_docker.tests
heat.tests.api
heat.tests.api.aws.test_api_aws
heat.tests.api.aws.test_api_ec2token
heat.tests.api.cfn.test_api_v1
heat.tests.api.cloudwatch.test_api_cloudwatch
heat.tests.api.middleware.test_ssl_middleware
heat.tests.api.middleware.test_version_negotiation_middleware
heat.tests.api.openstack_v1.test_stacks_view
heat.tests.api.openstack_v1.test_stacks
heat.tests.api.openstack_v1.test_util
heat.tests.api.openstack_v1.test_views_common
heat.tests.api.test_wsgi
heat.tests.autoscaling
heat.tests.autoscaling.test_heat_scaling_group
heat.tests.autoscaling.test_heat_scaling_policy
heat.tests.autoscaling.test_launch_config
heat.tests.autoscaling.test_lbutils
heat.tests.autoscaling.test_new_capacity
heat.tests.autoscaling.test_scaling_group
heat.tests.autoscaling.test_scaling_policy
heat.tests.aws
heat.tests.aws.test_instance_network
heat.tests.aws.test_loadbalancer
heat.tests.aws.test_network_interface
heat.tests.aws.test_s3
heat.tests.aws.test_security_group
heat.tests.aws.test_user
heat.tests.aws.test_volume
heat.tests.barbican.test_order
heat.tests.barbican.test_secret
heat.tests.ceilometer.test_ceilometer_alarm
heat.tests.ceilometer.test_gnocchi_alarm
heat.tests.cinder.test_cinder_volume_type
heat.tests.cinder.test_volume
heat.tests.cinder.test_volume_type_encryption
heat.tests.clients
heat.tests.clients.test_barbican_client
heat.tests.clients.test_cinder_client
heat.tests.clients.test_glance_client
heat.tests.clients.test_keystone_client
heat.tests.clients.test_magnum_client
heat.tests.clients.test_manila_client
heat.tests.clients.test_mistral_client
heat.tests.clients.test_neutron_client
heat.tests.clients.test_sahara_client
heat.tests.clients.test_zaqar_client
heat.tests.db
heat.tests.db.test_migrations
heat.tests.db.test_sqlalchemy_api
heat.tests.db.test_sqlalchemy_filters
heat.tests.db.test_sqlalchemy_types
heat.tests.db.test_utils
heat.tests.engine.test_engine_worker
heat.tests.engine.test_service_engine
heat.tests.engine.test_stack_action
heat.tests.engine.test_stack_create
heat.tests.engine.test_stack_delete
heat.tests.engine.test_stack_events
heat.tests.engine.test_stack_snapshot
heat.tests.engine.test_threadgroup_mgr
heat.tests.keystone
heat.tests.keystone.test_endpoint
heat.tests.keystone.test_group
heat.tests.keystone.test_project
heat.tests.keystone.test_role
heat.tests.keystone.test_role_assignments
heat.tests.keystone.test_service
heat.tests.keystone.test_user
heat.tests.manila.test_manila_security_service
heat.tests.manila.test_manila_share
heat.tests.manila.test_manila_share_type
heat.tests.manila.test_share_network
heat.tests.mistral.test_mistral_cron_trigger
heat.tests.mistral.test_mistral_workflow
heat.tests.neutron
heat.tests.neutron.test_extraroute
heat.tests.neutron.test_neutron
heat.tests.neutron.test_neutron_firewall
heat.tests.neutron.test_neutron_floating_ip
heat.tests.neutron.test_neutron_metering
heat.tests.neutron.test_neutron_net
heat.tests.neutron.test_neutron_network_gateway
heat.tests.neutron.test_neutron_port
heat.tests.neutron.test_neutron_provider_net
heat.tests.neutron.test_neutron_router
heat.tests.neutron.test_neutron_security_group
heat.tests.neutron.test_neutron_subnet
heat.tests.neutron.test_neutron_vpnservice
heat.tests.nova
heat.tests.nova.test_nova_flavor
heat.tests.nova.test_nova_floatingip
heat.tests.nova.test_nova_keypair
heat.tests.nova.test_nova_servergroup
heat.tests.nova.test_server
heat.tests.openstack
heat.tests.test_attributes
heat.tests.test_auth_password
heat.tests.test_auth_url
heat.tests.test_cloud_config
heat.tests.test_cloudwatch
heat.tests.test_common_context
heat.tests.test_common_param_utils
heat.tests.test_common_policy
heat.tests.test_common_serializers
heat.tests.test_common_service_utils
heat.tests.test_constraints
heat.tests.test_convg_stack
heat.tests.test_crypt
heat.tests.test_cw_alarm
heat.tests.test_dbinstance
heat.tests.test_empty_stack
heat.tests.test_engine_api_utils
heat.tests.test_engine_service
heat.tests.test_engine_service_stack_watch
heat.tests.test_environment
heat.tests.test_environment_format
heat.tests.test_event
heat.tests.test_exception
heat.tests.test_fault_middleware
heat.tests.test_function
heat.tests.test_glance_image
heat.tests.test_grouputils
heat.tests.test_hot
heat.tests.test_identifier
heat.tests.test_instance_group
heat.tests.test_instance_group_update_policy
heat.tests.test_iso_8601
heat.tests.test_lifecycle_plugin_utils
heat.tests.test_loguserdata
heat.tests.test_magnum_baymodel
heat.tests.test_metadata_refresh
heat.tests.test_multi_part
heat.tests.test_nested_stack
heat.tests.test_nokey
heat.tests.test_notifications
heat.tests.test_os_database
heat.tests.test_parameters
heat.tests.test_plugin_loader
heat.tests.test_plugin_manager
heat.tests.test_properties
heat.tests.test_provider_template
heat.tests.test_random_string
heat.tests.test_remote_stack
heat.tests.test_resource
heat.tests.test_resource_group
heat.tests.test_restarter
heat.tests.test_rpc_client
heat.tests.test_rpc_listener_client
heat.tests.test_rpc_worker_client
heat.tests.test_rsrc_defn
heat.tests.test_sahara_cluster
heat.tests.test_sahara_templates
heat.tests.test_scaling_template
heat.tests.test_server_tags
heat.tests.test_short_id
heat.tests.test_software_component
heat.tests.test_software_config
heat.tests.test_software_deployment
heat.tests.test_stack
heat.tests.test_stack_collect_attributes
heat.tests.test_stack_delete
heat.tests.test_stack_lock
heat.tests.test_stack_resource
heat.tests.test_stack_update
heat.tests.test_stack_user
heat.tests.test_structured_config
heat.tests.test_support
heat.tests.test_swift
heat.tests.test_swiftsignal
heat.tests.test_sync_point
heat.tests.test_template
heat.tests.test_template_format
heat.tests.test_timeutils
heat.tests.test_trove_cluster
heat.tests.test_urlfetch
heat.tests.test_validate
heat.tests.test_version
heat.tests.test_vpc
heat.tests.test_watch
heat.tests.test_zaqar_queue

View File

@ -56,14 +56,6 @@ commands =
oslo-config-generator --config-file=config-generator.conf oslo-config-generator --config-file=config-generator.conf
oslo-config-generator --config-file=heat_integrationtests/config-generator.conf oslo-config-generator --config-file=heat_integrationtests/config-generator.conf
# FIXME(sirushtim): Sneak in flake8 here for now. This env will also be used
# to run the tests in the near future.
[testenv:py34]
commands =
flake8 heat bin/heat-api bin/heat-api-cfn bin/heat-api-cloudwatch bin/heat-engine bin/heat-manage contrib heat_integrationtests
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.pyc' -delete
bash tools/run-py3-tests.sh
[testenv:bandit] [testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = bandit -c bandit.yaml -r heat -n5 -p heat_conservative commands = bandit -c bandit.yaml -r heat -n5 -p heat_conservative