mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-02 02:34:42 +08:00
The 4-worker cap existed only to keep deferred-promise tests inside Vitest's old 5s default when several workers pay the first dynamic import of the large store modules at once; a 10s testTimeout absorbs that without capping throughput. CI keeps 4 workers (4-vCPU runners already share CPU with vue-tsc/oxlint/oxfmt via pnpm check). Also add pnpm test:watch for incremental local runs.
27 lines
1.1 KiB
TypeScript
27 lines
1.1 KiB
TypeScript
import path from "node:path";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(import.meta.dirname, "apps/desktop/src"),
|
|
"@dbx-app/mongo-shell": path.resolve(import.meta.dirname, "packages/mongo-shell/src/index.ts"),
|
|
},
|
|
},
|
|
test: {
|
|
include: ["packages/app-tests/*.test.ts", "apps/desktop/src/**/*.spec.ts", "docs/lib/*.test.ts"],
|
|
globalSetup: "packages/test-globals.ts",
|
|
// Many specs dynamically import the large store modules (connectionStore,
|
|
// queryStore) inside test bodies; when several workers pay that first
|
|
// import at once, CPU contention can stall a worker's event loop past the
|
|
// old 5s default and flake deferred-promise tests. A 10s timeout absorbs
|
|
// that without capping throughput, so workers can scale past 4. CI keeps
|
|
// 4 workers: its 4-vCPU runners already run vue-tsc/oxlint/oxfmt
|
|
// concurrently with vitest via `pnpm check`.
|
|
testTimeout: 10_000,
|
|
maxWorkers: process.env.CI ? 4 : 8,
|
|
},
|
|
});
|