diff --git a/app/config/settings.py b/app/config/settings.py index 0a2ad69ee0..b0ff6093aa 100644 --- a/app/config/settings.py +++ b/app/config/settings.py @@ -855,7 +855,6 @@ def strtobool(val) -> bool: RETINA_DEFAULT_THUMBNAIL_SIZE = 128 # Retina specific settings -RETINA_IMAGE_CACHE_TIME = 60 * 60 * 24 * 7 RETINA_GRADERS_GROUP_NAME = "retina_graders" RETINA_ADMINS_GROUP_NAME = "retina_admins" RETINA_IMPORT_USER_NAME = "retina_import_user" diff --git a/app/grandchallenge/retina_api/urls.py b/app/grandchallenge/retina_api/urls.py index 6f9b36b4ac..791a095d25 100644 --- a/app/grandchallenge/retina_api/urls.py +++ b/app/grandchallenge/retina_api/urls.py @@ -1,6 +1,4 @@ -from django.conf import settings from django.urls import include, path -from django.views.decorators.cache import cache_page from rest_framework.routers import SimpleRouter from grandchallenge.retina_api import views @@ -47,23 +45,17 @@ path("archives/", views.ArchiveView.as_view(), name="archives-api-view"), path( "archive_data/", - cache_page(settings.RETINA_IMAGE_CACHE_TIME)( - views.ArchiveAPIView.as_view() - ), + views.ArchiveAPIView.as_view(), name="archive-data-api-view", ), path( "archive_data//", - cache_page(settings.RETINA_IMAGE_CACHE_TIME)( - views.ArchiveAPIView.as_view() - ), + views.ArchiveAPIView.as_view(), name="archive-data-api-view", ), path( "image//////", - cache_page(settings.RETINA_IMAGE_CACHE_TIME)( - views.ImageView.as_view() - ), + views.ImageView.as_view(), name="image-api-view", ), path( @@ -99,16 +91,12 @@ path("annotation//", include(annotation_router.urls)), path( "image/thumbnail//", - cache_page(settings.RETINA_IMAGE_CACHE_TIME)( - views.B64ThumbnailAPIView.as_view() - ), + views.B64ThumbnailAPIView.as_view(), name="image-thumbnail", ), path( "image/thumbnail////", - cache_page(settings.RETINA_IMAGE_CACHE_TIME)( - views.B64ThumbnailAPIView.as_view() - ), + views.B64ThumbnailAPIView.as_view(), name="image-thumbnail", ), ] diff --git a/app/grandchallenge/retina_core/urls.py b/app/grandchallenge/retina_core/urls.py index 989fce71e1..929a826deb 100644 --- a/app/grandchallenge/retina_core/urls.py +++ b/app/grandchallenge/retina_core/urls.py @@ -1,6 +1,4 @@ -from django.conf import settings from django.urls import include, path -from django.views.decorators.cache import cache_page from grandchallenge.retina_core.views import ( IndexView, @@ -18,12 +16,12 @@ ), path( "image/thumbnail//", - cache_page(settings.RETINA_IMAGE_CACHE_TIME)(ThumbnailView.as_view()), + ThumbnailView.as_view(), name="image-thumbnail", ), path( "image/numpy//", - cache_page(settings.RETINA_IMAGE_CACHE_TIME)(NumpyView.as_view()), + NumpyView.as_view(), name="image-numpy", ), ] diff --git a/app/pytest.ini b/app/pytest.ini index 345ea3e9f2..0e59a22fec 100644 --- a/app/pytest.ini +++ b/app/pytest.ini @@ -2,7 +2,8 @@ DJANGO_SETTINGS_MODULE = tests.settings testpaths = tests python_files = tests.py test_*.py *_tests.py -addopts = --strict --showlocals -p no:cacheprovider -n auto --dist loadscope +addopts = --strict --showlocals -n auto --dist loadscope +cache_dir = /tmp/pytest_cache markers = integration: integration tests filterwarnings = diff --git a/docker-compose.yml b/docker-compose.yml index 2d057040bf..034057b101 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -115,11 +115,6 @@ services: target: /var/run/docker.sock group_add: - ${DOCKER_GID-999} # The docker group is only needed for testing - healthcheck: - test: ["CMD-SHELL", "curl http://web:8000/ || exit 1"] - interval: 10s - timeout: 5s - retries: 5 http: image: grandchallenge/http:latest @@ -139,7 +134,7 @@ services: - "443:443" depends_on: web: - condition: service_healthy + condition: service_started workstation-proxy: condition: service_started @@ -167,7 +162,7 @@ services: hostname: "celery-worker" depends_on: web: - condition: service_healthy + condition: service_started postgres: condition: service_healthy redis: @@ -191,7 +186,7 @@ services: hostname: "celery-worker-evaluation" depends_on: web: - condition: service_healthy + condition: service_started postgres: condition: service_healthy redis: @@ -221,7 +216,7 @@ services: hostname: "celery-worker-gpu" depends_on: web: - condition: service_healthy + condition: service_started postgres: condition: service_healthy redis: @@ -248,7 +243,7 @@ services: " depends_on: web: - condition: service_healthy + condition: service_started postgres: condition: service_healthy redis: diff --git a/poetry.lock b/poetry.lock index 5dd2264644..5bdb911d96 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1290,6 +1290,17 @@ pytest = ">=2.7" [package.extras] dev = ["pre-commit", "tox", "pytest-asyncio"] +[[package]] +category = "dev" +description = "Pytest plugin to randomly order tests and control random.seed." +name = "pytest-randomly" +optional = false +python-versions = ">=3.5" +version = "3.4.0" + +[package.dependencies] +pytest = "*" + [[package]] category = "dev" description = "pytest xdist plugin for distributed testing and loop-on-failing modes" @@ -2038,7 +2049,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" version = "1.2.0" [metadata] -content-hash = "5e33650cc9be5878fab8af0e6a7a44e45d59e34ce4871cf7929e950505b536e1" +content-hash = "bc2894a547ad0ae6839b36962c37235db556337c8c47976a18e13e09ddbef3c4" python-versions = "^3.8" [metadata.files] @@ -2721,6 +2732,10 @@ pytest-mock = [ {file = "pytest-mock-3.1.1.tar.gz", hash = "sha256:636e792f7dd9e2c80657e174c04bf7aa92672350090736d82e97e92ce8f68737"}, {file = "pytest_mock-3.1.1-py3-none-any.whl", hash = "sha256:a9fedba70e37acf016238bb2293f2652ce19985ceb245bbd3d7f3e4032667402"}, ] +pytest-randomly = [ + {file = "pytest-randomly-3.4.0.tar.gz", hash = "sha256:e44a69623237e47cc4ee77da9c04c6b505ed1a7b00656dc1409f8344c707b87b"}, + {file = "pytest_randomly-3.4.0-py3-none-any.whl", hash = "sha256:4e02887ba52f021cc8d5429e91e93be2b5df4adf38bf1715c7c153968b260b59"}, +] pytest-xdist = [ {file = "pytest-xdist-1.32.0.tar.gz", hash = "sha256:1d4166dcac69adb38eeaedb88c8fada8588348258a3492ab49ba9161f2971129"}, {file = "pytest_xdist-1.32.0-py2.py3-none-any.whl", hash = "sha256:ba5ec9fde3410bd9a116ff7e4f26c92e02fa3d27975ef3ad03f330b3d4b54e91"}, diff --git a/pyproject.toml b/pyproject.toml index f2e831cb68..69cb4d471d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,3 +85,4 @@ sphinx-autodoc-typehints = "*" werkzeug = "*" sphinx-rtd-theme = "*" sphinxcontrib-plantuml = "*" +pytest-randomly = "*"