Add functional test with redis backend
Change-Id: I6318f6ad00d5b0ee3db1be5e8671a4c346b9daff
This commit is contained in:
parent
dffb1e4178
commit
bba5cc1a11
24
.zuul.yaml
24
.zuul.yaml
@ -51,6 +51,28 @@
|
|||||||
tox_environment:
|
tox_environment:
|
||||||
OSLO_BACKEND: memcache_pool
|
OSLO_BACKEND: memcache_pool
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: oslo.cache-functional-redis
|
||||||
|
parent: oslo.cache-functional
|
||||||
|
vars:
|
||||||
|
tox_environment:
|
||||||
|
PIFPAF_DAEMON: redis
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: oslo.cache-functional-dogpile.cache.redis
|
||||||
|
parent: oslo.cache-functional-redis
|
||||||
|
vars:
|
||||||
|
tox_environment:
|
||||||
|
OSLO_BACKEND: dogpile_cache_redis
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: oslo.cache-functional-dogpile.cache.redis_sentinel
|
||||||
|
parent: oslo.cache-functional-redis
|
||||||
|
vars:
|
||||||
|
tox_environment:
|
||||||
|
OSLO_BACKEND: dogpile_cache_redis_sentinel
|
||||||
|
PIFPAF_OPTS: --sentinel
|
||||||
|
|
||||||
- project:
|
- project:
|
||||||
templates:
|
templates:
|
||||||
- check-requirements
|
- check-requirements
|
||||||
@ -65,3 +87,5 @@
|
|||||||
- oslo.cache-functional-dogpile.cache.bmemcached
|
- oslo.cache-functional-dogpile.cache.bmemcached
|
||||||
- oslo.cache-functional-dogpile.cache.pymemcache
|
- oslo.cache-functional-dogpile.cache.pymemcache
|
||||||
- oslo.cache-functional-memcache_pool
|
- oslo.cache-functional-memcache_pool
|
||||||
|
- oslo.cache-functional-dogpile.cache.redis
|
||||||
|
- oslo.cache-functional-dogpile.cache.redis_sentinel
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
# Copyright 2024 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.
|
||||||
|
|
||||||
|
from oslo_cache.tests.functional import test_base
|
||||||
|
|
||||||
|
|
||||||
|
class TestRedisCacheBackend(test_base.BaseTestCaseCacheBackend):
|
||||||
|
def setUp(self):
|
||||||
|
self.config_fixture.config(
|
||||||
|
group='cache',
|
||||||
|
backend='dogpule.cache.redis',
|
||||||
|
redis_server='127.0.0.1:6379',
|
||||||
|
)
|
||||||
|
|
||||||
|
# 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().setUp()
|
@ -0,0 +1,29 @@
|
|||||||
|
# Copyright 2024 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.
|
||||||
|
|
||||||
|
from oslo_cache.tests.functional import test_base
|
||||||
|
|
||||||
|
|
||||||
|
class TestRedisSentinelCacheBackend(test_base.BaseTestCaseCacheBackend):
|
||||||
|
def setUp(self):
|
||||||
|
self.config_fixture.config(
|
||||||
|
group='cache',
|
||||||
|
backend='dogpule.cache.redis_sentine;',
|
||||||
|
redis_sentinels=['127.0.0.1:6380'],
|
||||||
|
)
|
||||||
|
|
||||||
|
# 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().setUp()
|
2
tox.ini
2
tox.ini
@ -17,7 +17,7 @@ setenv =
|
|||||||
STESTR_TEST_PATH=./oslo_cache/tests/functional/{env:OSLO_BACKEND}
|
STESTR_TEST_PATH=./oslo_cache/tests/functional/{env:OSLO_BACKEND}
|
||||||
commands =
|
commands =
|
||||||
find . -type f -name "*.pyc" -delete
|
find . -type f -name "*.pyc" -delete
|
||||||
pifpaf -e OSLO_CACHE_TEST run {env:PIFPAF_DAEMON} -- stestr run --slowest
|
pifpaf -e OSLO_CACHE_TEST run {env:PIFPAF_DAEMON} {env:PIFPAF_OPTS} -- stestr run --slowest
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps =
|
deps =
|
||||||
|
Loading…
Reference in New Issue
Block a user