One process owns this database — the image has run a single uvicorn worker for that reason since the four-engines bug — so a file beside the flows is the honest shape for it, and it is what lets `fluksio serve` need no infrastructure at all. Live values, node execution and the work queue never came here anyway; what does is a rollup a minute at a time, a row per cascade and the run history, and WAL keeps the readers going while that one writer works. DATA_DIR is now the one setting that moves everything an installation keeps; the rest derive from it and the images still spell theirs out. The schema is prepared in-process at startup, so the prestart service is gone, and the ten Postgres-only revisions collapse into one portable baseline. Three things only worked because psycopg was casting for us: a token's subject arriving as a string where the column is a UUID, `greatest`, and `date_bin`. The timestamps needed a column type of their own — SQLite stores no offset, and a naive datetime read back either raises against an aware `now` or serialises as local time. Postgres stays in the stack only for Umami, behind the analytics profile. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
55 lines
2.0 KiB
YAML
55 lines
2.0 KiB
YAML
name: Test Backend
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
|
|
env:
|
|
# The compose files live in docker/, so a bare `docker compose` from the repo
|
|
# root finds nothing. With COMPOSE_FILE set, compose reads .env from the
|
|
# working directory — the same file the backend settings load as ../.env.
|
|
# compose.ci.yml drops the fixed container_names and the fixed 5432 — both
|
|
# daemon-global, so without it a second run on the same host cannot start.
|
|
COMPOSE_FILE: docker/compose.yml:docker/compose.dev.yml:docker/compose.ci.yml
|
|
|
|
jobs:
|
|
test-backend:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
# Per run, so the `down -v` steps reach neither a dev stack nor a run
|
|
# still going. Unique names cannot be recycled, hence the always-on
|
|
# teardown below.
|
|
COMPOSE_PROJECT_NAME: fluksio-app-ci-backend-${{ github.run_id }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.10"
|
|
- name: Set up uv
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
cache-dependency-glob: |
|
|
pyproject.toml
|
|
backend/pyproject.toml
|
|
uv.lock
|
|
- run: uv sync
|
|
# Nothing to start: the suite names its own SQLite file in a temp
|
|
# directory (backend/tests/__init__.py), the mail paths are patched, and
|
|
# the flow engine falls back to in-memory state without a Redis host.
|
|
- name: Run tests with coverage
|
|
run: uv run bash scripts/test.sh "Coverage for ${{ github.sha }}"
|
|
working-directory: backend
|
|
- name: Check the wheels build
|
|
# Cheap, and it catches a data file that stopped being packaged —
|
|
# alembic's revisions and the email templates ride along by directory.
|
|
run: |
|
|
uv build --all-packages --out-dir dist
|
|
uv run --no-project --with dist/fluksio_worker-*.whl fluksio-worker --help
|