155f034f61
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.
25 lines
803 B
TypeScript
25 lines
803 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
|
|
/**
|
|
* Vitest config for integration tests that depend on external services
|
|
* (Docker, real Redis, etc.). Run via `pnpm test:integration`. Requires
|
|
* a working Docker daemon — `testcontainers` will spin up the services
|
|
* it needs, then tear them down.
|
|
*
|
|
* NOT run in default CI. Run locally before changes that touch the
|
|
* Redis publisher, or run in a separate CI job that has Docker access.
|
|
*/
|
|
export default defineConfig({
|
|
test: {
|
|
include: ['test/**/*.integration.test.ts'],
|
|
environment: 'node',
|
|
// Container startup can be slow on first run (image pull, ryuk
|
|
// container, etc). Allow generous hook + test timeouts.
|
|
hookTimeout: 120_000,
|
|
testTimeout: 60_000,
|
|
},
|
|
resolve: {
|
|
extensions: ['.ts', '.js'],
|
|
},
|
|
});
|