test: Configure Celery for integration tests and setup Redis
- Add Celery synchronous execution settings for tests * CELERY_TASK_ALWAYS_EAGER = True (no separate worker needed) * CELERY_TASK_EAGER_PROPAGATES = True * Use memory broker/backend for tests - Add performance marker to pytest.ini * Allows marking tests with @pytest.mark.performance - Setup Redis server via systemd * Enabled redis-server.service for autostart * Redis runs on 127.0.0.1:6379 - Update .gitignore to exclude dump.rdb (Redis dump file) Integration tests status: - 26/47 tests passing (55%) - 21 tests failing due to missing NotificationType fixtures - Tests no longer hang (Celery executes synchronously) Note: Integration tests require NotificationType fixtures to be created before document operations trigger notification signals.
This commit is contained in:
parent
f2f853da37
commit
6e4eabeb4e
2
.gitignore
vendored
2
.gitignore
vendored
@ -109,6 +109,7 @@ celerybeat.pid
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
.kali
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
@ -180,3 +181,4 @@ ooo.html
|
||||
# Test reports
|
||||
newman-report*.json
|
||||
*-report.json
|
||||
dump.rdb
|
||||
|
||||
@ -10,3 +10,9 @@ CHANNEL_LAYERS = {
|
||||
"BACKEND": "channels.layers.InMemoryChannelLayer"
|
||||
}
|
||||
}
|
||||
|
||||
# Celery - синхронное выполнение в тестах (без отдельного worker)
|
||||
CELERY_TASK_ALWAYS_EAGER = True
|
||||
CELERY_TASK_EAGER_PROPAGATES = True
|
||||
CELERY_BROKER_URL = 'memory://'
|
||||
CELERY_RESULT_BACKEND = 'cache+memory://'
|
||||
|
||||
@ -12,6 +12,7 @@ markers =
|
||||
integration: marks tests as integration tests
|
||||
slow: marks tests as slow running
|
||||
asyncio: marks tests as asynchronous tests
|
||||
performance: marks tests as performance tests
|
||||
|
||||
# Исключить manual tests по умолчанию
|
||||
addopts = -m "not manual" --strict-markers
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user