Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
27ae232
docs: add flash-based e2e test design spec
deanq Mar 13, 2026
5df47c1
docs: add flash-based e2e tests implementation plan
deanq Mar 14, 2026
f5b9b76
chore: scaffold e2e test directory and fixture project
deanq Mar 14, 2026
83cf285
feat: add QB fixture handlers for e2e tests
deanq Mar 14, 2026
ffc2556
feat: add LB fixture handler for e2e tests
deanq Mar 14, 2026
ba063bb
chore: register e2e pytest markers (qb, lb, cold_start)
deanq Mar 14, 2026
462e57e
feat: add e2e conftest with flash_server lifecycle fixture
deanq Mar 14, 2026
ce36fb9
feat: add e2e tests for sync and async QB handlers
deanq Mar 14, 2026
8cfbc08
feat: add e2e tests for stateful worker persistence
deanq Mar 14, 2026
a739e01
feat: add e2e tests for SDK Endpoint client round-trip
deanq Mar 14, 2026
e449879
feat: add e2e tests for async SDK Endpoint client
deanq Mar 14, 2026
e20d41f
feat: add e2e cold start benchmark test
deanq Mar 14, 2026
aaaedf3
feat: add e2e tests for LB remote dispatch
deanq Mar 14, 2026
ecec224
feat: replace CI-e2e.yml with flash-based QB e2e tests
deanq Mar 14, 2026
62a804a
feat: add nightly CI workflow for full e2e suite including LB
deanq Mar 14, 2026
4ad36c8
fix: correct e2e test request format, error handling, and CI config
deanq Mar 14, 2026
8b6c404
docs: update branch CLAUDE.md with implementation context
deanq Mar 14, 2026
e0647b9
refactor: address code quality review findings
deanq Mar 14, 2026
e908de1
fix(ci): install editable runpod with deps before flash
deanq Mar 14, 2026
0110fca
fix(e2e): initialize runpod.api_key from env var for SDK client tests
deanq Mar 14, 2026
9d152fe
fix(ci): exclude tests/e2e from default pytest collection
deanq Mar 14, 2026
663b55d
fix(e2e): warm up QB endpoints before running tests
deanq Mar 14, 2026
3fb35e8
fix(e2e): remove incompatible tests and reduce per-test timeout
deanq Mar 14, 2026
11c1835
fix(e2e): increase http client timeout and fix error assertion
deanq Mar 14, 2026
0e89ae9
fix(ci): update unit test matrix to Python 3.10-3.12
deanq Mar 14, 2026
fb278e0
fix(e2e): remove stateful handler tests incompatible with remote disp…
deanq Mar 14, 2026
db5d6ab
fix(tests): fix mock targets and cold start threshold in unit tests
deanq Mar 14, 2026
6b89edb
fix(ci): add pytest-rerunfailures for flaky remote dispatch timeouts
deanq Mar 14, 2026
936e133
fix(e2e): remove flaky raw httpx handler tests
deanq Mar 14, 2026
6b47858
fix(e2e): consolidate SDK tests to single handler to reduce flakiness
deanq Mar 14, 2026
b48e945
fix(e2e): remove autouse from patch_runpod_globals to prevent cold en…
deanq Mar 14, 2026
ce751fc
fix(ci): surface flash provisioning logs in e2e test output
deanq Mar 14, 2026
f2662e6
fix(e2e): surface flash server stderr to CI output
deanq Mar 14, 2026
61ff231
feat(e2e): inject PR branch runpod-python into provisioned endpoints
deanq Mar 14, 2026
cc911ec
refactor(e2e): redesign e2e tests to provision mock-worker endpoints
deanq Mar 14, 2026
a8aa2e2
fix(e2e): add structured logging to provisioner and test execution
deanq Mar 14, 2026
1cb3489
feat(e2e): add endpoint cleanup after test session
deanq Mar 14, 2026
dd74099
chore(ci): remove nightly e2e workflow
deanq Mar 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 25 additions & 78 deletions .github/workflows/CI-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,40 @@
# Performs a full test of the package within production environment.

name: CI | End-to-End Runpod Python Tests

name: CI-e2e
on:
push:
branches:
- main

branches: [main]
pull_request:
branches:
- main

branches: [main]
workflow_dispatch:

jobs:
e2e-build:
name: Build and push mock-worker Docker image
e2e:
if: github.repository == 'runpod/runpod-python'
runs-on: ubuntu-latest
outputs:
docker_tag: ${{ steps.output_docker_tag.outputs.docker_tag }}

timeout-minutes: 20
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Clone and patch mock-worker
run: |
git clone https://github.com/runpod-workers/mock-worker
GIT_SHA=${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
echo "git+https://github.com/runpod/runpod-python.git@$GIT_SHA" > mock-worker/builder/requirements.txt

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Define Docker Tag
id: docker_tag
run: |
DOCKER_TAG=${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
echo "DOCKER_TAG=$(echo $DOCKER_TAG | cut -c 1-7)" >> $GITHUB_ENV

- name: Set Docker Tag as Output
id: output_docker_tag
run: echo "docker_tag=${{ env.DOCKER_TAG }}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4

- name: Build and push Docker image
uses: docker/build-push-action@v6
- uses: astral-sh/setup-uv@v3
with:
context: ./mock-worker
file: ./mock-worker/Dockerfile
push: true
tags: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:${{ env.DOCKER_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max

test:
name: Run End-to-End Tests
runs-on: ubuntu-latest
needs: [e2e-build]
version: "latest"

steps:
- uses: actions/checkout@v4

- name: Run Tests
id: run-tests
uses: runpod/runpod-test-runner@v2.1.0
- uses: actions/setup-python@v5
with:
image-tag: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:${{ needs.e2e-build.outputs.docker_tag }}
runpod-api-key: ${{ secrets.RUNPOD_API_KEY }}
request-timeout: 1200
python-version: "3.12"

- name: Verify Tests
env:
TOTAL_TESTS: ${{ steps.run-tests.outputs.total-tests }}
SUCCESSFUL_TESTS: ${{ steps.run-tests.outputs.succeeded }}
- name: Install dependencies
run: |
uv venv
source .venv/bin/activate
uv pip install -e ".[test]" 2>/dev/null || uv pip install -e .
uv pip install runpod-flash pytest pytest-asyncio pytest-timeout pytest-rerunfailures httpx
uv pip install -e . --reinstall --no-deps
python -c "import runpod; print(f'runpod: {runpod.__version__} from {runpod.__file__}')"

- name: Run e2e tests
run: |
echo "Total tests: $TOTAL_TESTS"
echo "Successful tests: $SUCCESSFUL_TESTS"
if [ "$TOTAL_TESTS" != "$SUCCESSFUL_TESTS" ]; then
exit 1
fi
source .venv/bin/activate
pytest tests/e2e/ -v -p no:xdist --timeout=600 --reruns 1 --reruns-delay 5 --log-cli-level=INFO -o "addopts="
env:
RUNPOD_API_KEY: ${{ secrets.RUNPOD_API_KEY }}
RUNPOD_SDK_GIT_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
2 changes: 1 addition & 1 deletion .github/workflows/CI-pytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run_tests:
strategy:
matrix:
python-version: [3.8, 3.9, 3.10.15, 3.11.10]
python-version: ["3.10", "3.11", "3.12"]
runs-on: ubuntu-latest

steps:
Expand Down
54 changes: 54 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Runpod-python - build/flash-based-e2e-tests Worktree

> This worktree inherits patterns from main. See: /Users/deanquinanola/Github/python/flash-project/runpod-python/main/CLAUDE.md

## Branch Context

**Purpose:** Replace archaic e2e test infrastructure (CI-e2e.yml + mock-worker + runpod-test-runner) with flash-based e2e tests that validate real SDK behaviors through `flash run` dev server.

**Status:** Implementation complete, pending PR review

**Dependencies:** runpod-flash (PyPI)

## Architecture

- `tests/e2e/fixtures/all_in_one/` - Flash project with QB and LB handler fixtures
- `tests/e2e/conftest.py` - Session-scoped flash server lifecycle (port 8100, SIGINT cleanup)
- `tests/e2e/test_*.py` - 7 test files covering sync/async handlers, state persistence, SDK endpoint client, async SDK client, cold start, LB dispatch
- `.github/workflows/CI-e2e.yml` - PR workflow (QB + cold_start, requires RUNPOD_API_KEY)
- `.github/workflows/CI-e2e-nightly.yml` - Full suite including LB tests

## Key Discovery: QB Routes Dispatch Remotely

`@Endpoint(name=..., cpu=...)` wraps functions with `@remote`, which provisions real serverless endpoints even in `flash run` dev mode. This means ALL tests (QB and LB) require `RUNPOD_API_KEY`. There is no truly local-only execution mode through flash's QB routes.

## Running Tests

```bash
# Install dependencies
uv venv --python 3.12 && source .venv/bin/activate
uv pip install runpod-flash pytest pytest-asyncio pytest-timeout httpx
uv pip install -e . --force-reinstall --no-deps

# Run QB + cold_start tests (requires RUNPOD_API_KEY for QB, cold_start is local)
RUNPOD_API_KEY=... pytest tests/e2e/ -v -m "qb or cold_start" -p no:xdist --timeout=600 -o "addopts="

# Run all tests including LB
RUNPOD_API_KEY=... pytest tests/e2e/ -v -p no:xdist --timeout=600 -o "addopts="
```

## Request Format

Flash maps `input` dict fields to handler function kwargs. For `sync_handler(input_data: dict)`:
```json
{"input": {"input_data": {"prompt": "hello"}}}
```

## Next Steps

- [ ] Create PR against main
- [ ] Verify CI passes with RUNPOD_API_KEY secret configured

---

For shared development patterns, see main worktree CLAUDE.md.
Loading
Loading