From d651659b16e8373ac75b5d4e372706714628d589 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 18 Nov 2025 11:12:01 -0800 Subject: [PATCH] Restore the scripts/test file Changes were made here to avoid running smoketests by default, but these were unneccessary and were causing a merge conflict. Smoketests are disabled by default in pyproject.toml, and the github action that runs smoke tests already enables them and runs them directly. --- .github/workflows/smoketests.yml | 1 - pyproject.toml | 3 +++ scripts/test | 25 +++++++++++++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/smoketests.yml b/.github/workflows/smoketests.yml index 0a7dc2338..6e8ed8985 100644 --- a/.github/workflows/smoketests.yml +++ b/.github/workflows/smoketests.yml @@ -44,7 +44,6 @@ jobs: echo "RUNLOOP_BASE_URL=https://api.runloop.pro" >> $GITHUB_ENV fi echo "DEBUG=false" >> $GITHUB_ENV - echo "RUN_SMOKETESTS=1" >> $GITHUB_ENV echo "PYTHONPATH=${{ github.workspace }}/src" >> $GITHUB_ENV - name: Run smoke tests (pytest via uv) diff --git a/pyproject.toml b/pyproject.toml index cce8ca58f..90e7d1044 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,9 @@ dev = [ "pytest-xdist>=3.6.1", "uuid-utils>=0.11.0" ] +pydantic-v1 = [ + "pydantic>=1.9.0, <2", +] [tool.rye.scripts] format = { chain = [ diff --git a/scripts/test b/scripts/test index a9e30906f..f87b13bef 100755 --- a/scripts/test +++ b/scripts/test @@ -54,14 +54,23 @@ fi export DEFER_PYDANTIC_BUILD=false -echo "==> Running tests" +function run_tests() { + echo "==> Running tests with Pydantic v2" + uv run --isolated --all-extras pytest "$@" -# By default, exclude smoketests unless explicitly enabled. -# This ensures PR CI doesn't run E2E smoketests unless RUN_SMOKETESTS=1. -PYTEST_ARGS=() -if [ "${RUN_SMOKETESTS}" != "1" ]; then - PYTEST_ARGS+=( -m "not smoketest" ) -fi + echo "==> Running tests with Pydantic v1" + uv run --isolated --all-extras --group=pydantic-v1 pytest "$@" +} -uv run pytest "${PYTEST_ARGS[@]}" "$@" +# If UV_PYTHON is already set in the environment, just run the command once +if [[ -n "$UV_PYTHON" ]]; then + run_tests "$@" +else + # If UV_PYTHON is not set, run the command for min and max versions + echo "==> Running tests for Python 3.9" + UV_PYTHON=3.9 run_tests "$@" + + echo "==> Running tests for Python 3.13" + UV_PYTHON=3.13 run_tests "$@" +fi