Skip to content

fix(test): drain HTTP fixture server pipes to fix Windows ReadTimeout #332

fix(test): drain HTTP fixture server pipes to fix Windows ReadTimeout

fix(test): drain HTTP fixture server pipes to fix Windows ReadTimeout #332

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras
- name: Run tests
run: uv run pytest
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies
run: uv sync --all-extras
- name: Check formatting
run: uv run ruff format --check .
- name: Check linting
run: uv run ruff check .
- name: Type check (mypy)
run: uv run mypy vgi/
# ty is pre-1.0 and its inference drifts release-to-release; keep it
# visible as a signal but don't gate CI on it (mypy is the blocking
# type gate).
- name: Type check (ty, non-blocking)
run: uv run ty check vgi/
continue-on-error: true
s3-offload-localstack:
name: S3 Offload Tests (LocalStack)
runs-on: ubuntu-latest
services:
localstack:
image: localstack/localstack:3.0
ports:
- 4566:4566
env:
SERVICES: s3
AWS_DEFAULT_REGION: us-east-1
steps:
- uses: actions/checkout@v4
- name: Checkout vgi-rpc
uses: actions/checkout@v4
with:
repository: Query-farm/vgi-rpc-python
path: vgi-rpc
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python 3.13
run: uv python install 3.13
- name: Install test dependencies
run: |
# Project env first (vgi + fixtures + dev tools), then overlay the
# local vgi-rpc checkout with the s3/external extras plus boto3.
# Subsequent uv run calls must pass --no-sync or uv re-syncs the
# env to the lockfile and drops the overlay.
uv sync --all-extras --python 3.13
uv pip install './vgi-rpc[http,s3,external]' boto3
- name: Create test bucket in LocalStack
env:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
run: |
uv run --no-sync python - <<'PY'
import time
import boto3
from botocore.exceptions import EndpointConnectionError
endpoint = "http://127.0.0.1:4566"
s3 = boto3.client(
"s3",
endpoint_url=endpoint,
aws_access_key_id="test",
aws_secret_access_key="test",
region_name="us-east-1",
)
for _ in range(30):
try:
s3.list_buckets()
break
except EndpointConnectionError:
time.sleep(1)
else:
raise RuntimeError("LocalStack S3 did not become ready in time")
s3.create_bucket(Bucket="rusty-vgi-test")
PY
- name: Run HTTP S3 offload tests
env:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
VGI_RUN_S3_HTTP_TESTS: "1"
VGI_HTTP_S3_BUCKET: rusty-vgi-test
VGI_HTTP_S3_ENDPOINT_URL: http://127.0.0.1:4566
PYTHONPATH: ${{ github.workspace }}
run: uv run --no-sync pytest tests/test_http_s3_offload_output.py tests/test_http_s3_offload_input.py -q