From 75b55b567f3dcab90597dbac4a229b8912eb8aa0 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 12 Nov 2026 06:27:44 +0000 Subject: [PATCH] :books: Document test database and valkey env discipline Agents must respect the PENPOT_TEST_* variables already set in the shell and not override them with values copied from CI logs (the CI endpoints only exist inside the CI docker network) unless the user asks otherwise, such as a temporary database. The shared test database may carry migrations applied by newer versions; when that blocks a test run, dropping and recreating only the database from PENPOT_TEST_DATABASE_URI is explicitly permitted. AI-assisted-by: inkling-2-small-free --- .serena/memories/backend/testing.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.serena/memories/backend/testing.md b/.serena/memories/backend/testing.md index 3cec805699..a3536c63a4 100644 --- a/.serena/memories/backend/testing.md +++ b/.serena/memories/backend/testing.md @@ -3,6 +3,8 @@ JVM `clojure.test` (kaocha runner) under `backend/test/backend_tests/`. - READ `mem:testing` FIRST — it defines the execution discipline (no piping, tee to file, preferred commands) that applies to all JVM test runs. +- Test DB/Redis come from the `PENPOT_TEST_*` env vars already set in the shell (`PENPOT_TEST_DATABASE_URI`, `PENPOT_TEST_REDIS_URI`, ...); per instance they point at `penpot_test` / `penpot_test_wsN` and valkey DB `6+N` (`mem:devenv/core`). Do not override them with values copied from CI logs or other sources unless the user asks (e.g. "use a temporary database"); the CI env (`redis://redis/1`, `postgresql://postgres/penpot_test`) only works inside the CI docker network. +- The test database may have migrations applied from newer versions (it is shared dev infra). Reinitializing it — `dropdb`/`createdb` of the `PENPOT_TEST_*` database only — is explicitly permitted when that blocks a test run; never drop the main `penpot` database or another instance's test database. - All CLI commands must be executed from the `backend/` subdirectory. - Tests are invoked directly via `clojure -M:dev:test` (kaocha) — there is no pnpm wrapper. Kaocha auto-discovers test namespaces, so no runner registration is needed. - `clojure.core/assert` is elided at compile time unless `PENPOT_FLAGS` contains `enable-backend-asserts` (`app.config` sets `*assert*` from it). `scripts/ci` and `tests-backend.yml` export the flag; a bare `clojure -M:dev:test` (or `--focus` run) without it silently skips every precondition assert.