Adding functional tests for memcache_pool backend

Introducing the needed changes to functional tests to run
them against the memcache_pool backend.

These changes introduced a new zuul job related to memcache
to isolate this part during CI and get clear outputs.

Change-Id: Ib84b3db83e8c50c7929874c63177c94f459a1a2c
Co-authored-by: Radosław Piliszek <radoslaw.piliszek@gmail.com>
This commit is contained in:
Hervé Beraud 2020-04-07 19:09:14 +02:00
parent a11cde4cc3
commit df075b2465
3 changed files with 40 additions and 0 deletions

View File

@ -37,6 +37,13 @@
tox_environment:
OSLO_BACKEND: dogpile_cache_bmemcached
- job:
name: oslo.cache-functional-memcache_pool
parent: oslo.cache-functional-memcached
vars:
tox_environment:
OSLO_BACKEND: memcache_pool
- project:
templates:
- check-requirements
@ -50,3 +57,4 @@
jobs:
- oslo.cache-functional-etcd3gw
- oslo.cache-functional-dogpile.cache.bmemcached
- oslo.cache-functional-memcache_pool

View File

@ -0,0 +1,32 @@
# Copyright 2020 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
from oslo_cache.tests.functional import test_base
class TestMemcachePoolCacheBackend(test_base.BaseTestCaseCacheBackend):
def setUp(self):
MEMCACHED_PORT = os.getenv("OSLO_CACHE_TEST_MEMCACHED_PORT", "11211")
self.config_fixture.config(
group='cache',
backend='oslo_cache.memcache_pool',
enabled=True,
memcache_servers=[f'localhost:{MEMCACHED_PORT}']
)
# NOTE(hberaud): super must be called after all to ensure that
# config fixture is properly initialized with value related to
# the current backend in use.
super(TestMemcachePoolCacheBackend, self).setUp()