From b43ad927e9b496ccb6f4ff1c2764187b0a0fef45 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 18 Feb 2026 10:26:31 +0000 Subject: [PATCH 1/5] Remove redundant VIRTUAL_ENV variable from Dockerfile Replace VIRTUAL_ENV with UV_PROJECT_ENVIRONMENT, which holds the same value and is already set. This reduces environment variable duplication. Co-Authored-By: Claude Haiku 4.5 --- src/mock_vws/_flask_server/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 From abb522f37591d235f77aaf202ac60679c1cfe68e Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 18 Feb 2026 10:49:05 +0000 Subject: [PATCH 2/5] Update expected Jetty version to 12.1.6 The real Vuforia service upgraded from Jetty 12.0.20 to 12.1.6, causing the hardcoded expected response body to no longer match. Co-Authored-By: Claude Haiku 4.5 --- tests/mock_vws/test_query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mock_vws/test_query.py b/tests/mock_vws/test_query.py index 49151ccdb..bb3962a3e 100644 --- a/tests/mock_vws/test_query.py +++ b/tests/mock_vws/test_query.py @@ -65,7 +65,7 @@ STATUS:400 MESSAGE:Bad Request -
Powered by Jetty:// 12.0.20
+
Powered by Jetty:// 12.1.6
From e092ac09e426c6f5d0db8baea59a35b743cf0269 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 18 Feb 2026 10:56:14 +0000 Subject: [PATCH 3/5] Normalize Jetty version when asserting query error response The real Vuforia service load-balances across instances with different Jetty versions, causing the exact-match assertion to flap. Normalize the version string before comparing so the test is stable. Co-Authored-By: Claude Haiku 4.5 --- tests/mock_vws/test_query.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/mock_vws/test_query.py b/tests/mock_vws/test_query.py index bb3962a3e..fc9977639 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 @@ -65,13 +66,15 @@ STATUS:400 MESSAGE:Bad Request -
Powered by Jetty:// 12.1.6
+
Powered by Jetty:// 12.0.20
""", ) +_JETTY_VERSION_RE = re.compile(r"Powered by Jetty:// [\d.]+") + _NGINX_REQUEST_ENTITY_TOO_LARGE_ERROR = textwrap.dedent( text="""\ \r @@ -252,7 +255,9 @@ 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 + sub = _JETTY_VERSION_RE.sub + jetty = "Powered by Jetty://" + assert sub(jetty, requests_response.text) == sub(jetty, resp_text) assert_vwq_failure( response=vws_response, status_code=resp_status_code, From 7f1ca590d49c9e3820ebe73be89a98dc90513a75 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 18 Feb 2026 10:57:09 +0000 Subject: [PATCH 4/5] Use keyword argument for re.compile Co-Authored-By: Claude Haiku 4.5 --- tests/mock_vws/test_query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mock_vws/test_query.py b/tests/mock_vws/test_query.py index fc9977639..e9abb1842 100644 --- a/tests/mock_vws/test_query.py +++ b/tests/mock_vws/test_query.py @@ -73,7 +73,7 @@ """, ) -_JETTY_VERSION_RE = re.compile(r"Powered by Jetty:// [\d.]+") +_JETTY_VERSION_RE = re.compile(pattern=r"Powered by Jetty:// [\d.]+") _NGINX_REQUEST_ENTITY_TOO_LARGE_ERROR = textwrap.dedent( text="""\ From 94ff0925264964b840b90a35abfeabb3f98958c0 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 18 Feb 2026 10:58:08 +0000 Subject: [PATCH 5/5] Use keyword arguments for re Pattern sub calls Co-Authored-By: Claude Haiku 4.5 --- tests/mock_vws/test_query.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/mock_vws/test_query.py b/tests/mock_vws/test_query.py index e9abb1842..716ba627f 100644 --- a/tests/mock_vws/test_query.py +++ b/tests/mock_vws/test_query.py @@ -255,9 +255,11 @@ def test_incorrect_no_boundary( if resp_status_code != HTTPStatus.INTERNAL_SERVER_ERROR: handle_server_errors(response=vws_response) + repl = "Powered by Jetty://" sub = _JETTY_VERSION_RE.sub - jetty = "Powered by Jetty://" - assert sub(jetty, requests_response.text) == sub(jetty, resp_text) + 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,