mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 01:31:08 +00:00
Tests: pin full shard worker budget
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
import { createScopedVitestConfig } from "./vitest.scoped-config.ts";
|
||||
|
||||
export function createCronVitestConfig(env?: Record<string, string | undefined>) {
|
||||
return createScopedVitestConfig(["src/cron/**/*.test.ts"], {
|
||||
const config = createScopedVitestConfig(["src/cron/**/*.test.ts"], {
|
||||
dir: "src",
|
||||
env,
|
||||
name: "cron",
|
||||
passWithNoTests: true,
|
||||
});
|
||||
config.test = {
|
||||
...config.test,
|
||||
maxWorkers: 1,
|
||||
fileParallelism: false,
|
||||
sequence: {
|
||||
...config.test?.sequence,
|
||||
groupOrder: 1,
|
||||
},
|
||||
};
|
||||
return config;
|
||||
}
|
||||
|
||||
export default createCronVitestConfig();
|
||||
|
||||
@@ -2,6 +2,10 @@ import { defineConfig } from "vitest/config";
|
||||
import { sharedVitestConfig } from "./vitest.shared.config.ts";
|
||||
|
||||
export function createProjectShardVitestConfig(projects: readonly string[]) {
|
||||
const maxWorkers = sharedVitestConfig.test.maxWorkers;
|
||||
if (!process.env.OPENCLAW_VITEST_MAX_WORKERS && typeof maxWorkers === "number") {
|
||||
process.env.OPENCLAW_VITEST_MAX_WORKERS = String(maxWorkers);
|
||||
}
|
||||
return defineConfig({
|
||||
...sharedVitestConfig,
|
||||
test: {
|
||||
|
||||
Reference in New Issue
Block a user