local_redis = <pytest_redis.executor.RedisExecutor: "/usr/bin/r..." 0x7fca444cce48>
tmp_path = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_server_metrics0')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fca45d56e80>
def test_server_metrics(local_redis, tmp_path, monkeypatch):
"""Test the metrics generation"""
rc = RedisClient(host=local_redis.host, port=local_redis.port)
data = {
"col1": 1,
"col2": 4,
"col3": 6,
"col4": 10,
}
for coll in data.keys():
for i in range(0, data[coll]):
rc.pfadd(coll, i)
cfg = {
"counters": {"cls": "redis", "host": f"{local_redis.host}:{local_redis.port}"}
}
_environment_config_file(tmp_path, monkeypatch, cfg)
> app = make_app_from_configfile()
.tox/py3/lib/python3.7/site-packages/swh/counters/tests/test_server.py:124:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/counters/api/server.py:92: in make_app_from_configfile
app = make_app(api_cfg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
config = {'counters': {'cls': 'redis', 'host': '127.0.0.1:21232'}}
def make_app(config: Dict[str, Any]) -> RPCServerApp:
"""Initialize the remote api application.
"""
app = RPCServerApp(
__name__,
backend_class=CountersInterface,
backend_factory=lambda: get_counters(**config["counters"]),
)
> app.add_backend_class(
backend_class=HistoryInterface,
backend_factory=lambda: get_history(**config["history"]),
)
E AttributeError: 'RPCServerApp' object has no attribute 'add_backend_class'
.tox/py3/lib/python3.7/site-packages/swh/counters/api/server.py:29: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Apr 6 2021, 6:52 PM