diff --git a/src/mock_vws/_flask_server/Dockerfile b/src/mock_vws/_flask_server/Dockerfile index 9565f9d90..4981a38f4 100644 --- a/src/mock_vws/_flask_server/Dockerfile +++ b/src/mock_vws/_flask_server/Dockerfile @@ -11,12 +11,11 @@ COPY --chown=myuser:myuser . /app # See https://pythonspeed.com/articles/activate-virtualenv-dockerfile/ # For why we use this method of activating the virtual environment. -ENV VIRTUAL_ENV=/app/docker_venvs/.venv ENV UV_PROJECT_ENVIRONMENT=/app/docker_venvs/.venv -ENV PATH="$VIRTUAL_ENV/bin:$PATH" +ENV PATH="$UV_PROJECT_ENVIRONMENT/bin:$PATH" WORKDIR /app -RUN python3 -m venv $VIRTUAL_ENV && \ +RUN python3 -m venv $UV_PROJECT_ENVIRONMENT && \ pip install --no-cache-dir uv==0.10.4 && \ uv sync --no-cache EXPOSE 5000 diff --git a/tests/mock_vws/test_query.py b/tests/mock_vws/test_query.py index 49151ccdb..716ba627f 100644 --- a/tests/mock_vws/test_query.py +++ b/tests/mock_vws/test_query.py @@ -9,6 +9,7 @@ import datetime import io import json +import re import textwrap import time import uuid @@ -72,6 +73,8 @@ """, ) +_JETTY_VERSION_RE = re.compile(pattern=r"Powered by Jetty:// [\d.]+") + _NGINX_REQUEST_ENTITY_TOO_LARGE_ERROR = textwrap.dedent( text="""\ \r @@ -252,7 +255,11 @@ def test_incorrect_no_boundary( if resp_status_code != HTTPStatus.INTERNAL_SERVER_ERROR: handle_server_errors(response=vws_response) - assert requests_response.text == resp_text + repl = "Powered by Jetty://" + sub = _JETTY_VERSION_RE.sub + actual = sub(repl=repl, string=requests_response.text) + expected = sub(repl=repl, string=resp_text) + assert actual == expected assert_vwq_failure( response=vws_response, status_code=resp_status_code,