forked from platypush/platypush
Adapted tests to use a locally started Redis instance.
This commit is contained in:
parent
7a20fec52f
commit
91cd08cdff
4 changed files with 23 additions and 11 deletions
|
@ -443,7 +443,10 @@ class Backend(Thread, EventGenerator, ExtensionWithManifest):
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.zeroconf:
|
if self.zeroconf:
|
||||||
self.zeroconf.close()
|
try:
|
||||||
|
self.zeroconf.close()
|
||||||
|
except TimeoutError:
|
||||||
|
pass
|
||||||
|
|
||||||
if self.zeroconf_info:
|
if self.zeroconf_info:
|
||||||
self.bus.post(
|
self.bus.post(
|
||||||
|
|
|
@ -219,8 +219,12 @@ class Config:
|
||||||
|
|
||||||
config = {}
|
config = {}
|
||||||
|
|
||||||
with open(cfgfile, 'r') as fp:
|
try:
|
||||||
file_config = yaml.safe_load(fp)
|
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:
|
if not file_config:
|
||||||
return config
|
return config
|
||||||
|
|
|
@ -30,7 +30,12 @@ def app():
|
||||||
logging.info('Starting Platypush test service')
|
logging.info('Starting Platypush test service')
|
||||||
|
|
||||||
Config.init(config_file)
|
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()
|
Thread(target=_app.run).start()
|
||||||
logging.info(
|
logging.info(
|
||||||
'Sleeping %d seconds while waiting for the daemon to start up',
|
'Sleeping %d seconds while waiting for the daemon to start up',
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
include:
|
include:
|
||||||
- include/test_procedure.yaml
|
- include/test_procedure.yaml
|
||||||
|
|
||||||
main.db:
|
main.db:
|
||||||
engine: sqlite:////tmp/platypush-tests.db
|
engine: sqlite:////tmp/platypush-tests.db
|
||||||
|
|
||||||
backend.http:
|
backend.http:
|
||||||
port: 8123
|
port: 8123
|
||||||
num_workers: 1
|
num_workers: 1
|
||||||
use_werkzeug_server: True
|
use_werkzeug_server: True
|
||||||
|
|
||||||
backend.redis:
|
redis:
|
||||||
disabled: False
|
port: 16379
|
||||||
|
|
Loading…
Reference in a new issue