Files
matrix-docker-ansible-deploy/molecule-shared/vars.yml
T
Slavi PantaleevandClaude Opus 5 85f80a3c7e Test the Molecule scenarios against Postgres rather than sqlite
`group_vars/matrix_servers` selects postgres whenever postgres is enabled, which
is the default, so postgres is what essentially every deployment runs. The
scenarios were testing sqlite - a path almost nobody is on.

How little that path is used is not a guess: the mautrix-meta bridges could not
start at all under sqlite, and nobody reported it. Testing the engine users are
actually on is worth more than keeping coverage of the one they are not, so no
scenario is left behind on sqlite.

Four of the eight scenarios have a database and are converted; the other four
have none and are untouched.

molecule-shared/tasks/postgres.yml stands Postgres up on the scenario's network,
with the data directory on a tmpfs since it is thrown away with the container.
The image is pinned at the major the postgres role deploys to new installations
and left to Renovate: when a new major lands, the PR bumping that pin runs every
scenario against it, which is the earliest warning we get that a component does
not cope.

Each scenario gives its database and user names that differ from the role's
defaults, so the component reaching the database proves the role built its
connection string out of them. The assertions moved from "a file appeared at the
path we configured" to "these tables exist", which is strictly stronger: tables
can only appear once the component has resolved the hostname, authenticated with
the credentials the role rendered, and run its migrations to completion.

Costs about 10 seconds per affected scenario (115s to 125s locally for
mautrix-whatsapp), on jobs that run in parallel.

Gotcha worth recording: since Postgres 18 the image puts PGDATA in a versioned
subdirectory and refuses to start if it finds a mount at the old
/var/lib/postgresql/data, so the tmpfs is mounted at /var/lib/postgresql.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SEH3vxYSQ5SV4N5z61eyGT
2026-08-27 18:02:53 +03:00

23 lines
1.3 KiB
YAML

---
# Helper container images the scenarios use for probing. Here rather than inline in each
# verify.yml, so there is one pin per image instead of one per role, and so Renovate can see
# them. See the customManager in .github/renovate.json.
# Used to reach a role's container over its own container network, because the role publishes
# no host port - exactly as in a real deployment. Publishing one for the test would collide
# between scenarios running in parallel.
# renovate: datasource=docker depName=docker.io/curlimages/curl
molecule_shared_image_curl: "docker.io/curlimages/curl:8.11.1"
# Used for small stub services (a fake homeserver, and so on).
# renovate: datasource=docker depName=docker.io/library/python
molecule_shared_image_python: "docker.io/library/python:3.13-alpine"
# Postgres for scenarios whose role has a database. Pinned at the major the postgres role
# deploys to new installations, and left to Renovate from there: when a new major lands,
# the PR bumping this pin runs every scenario against it, which is the earliest warning we
# get that a component does not cope. Users who upgrade Postgres promptly are on that major
# well before the postgres role makes it the default for new installations.
# renovate: datasource=docker depName=docker.io/library/postgres
molecule_shared_image_postgres: "docker.io/library/postgres:18.6-alpine"