Exclude integration tests from default pnpm test; opt-in via test:integration

The Redis-publisher integration test uses testcontainers to spin up a real
Redis. On the Gitea CI runner, `container.start()` hangs (likely image-pull
delay or restricted Docker access), and the 60s beforeAll timeout fails the
suite even though both tests ultimately would skip. The skip-on-error path
only fires when start() throws, not when it times out.

Fix: separate unit tests (default) from integration tests (opt-in). The
default `pnpm test` now runs only `test/**/*.test.ts` excluding
`*.integration.test.ts`. A new `pnpm test:integration` script runs them
via `vitest.integration.config.ts` with generous hook/test timeouts for
container startup.

CI runs `pnpm test` and is unaffected by Docker availability. Integration
tests can be run locally or in a future CI job that explicitly provisions
Docker.
This commit is contained in:
2026-04-30 17:38:34 +02:00
parent 33c3fa0c8e
commit 155f034f61
4 changed files with 41 additions and 1 deletions
+1
View File
@@ -12,6 +12,7 @@
"start": "node dist/main.js",
"test": "vitest run",
"test:watch": "vitest",
"test:integration": "vitest run --config vitest.integration.config.ts",
"lint": "eslint .",
"format": "prettier --write .",
"typecheck": "tsc --noEmit"