Exemplo n.º 1
0
 def run(args):
     new_app = {
         'instances': 10,
         'labels': {
             'HAPROXY_DEPLOYMENT_TARGET_INSTANCES': 30
         }
     }
     old_app = {'instances': 8}
     args.initial_instances = 5
     zdd.scale_new_app_instances(args, new_app, old_app)
     mock.assert_called_with(args, new_app, 30)
Exemplo n.º 2
0
 def run(args):
     new_app = {
         'instances': 10,
         'labels': {
             'HAPROXY_DEPLOYMENT_TARGET_INSTANCES': 30
         }
     }
     old_app = {'instances': 8}
     args.initial_instances = 5
     zdd.scale_new_app_instances(args, new_app, old_app)
     mock.assert_called_with(
         args, new_app, 30)
Exemplo n.º 3
0
 def test_scale_new_app_instances_to_target(self, mock):
     """When scaling new instances up, if we have met or surpassed the
        amount of instances deployed for old_app, go right to our
        deployment target amount of instances for new_app
     """
     new_app = {
         'instances': 10,
         'labels': {
             'HAPROXY_DEPLOYMENT_TARGET_INSTANCES': 30
         }
     }
     old_app = {'instances': 8}
     args = Arguments()
     args.initial_instances = 5
     zdd.scale_new_app_instances(args, new_app, old_app)
     mock.assert_called_with(args, new_app, 30)
Exemplo n.º 4
0
 def test_scale_new_app_instances_up_50_percent(self, mock):
     """When scaling new_app instances, increase instances by 50% of
        existing instances if we have not yet met or surpassed the amount
        of instances deployed by old_app
     """
     new_app = {
         'instances': 10,
         'labels': {
             'HAPROXY_DEPLOYMENT_TARGET_INSTANCES': 30
         }
     }
     old_app = {'instances': 30}
     args = Arguments()
     args.initial_instances = 5
     zdd.scale_new_app_instances(args, new_app, old_app)
     mock.assert_called_with(args, new_app, 15)
Exemplo n.º 5
0
 def test_scale_new_app_instances_to_target(self, mock):
     """When scaling new instances up, if we have met or surpassed the
        amount of instances deployed for old_app, go right to our
        deployment target amount of instances for new_app
     """
     new_app = {
         'instances': 10,
         'labels': {
             'HAPROXY_DEPLOYMENT_TARGET_INSTANCES': 30
         }
     }
     old_app = {'instances': 8}
     args = Arguments()
     args.initial_instances = 5
     zdd.scale_new_app_instances(args, new_app, old_app)
     mock.assert_called_with(
         args, new_app, 30)
Exemplo n.º 6
0
 def test_scale_new_app_instances_up_50_percent(self, mock):
     """When scaling new_app instances, increase instances by 50% of
        existing instances if we have not yet met or surpassed the amount
        of instances deployed by old_app
     """
     new_app = {
         'instances': 10,
         'labels': {
             'HAPROXY_DEPLOYMENT_TARGET_INSTANCES': 30
         }
     }
     old_app = {'instances': 30}
     args = Arguments()
     args.initial_instances = 5
     zdd.scale_new_app_instances(args, new_app, old_app)
     mock.assert_called_with(
         args, new_app, 15)