Skip to content

fix(users): directory role exclusions, session ctx refresh, full_name validation, profile headings, and inline 422 errors #343

fix(users): directory role exclusions, session ctx refresh, full_name validation, profile headings, and inline 422 errors

fix(users): directory role exclusions, session ctx refresh, full_name validation, profile headings, and inline 422 errors #343

Workflow file for this run

name: Postgres tests
# The Python suite on Postgres (including `@pytest.mark.postgres` tests that
# SQLite cannot run), sharded across 4 runners via `scripts/pytest_shard.py`
# and parallel under xdist within each runner (one isolated database per worker
# with per-test table cleanup). Runs nightly and on workflow_dispatch (full suite
# minus the CSS build test covered by `js-build`), and on PRs touching
# database/tenancy/concurrency-sensitive modules or the sharder/workflow
# (#508, #599), excluding backend-independent CLI scaffold/tooling, remote CLI,
# inertia, and script suites on PRs.
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
pull_request:
branches: [main]
paths:
- "framework/db/**"
- "framework/testing/**"
- "modules/tenants/**"
- "modules/users/**"
- "modules/background_tasks/**"
- "modules/file_storage/**"
- "host/migrations/**"
- "scripts/pytest_shard.py"
- ".github/workflows/postgres-tests.yml"
concurrency:
group: pg-tests-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
NODE_VERSION: "24"
UV_SYNC_FLAGS: --locked
UV_CACHE_GLOB: |
uv.lock
pyproject.toml
framework/*/pyproject.toml
modules/*/pyproject.toml
host/pyproject.toml
jobs:
python-tests-pg:
name: Python tests (Postgres ${{ matrix.shard }}/4)
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: sm_test
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 3s
--health-retries 10
# Same broker the python-tests job uses for the invalidation suite.
redis:
image: redis:7-alpine
ports: ["6379:6379"]
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 10
env:
SM_TEST_DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/sm_test
SM_TEST_REDIS_URL: redis://127.0.0.1:6379/0
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.4.0
with:
enable-cache: true
cache-dependency-glob: ${{ env.UV_CACHE_GLOB }}
- run: make install-py
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- run: npm ci
- name: Run Postgres test shard ${{ matrix.shard }}/4
shell: bash
run: |
set -o pipefail
extra_excludes=()
# On PRs, skip backend-independent suites that already run in `pr.yml`
# (keep framework/cli/tests/migrations/ which has @pytest.mark.postgres
# tests); nightly schedule and manual dispatch run all.
if [ "${{ github.event_name }}" = "pull_request" ]; then
extra_excludes+=(
--exclude framework/cli/tests/scaffold
--exclude framework/cli/tests/tooling
--exclude framework/remote/tests
--exclude framework/inertia/tests
--exclude scripts/tests
)
fi
uv run python scripts/pytest_shard.py \
--shard "${{ matrix.shard }}" \
--total 4 \
--exclude tests/e2e \
--exclude tests/perf \
--exclude tests/benchmarks \
--exclude framework/cli/tests/tooling/test_module_css_build.py \
"${extra_excludes[@]}" \
-- -n 4 --dist loadgroup 2>&1 | tee pytest.log
- name: Record suite time
if: always()
shell: bash
run: |
echo "### Python tests (Postgres shard ${{ matrix.shard }}/4)" >> "$GITHUB_STEP_SUMMARY"
grep -E '^=+ .*(passed|failed|error).* in [0-9.]+s' pytest.log | tail -n 1 >> "$GITHUB_STEP_SUMMARY" || true