From 41acdbfd5463e54c323699e5b7aa35f09ff08ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 25 Oct 2026 02:00:57 +0100 Subject: [PATCH] test(integration): let the suite run against another Postgres major INTEGRATION_PG_IMAGE overrides the container image, so the same suite can prove a major the compose file does not ship yet. --- tests/integration/global-setup.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/integration/global-setup.ts b/tests/integration/global-setup.ts index da31f7124..ac412f296 100644 --- a/tests/integration/global-setup.ts +++ b/tests/integration/global-setup.ts @@ -44,6 +44,11 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const PROJECT_ROOT = resolve(__dirname, "..", ".."); +// The compose file ships Postgres 16; INTEGRATION_PG_IMAGE runs the same +// suite against another major (the TrueNAS app defaults to 18). +const POSTGRES_IMAGE = + process.env.INTEGRATION_PG_IMAGE?.trim() || "postgres:16-alpine"; + let started: StartedPostgreSqlContainer | null = null; declare module "vitest" { @@ -56,7 +61,7 @@ declare module "vitest" { export default async function setup( project: TestProject, ): Promise<() => Promise> { - let container = new PostgreSqlContainer("postgres:16-alpine") + let container = new PostgreSqlContainer(POSTGRES_IMAGE) .withDatabase(TEMPLATE_DATABASE) .withUsername("healthlog") .withPassword("healthlog")