@@ -282,9 +282,39 @@ The plugin's `KubeService` provides methods to interact with Kubernetes resource
282282Loaded Kubernetes configuration from ~/.kube/config
283283` ` `
284284
285+ # # Running Tests with PostgreSQL
286+
287+ By default, `yarn test` runs database tests against SQLite only. The backend
288+ tests are written to also exercise PostgreSQL (via `TestDatabases` from
289+ ` @backstage/backend-test-utils` ), but PostgreSQL is skipped locally because the
290+ Backstage test tooling disables Docker when the `CI` environment variable is not
291+ set.
292+
293+ # ## Quick start — testcontainers (Docker/Podman)
294+
295+ Run tests against both SQLite and PostgreSQL with a single command :
296+
297+ ` ` ` sh
298+ yarn test:pg # unit tests (SQLite + PostgreSQL)
299+ yarn test:all:pg # full suite including lint, prettier, coverage
300+ ` ` `
301+
302+ These scripts set `CI=true` so that `testcontainers` automatically pulls and
303+ starts a `postgres:18` container. **Docker or Podman must be running.**
304+
305+ On Fedora/RHEL with Podman, enable the Docker-compatible socket first :
306+
307+ ` ` ` sh
308+ systemctl --user enable --now podman.socket
309+ export DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock
310+ ` ` `
311+
312+ The first run downloads the `postgres:18` image.
313+
285314# # Additional Commands
286315
287- - ` yarn test` - Run tests
316+ - ` yarn test` - Run tests (SQLite only)
317+ - ` yarn test:pg` - Run tests (SQLite + PostgreSQL via testcontainers)
288318- ` yarn lint` - Run linter
289319- ` yarn prettier:fix` - Fix code formatting
290320- ` yarn build:all` - Build all packages
0 commit comments