From d80151f4d10da6e44b07a3b425aa8c4b74845652 Mon Sep 17 00:00:00 2001 From: Yehonatan Zecharia Date: Mon, 8 Jun 2026 12:37:02 +0300 Subject: [PATCH 1/6] Support overriding --server_url and --simulation_secret via env vars --- integration_test_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/integration_test_utils.py b/integration_test_utils.py index 50114f1..74bcc17 100644 --- a/integration_test_utils.py +++ b/integration_test_utils.py @@ -17,6 +17,7 @@ import csv import json import logging +import os from pathlib import Path import threading import time @@ -57,10 +58,10 @@ class UnifiedUpdate(CheckoutUpdateRequest): FLAGS = flags.FLAGS try: - flags.DEFINE_string("server_url", None, "Base URL of the server") + flags.DEFINE_string("server_url", os.getenv("SERVER_URL"), "Base URL of the server") flags.DEFINE_string( "simulation_secret", - str(uuid.uuid4()), + os.getenv("SIMULATION_SECRET", str(uuid.uuid4())), "Secret for simulation endpoints", ) flags.DEFINE_integer( From f7c0001a9d6b88d91324183a306f9f81ffd2f0d6 Mon Sep 17 00:00:00 2001 From: Yehonatan Zecharia Date: Mon, 8 Jun 2026 12:37:39 +0300 Subject: [PATCH 2/6] Add a minimal conftest.py to allow executing suite via pytest --- conftest.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..cd76699 --- /dev/null +++ b/conftest.py @@ -0,0 +1,2 @@ +from integration_test_utils import FLAGS +FLAGS(["pytest"]) From b4050321d1402635c9978240e831641e245f34fe Mon Sep 17 00:00:00 2001 From: Yehonatan Zecharia Date: Mon, 8 Jun 2026 12:38:35 +0300 Subject: [PATCH 3/6] Document pytest support --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7febf64..a692099 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,9 @@ uv run ${test_file} \ --conformance_input=test_data/flower_shop/conformance_input.json \ --fixture_config=test_data/flower_shop/test_fixtures.json done + +# Or, if you prefer: +SERVER_URL=http://localhost:${MERCHANT_SERVER_PORT} SIMULATION_SECRET=${SIMULATION_SECRET} uv run pytest ``` ### Customizing Test Fixtures From a0849c7d58600c71e18cad9fccf361a2cba1b4f1 Mon Sep 17 00:00:00 2001 From: damaz91 Date: Mon, 20 Jul 2026 10:50:19 +0000 Subject: [PATCH 4/6] chore: add pytest dependency --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index a67eb04..2270208 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,7 @@ dependencies = [ "fastapi>=0.109.0", "uvicorn[standard]>=0.38.0", "ruff>=0.14.11", + "pytest>=8.0.0", ] [dependency-groups] From 33d57dcb56e1d8d7d58792d45be9c9df585d4604 Mon Sep 17 00:00:00 2001 From: damaz91 Date: Mon, 20 Jul 2026 13:45:39 +0000 Subject: [PATCH 5/6] fix: resolve pre-commit and lint issues - Add docstring to conftest.py (D100) - Format integration_test_utils.py using ruff (E501) --- conftest.py | 4 ++++ integration_test_utils.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index cd76699..3b12f0f 100644 --- a/conftest.py +++ b/conftest.py @@ -1,2 +1,6 @@ +"""Configuration file for pytest.""" + from integration_test_utils import FLAGS + + FLAGS(["pytest"]) diff --git a/integration_test_utils.py b/integration_test_utils.py index 74bcc17..0be54d4 100644 --- a/integration_test_utils.py +++ b/integration_test_utils.py @@ -58,7 +58,9 @@ class UnifiedUpdate(CheckoutUpdateRequest): FLAGS = flags.FLAGS try: - flags.DEFINE_string("server_url", os.getenv("SERVER_URL"), "Base URL of the server") + flags.DEFINE_string( + "server_url", os.getenv("SERVER_URL"), "Base URL of the server" + ) flags.DEFINE_string( "simulation_secret", os.getenv("SIMULATION_SECRET", str(uuid.uuid4())), From 7ea6e3bd39cb8798761179690db96f02859b1c87 Mon Sep 17 00:00:00 2001 From: damaz91 Date: Mon, 20 Jul 2026 13:47:25 +0000 Subject: [PATCH 6/6] chore: add copyright header to conftest.py --- conftest.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/conftest.py b/conftest.py index 3b12f0f..9ab3eca 100644 --- a/conftest.py +++ b/conftest.py @@ -1,3 +1,17 @@ +# Copyright 2026 UCP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Configuration file for pytest.""" from integration_test_utils import FLAGS