mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
wip(sync): add Redis to CI and configure tests settings
This commit is contained in:
parent
a07ee482ce
commit
7e42331533
3 changed files with 19 additions and 1 deletions
4
.github/workflows/test-docs.yml
vendored
4
.github/workflows/test-docs.yml
vendored
|
@ -20,7 +20,9 @@ jobs:
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
POSTGRES_DB: postgres
|
POSTGRES_DB: postgres
|
||||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
import redis
|
||||||
|
from django.conf import settings
|
||||||
from playwright.sync_api import expect
|
from playwright.sync_api import expect
|
||||||
|
|
||||||
from umap.models import DataLayer, Map
|
from umap.models import DataLayer, Map
|
||||||
|
@ -9,6 +11,18 @@ from ..base import DataLayerFactory, MapFactory
|
||||||
|
|
||||||
DATALAYER_UPDATE = re.compile(r".*/datalayer/update/.*")
|
DATALAYER_UPDATE = re.compile(r".*/datalayer/update/.*")
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.django_db
|
||||||
|
|
||||||
|
|
||||||
|
def setup_function():
|
||||||
|
# Sync client to prevent headache with pytest / pytest-asyncio and async
|
||||||
|
client = redis.from_url(settings.REDIS_URL)
|
||||||
|
# Make sure there are no dead peers in the Redis hash, otherwise asking for
|
||||||
|
# operations from another peer may never be answered
|
||||||
|
# FIXME this should not happen in an ideal world
|
||||||
|
assert client.connection_pool.connection_kwargs["db"] == 15
|
||||||
|
client.flushdb()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xdist_group(name="websockets")
|
@pytest.mark.xdist_group(name="websockets")
|
||||||
def test_websocket_connection_can_sync_markers(new_page, asgi_live_server, tilelayer):
|
def test_websocket_connection_can_sync_markers(new_page, asgi_live_server, tilelayer):
|
||||||
|
|
|
@ -29,3 +29,5 @@ PASSWORD_HASHERS = [
|
||||||
WEBSOCKET_ENABLED = True
|
WEBSOCKET_ENABLED = True
|
||||||
WEBSOCKET_BACK_PORT = "8010"
|
WEBSOCKET_BACK_PORT = "8010"
|
||||||
WEBSOCKET_FRONT_URI = "ws://localhost:8010"
|
WEBSOCKET_FRONT_URI = "ws://localhost:8010"
|
||||||
|
|
||||||
|
REDIS_URL = "redis://localhost:6379/15"
|
||||||
|
|
Loading…
Reference in a new issue