Use branch centric job template for check/gate.

Fixup psutils patching to not use a removed attribute.

Raised upper version bound for psutils.

Change-Id: I0367363bf0d1d3b1a48ff8682a979b5dd1a98a45
This commit is contained in:
James Page 2024-08-13 13:44:09 +01:00
parent 0ed0272b37
commit 53bdfe8927
No known key found for this signature in database
GPG Key ID: BFECAECBA0E7D8C3
4 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
- project:
templates:
- openstack-python3-charm-yoga-jobs
- openstack-python3-charm-jobs
- openstack-cover-jobs

View File

@ -26,4 +26,4 @@ six>=1.9.0
dnspython
psutil>=1.1.1,<2.0.0
psutil>=1.1.1,<6.0.0

View File

@ -1015,7 +1015,7 @@ class UtilsTests(CharmTestCase):
rabbit_utils.check_cluster_memberships())
@mock.patch.object(rabbit_utils, 'cmp_pkgrevno')
@mock.patch('rabbitmq_context.psutil.NUM_CPUS', 2)
@mock.patch('rabbitmq_context.psutil.cpu_count', lambda *args: 2)
@mock.patch('rabbitmq_context.relation_ids')
@mock.patch('rabbitmq_context.config')
def test_render_rabbitmq_env(self, mock_config, mock_relation_ids,

View File

@ -230,7 +230,7 @@ class TestRabbitMQClusterContext(unittest.TestCase):
class TestRabbitMQEnvContext(unittest.TestCase):
@mock.patch.object(rabbitmq_context.psutil, 'NUM_CPUS', 2)
@mock.patch.object(rabbitmq_context.psutil, 'cpu_count', lambda *args: 2)
@mock.patch.object(rabbitmq_context, 'relation_ids', lambda *args: [])
@mock.patch.object(rabbitmq_context, 'service_name')
@mock.patch.object(rabbitmq_context, 'config')
@ -254,7 +254,7 @@ class TestRabbitMQEnvContext(unittest.TestCase):
'RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS':
"'+A 72'"})
@mock.patch.object(rabbitmq_context.psutil, 'NUM_CPUS', 2)
@mock.patch.object(rabbitmq_context.psutil, 'cpu_count', lambda *args: 2)
@mock.patch.object(rabbitmq_context, 'relation_ids')
@mock.patch.object(rabbitmq_context, 'service_name')
@mock.patch.object(rabbitmq_context, 'config')
@ -290,7 +290,7 @@ class TestRabbitMQEnvContext(unittest.TestCase):
{'RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS':
"'+A 48'"})
@mock.patch.object(rabbitmq_context.psutil, 'NUM_CPUS', 2)
@mock.patch.object(rabbitmq_context.psutil, 'cpu_count', lambda *args: 2)
@mock.patch.object(rabbitmq_context, 'relation_ids')
@mock.patch.object(rabbitmq_context, 'service_name')
@mock.patch.object(rabbitmq_context, 'config')
@ -317,7 +317,7 @@ class TestRabbitMQEnvContext(unittest.TestCase):
"'+A 48'"})
@mock.patch.object(rabbitmq_context, 'relation_ids', lambda *args: [])
@mock.patch.object(rabbitmq_context.psutil, 'NUM_CPUS', 40)
@mock.patch.object(rabbitmq_context.psutil, 'cpu_count', lambda *args: 40)
@mock.patch.object(rabbitmq_context, 'service_name')
@mock.patch.object(rabbitmq_context, 'config')
def test_rabbitmqenv_in_container(self, mock_config, mock_service_name):
@ -351,7 +351,7 @@ class TestRabbitMQEnvContext(unittest.TestCase):
{'RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS':
"'+A 960'"})
@mock.patch.object(rabbitmq_context.psutil, 'NUM_CPUS', 48)
@mock.patch.object(rabbitmq_context.psutil, 'cpu_count', lambda *args: 48)
@mock.patch.object(rabbitmq_context, 'relation_ids', lambda *args: [])
@mock.patch.object(rabbitmq_context, 'service_name')
@mock.patch.object(rabbitmq_context, 'config')
@ -375,7 +375,7 @@ class TestRabbitMQEnvContext(unittest.TestCase):
{'RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS':
"'+A 480'"})
@mock.patch.object(rabbitmq_context.psutil, 'NUM_CPUS', 48)
@mock.patch.object(rabbitmq_context.psutil, 'cpu_count', lambda *args: 48)
@mock.patch.object(rabbitmq_context, 'relation_ids', lambda *args: [])
@mock.patch.object(rabbitmq_context.rabbit_utils, 'use_long_node_name')
@mock.patch.object(rabbitmq_context, 'service_name')