Adapted tests to use a locally started Redis instance.

This commit is contained in:
Fabio Manganiello 2023-07-24 10:37:07 +02:00
parent 7a20fec52f
commit 91cd08cdff
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
4 changed files with 23 additions and 11 deletions

View file

@ -443,7 +443,10 @@ class Backend(Thread, EventGenerator, ExtensionWithManifest):
)
if self.zeroconf:
try:
self.zeroconf.close()
except TimeoutError:
pass
if self.zeroconf_info:
self.bus.post(

View file

@ -219,8 +219,12 @@ class Config:
config = {}
try:
with open(cfgfile, 'r') as fp:
file_config = yaml.safe_load(fp)
except FileNotFoundError:
print(f'Unable to open config file {cfgfile}')
return config
if not file_config:
return config

View file

@ -30,7 +30,12 @@ def app():
logging.info('Starting Platypush test service')
Config.init(config_file)
_app = Application(config_file=config_file, redis_queue='platypush-tests/bus')
_app = Application(
config_file=config_file,
redis_queue='platypush-tests/bus',
start_redis=True,
redis_port=16379,
)
Thread(target=_app.run).start()
logging.info(
'Sleeping %d seconds while waiting for the daemon to start up',

View file

@ -9,5 +9,5 @@ backend.http:
num_workers: 1
use_werkzeug_server: True
backend.redis:
disabled: False
redis:
port: 16379