diff --git a/packages/cookies/vitest.config.ts b/packages/cookies/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/packages/cookies/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/packages/core/vitest.config.ts b/packages/core/vitest.config.ts index 91229c2b99..aaeac0c4f6 100644 --- a/packages/core/vitest.config.ts +++ b/packages/core/vitest.config.ts @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config'; export default defineProject({ test: { + pool: 'threads', + isolate: false, testTimeout: 10000, hookTimeout: 20000, exclude: ['test/fixtures/**', 'test/benchmark/**', '**/node_modules/**', '**/dist/**'], diff --git a/packages/errors/vitest.config.ts b/packages/errors/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/packages/errors/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/packages/extend2/vitest.config.ts b/packages/extend2/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/packages/extend2/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/packages/koa-static-cache/vitest.config.ts b/packages/koa-static-cache/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/packages/koa-static-cache/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/packages/koa/vitest.config.ts b/packages/koa/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/packages/koa/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/packages/loader-fs/vitest.config.ts b/packages/loader-fs/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/packages/loader-fs/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/packages/path-matching/vitest.config.ts b/packages/path-matching/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/packages/path-matching/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/packages/router/vitest.config.ts b/packages/router/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/packages/router/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/packages/supertest/vitest.config.ts b/packages/supertest/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/packages/supertest/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/packages/tsconfig/vitest.config.ts b/packages/tsconfig/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/packages/tsconfig/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/packages/utils/vitest.config.ts b/packages/utils/vitest.config.ts index 2b417434e4..f6c1ac8e86 100644 --- a/packages/utils/vitest.config.ts +++ b/packages/utils/vitest.config.ts @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config'; export default defineProject({ test: { + pool: 'threads', + isolate: false, testTimeout: 15000, include: ['test/**/*.test.ts'], exclude: ['**/test/fixtures/**', '**/node_modules/**', '**/dist/**'], diff --git a/plugins/i18n/vitest.config.ts b/plugins/i18n/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/plugins/i18n/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/plugins/jsonp/vitest.config.ts b/plugins/jsonp/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/plugins/jsonp/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/plugins/logrotator/vitest.config.ts b/plugins/logrotator/vitest.config.ts index d34001c8b2..7b4c9b7fc9 100644 --- a/plugins/logrotator/vitest.config.ts +++ b/plugins/logrotator/vitest.config.ts @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config'; export default defineProject({ test: { + pool: 'threads', + isolate: false, testTimeout: 20000, hookTimeout: 20000, }, diff --git a/plugins/onerror/vitest.config.ts b/plugins/onerror/vitest.config.ts index d34001c8b2..7b4c9b7fc9 100644 --- a/plugins/onerror/vitest.config.ts +++ b/plugins/onerror/vitest.config.ts @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config'; export default defineProject({ test: { + pool: 'threads', + isolate: false, testTimeout: 20000, hookTimeout: 20000, }, diff --git a/plugins/redis/vitest.config.ts b/plugins/redis/vitest.config.ts index fc3e04eaf6..ee4b70c887 100644 --- a/plugins/redis/vitest.config.ts +++ b/plugins/redis/vitest.config.ts @@ -2,6 +2,8 @@ import { defineConfig, type UserWorkspaceConfig } from 'vitest/config'; const config: UserWorkspaceConfig = defineConfig({ test: { + pool: 'threads', + isolate: false, testTimeout: 30000, hookTimeout: 30000, globals: true, diff --git a/plugins/session/vitest.config.ts b/plugins/session/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/plugins/session/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/plugins/static/vitest.config.ts b/plugins/static/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/plugins/static/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/plugins/tracer/vitest.config.ts b/plugins/tracer/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/plugins/tracer/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/plugins/typebox-validate/vitest.config.ts b/plugins/typebox-validate/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/plugins/typebox-validate/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/plugins/view/vitest.config.ts b/plugins/view/vitest.config.ts index d34001c8b2..7b4c9b7fc9 100644 --- a/plugins/view/vitest.config.ts +++ b/plugins/view/vitest.config.ts @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config'; export default defineProject({ test: { + pool: 'threads', + isolate: false, testTimeout: 20000, hookTimeout: 20000, }, diff --git a/plugins/watcher/vitest.config.ts b/plugins/watcher/vitest.config.ts index d34001c8b2..7b4c9b7fc9 100644 --- a/plugins/watcher/vitest.config.ts +++ b/plugins/watcher/vitest.config.ts @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config'; export default defineProject({ test: { + pool: 'threads', + isolate: false, testTimeout: 20000, hookTimeout: 20000, }, diff --git a/tegg/core/agent-runtime/vitest.config.ts b/tegg/core/agent-runtime/vitest.config.ts index 939504e375..cd17062456 100644 --- a/tegg/core/agent-runtime/vitest.config.ts +++ b/tegg/core/agent-runtime/vitest.config.ts @@ -1,5 +1,10 @@ import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; -const config: UserWorkspaceConfig = defineProject({}); +const config: UserWorkspaceConfig = defineProject({ + test: { + pool: 'threads', + isolate: false, + }, +}); export default config; diff --git a/tegg/core/ajv-decorator/vitest.config.ts b/tegg/core/ajv-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/ajv-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/aop-decorator/vitest.config.ts b/tegg/core/aop-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/aop-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/aop-runtime/vitest.config.ts b/tegg/core/aop-runtime/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/aop-runtime/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/background-task/vitest.config.ts b/tegg/core/background-task/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/background-task/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/common-util/vitest.config.ts b/tegg/core/common-util/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/common-util/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/controller-decorator/vitest.config.ts b/tegg/core/controller-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/controller-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/core-decorator/vitest.config.ts b/tegg/core/core-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/core-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/dal-decorator/vitest.config.ts b/tegg/core/dal-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/dal-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/dal-runtime/vitest.config.ts b/tegg/core/dal-runtime/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/dal-runtime/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/dynamic-inject-runtime/vitest.config.ts b/tegg/core/dynamic-inject-runtime/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/dynamic-inject-runtime/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/dynamic-inject/vitest.config.ts b/tegg/core/dynamic-inject/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/dynamic-inject/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/eventbus-decorator/vitest.config.ts b/tegg/core/eventbus-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/eventbus-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/eventbus-runtime/vitest.config.ts b/tegg/core/eventbus-runtime/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/eventbus-runtime/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/langchain-decorator/vitest.config.ts b/tegg/core/langchain-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/langchain-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/lifecycle/vitest.config.ts b/tegg/core/lifecycle/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/lifecycle/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/loader/vitest.config.ts b/tegg/core/loader/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/loader/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/mcp-client/vitest.config.ts b/tegg/core/mcp-client/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/mcp-client/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/metadata/vitest.config.ts b/tegg/core/metadata/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/metadata/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/orm-decorator/vitest.config.ts b/tegg/core/orm-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/orm-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/runtime/vitest.config.ts b/tegg/core/runtime/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/runtime/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/schedule-decorator/vitest.config.ts b/tegg/core/schedule-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/schedule-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/standalone-decorator/vitest.config.ts b/tegg/core/standalone-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/standalone-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/tegg/vitest.config.ts b/tegg/core/tegg/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/tegg/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/test-util/vitest.config.ts b/tegg/core/test-util/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/test-util/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/transaction-decorator/vitest.config.ts b/tegg/core/transaction-decorator/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/transaction-decorator/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/types/vitest.config.ts b/tegg/core/types/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/core/types/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/core/vitest/vitest.config.ts b/tegg/core/vitest/vitest.config.ts index d08addc178..f37ad2ae76 100644 --- a/tegg/core/vitest/vitest.config.ts +++ b/tegg/core/vitest/vitest.config.ts @@ -20,6 +20,8 @@ export default defineConfig({ ], }, test: { + pool: 'threads', + isolate: false, environment: 'node', include: ['test/**/*.test.ts'], // Register TS loader (ts-node) before tests so Egg can load .ts via Module._extensions. diff --git a/tegg/plugin/ajv/vitest.config.ts b/tegg/plugin/ajv/vitest.config.ts index b286db8490..814f90143e 100644 --- a/tegg/plugin/ajv/vitest.config.ts +++ b/tegg/plugin/ajv/vitest.config.ts @@ -2,6 +2,8 @@ import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; const config: UserWorkspaceConfig = defineProject({ test: { + pool: 'threads', + isolate: false, // app.ready() loads 5 plugins and can take >10s under heavy parallel load hookTimeout: 30000, }, diff --git a/tegg/plugin/aop/vitest.config.ts b/tegg/plugin/aop/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/aop/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/common/vitest.config.ts b/tegg/plugin/common/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/common/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/config/vitest.config.ts b/tegg/plugin/config/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/config/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/controller/vitest.config.ts b/tegg/plugin/controller/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/controller/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/dal/vitest.config.ts b/tegg/plugin/dal/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/dal/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/eventbus/vitest.config.ts b/tegg/plugin/eventbus/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/eventbus/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/langchain/vitest.config.ts b/tegg/plugin/langchain/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/langchain/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/mcp-client/vitest.config.ts b/tegg/plugin/mcp-client/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/mcp-client/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/mcp-proxy/vitest.config.ts b/tegg/plugin/mcp-proxy/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/mcp-proxy/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/orm/vitest.config.ts b/tegg/plugin/orm/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/orm/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/schedule/vitest.config.ts b/tegg/plugin/schedule/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/schedule/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/plugin/tegg/vitest.config.ts b/tegg/plugin/tegg/vitest.config.ts new file mode 100644 index 0000000000..3b019edecb --- /dev/null +++ b/tegg/plugin/tegg/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across test files in this project (no + // per-file isolation) to speed up the suite. Pairs with pool: 'threads'; + // the root vitest.config.ts cannot set these for glob-matched projects. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tegg/standalone/standalone/vitest.config.ts b/tegg/standalone/standalone/vitest.config.ts new file mode 100644 index 0000000000..868bcaa2f7 --- /dev/null +++ b/tegg/standalone/standalone/vitest.config.ts @@ -0,0 +1,13 @@ +import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; + +const config: UserWorkspaceConfig = defineProject({ + test: { + // Reuse a single worker thread across this project's test files instead of + // spawning a fresh worker per file. The root vitest.config.ts cannot set + // these for glob-matched projects, so each project opts in explicitly. + pool: 'threads', + isolate: false, + }, +}); + +export default config; diff --git a/tools/create-egg/vitest.config.ts b/tools/create-egg/vitest.config.ts index 88fa3e5d46..8e53248f98 100644 --- a/tools/create-egg/vitest.config.ts +++ b/tools/create-egg/vitest.config.ts @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config'; export default defineProject({ test: { + pool: 'threads', + isolate: false, testTimeout: 20000, exclude: ['**/node_modules/**', '**/dist/**', '**/templates/**/test/**'], },