Files
vngeoguessr/vitest.integration.config.mjs
tiennm99 4d25a82448 chore(ci): raise the test hook timeout, fail an empty backup
PGlite start-up alone takes about seven seconds on an ARM host, so the
10s beforeAll default failed whole files at random. The weekly backup
fails instead of uploading an empty export, and both workflows run with
read-only permissions; CI cancels superseded runs.
2026-09-28 15:01:41 +07:00

33 lines
1.3 KiB
JavaScript

import { defineConfig } from 'vitest/config';
// Runs the same suite as vitest.config.mjs, but against the local SRH container
// instead of the in-memory fake, so real Redis answers every command. Start the
// stack first: `npm run redis:up`.
export default defineConfig({
test: {
environment: 'node',
include: ['tests/**/*.test.js'],
globalSetup: ['tests/wait-for-srh.js'],
// Real network round-trips, and the overflow tests issue a few hundred of
// them, so the default timeout is too tight.
testTimeout: 30_000,
// Seven files start PGlite (WASM Postgres) in beforeAll. Start-up alone
// measured ~7s on an ARM host, so with workers starting several at once
// the 10s default failed whole files at random.
hookTimeout: 60_000,
// One file at a time: they all share a single Redis and each flushes the
// keyspace between tests.
fileParallelism: false,
env: {
TEST_REDIS: 'real',
UPSTASH_REDIS_REST_URL: 'http://localhost:8079',
// Matches SRH_TOKEN in docker-compose.yml.
UPSTASH_REDIS_REST_TOKEN: 'vngeoguessr-local-token',
KEY_PREFIX: 'vngeoguessr:',
// Only Redis has a real integration lane; the Neon SDK stays mocked with
// PGlite here too, so the handle guard needs a value, not a service.
DATABASE_URL: 'postgres://fake-neon.test/fake',
},
},
});