Pin redis<3
The latest version of redis-py breaks the unit tests:
=================================== FAILURES ===================================
_________________________________ test_nagios __________________________________
capsys = <_pytest.capture.CaptureFixture object at 0x119c9e390>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x119d67048>
socket_enabled = None
starter = <class 'gwcelery.tests.process.starter.<locals>.Starter'>
tmpdir = local('/private/var/folders/cs/pwq97bws17d2p8qcp410gs7c84mbdz/T/pytest-of-lpsinger/pytest-7/test_nagios0')
def test_nagios(capsys, monkeypatch, socket_enabled, starter, tmpdir):
# no broker
unix_socket = str(tmpdir / 'sock')
monkeypatch.setenv('CELERY_BROKER_URL', 'redis+socket://' + unix_socket)
with pytest.raises(SystemExit) as excinfo:
app.start(['gwcelery', 'nagios'])
assert excinfo.value.code == nagios.NagiosPluginStatus.CRITICAL
out, err = capsys.readouterr()
assert 'CRITICAL: No connection to broker' in out
# broker, no worker
redis_server = find_executable('redis-server')
if redis_server is None:
pytest.skip('redis-server is not installed')
starter.exec_process(
[redis_server, '--port', '0', '--unixsocket', unix_socket,
'--unixsocketperm', '700'], timeout=10,
magic_words=b'The server is now ready to accept connections')
with pytest.raises(SystemExit) as excinfo:
app.start(['gwcelery', 'nagios'])
assert excinfo.value.code == nagios.NagiosPluginStatus.CRITICAL
out, err = capsys.readouterr()
assert 'CRITICAL: Not all expected queues are active' in out
# worker, no tasks
starter.python_process(
args=(['gwcelery', 'worker', '-l', 'info',
'-Q', 'celery,exttrig,openmp,superevent'],),
target=app.start, timeout=10, magic_words=b'ready.')
with pytest.raises(SystemExit) as excinfo:
app.start(['gwcelery', 'nagios'])
assert excinfo.value.code == nagios.NagiosPluginStatus.CRITICAL
out, err = capsys.readouterr()
> assert 'CRITICAL: Not all expected tasks are active' in out
E AssertionError: assert 'CRITICAL: Not all expected tasks are active' in ' \n -------------- celery@gs66-wintermute v4.2.1 (windowlicker)\n---- **** ----- \n--- * *** * -- Darwin-18.2.0-x86_...nCRITICAL: Not all expected queues are active\nAssertionError: Missing queues: openmp, exttrig, celery, superevent\n\n'
gwcelery/tests/test_nagios.py:60: AssertionError