Compare commits

..
Author SHA1 Message Date
Mohamed Boudra 0b17d391ef perf(server): use normal worker parallelism on Windows 2026-10-18 05:51:41 +02:00
2 changed files with 0 additions and 66 deletions
@@ -1,63 +0,0 @@
import { execFileSync } from "node:child_process";
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
import { createRequire } from "node:module";
import { tmpdir } from "node:os";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { expect, onTestFinished, test } from "vitest";
// Exercises npm's consumer resolution, without the repository lockfile. Requires registry access.
test.runIf(process.platform === "linux" && process.arch === "x64").each([false, true])(
"a server consumer installs the pinned local speech native runtime (upgrade: %s)",
(upgrade) => {
const directory = mkdtempSync(path.join(tmpdir(), "paseo-speech-consumer-"));
onTestFinished(() => rmSync(directory, { recursive: true, force: true }));
const serverRoot = fileURLToPath(new URL("../../../../../../", import.meta.url));
const packed = JSON.parse(
execFileSync("npm", ["pack", "--ignore-scripts", "--json", "--pack-destination", directory], {
cwd: serverRoot,
encoding: "utf8",
timeout: 60_000,
}),
) as Array<{ filename: string }>;
const consumer = path.join(directory, "consumer");
mkdirSync(consumer);
writeFileSync(path.join(consumer, "package.json"), '{"private":true}');
if (upgrade) {
execFileSync(
"npm",
[
"install",
"--ignore-scripts",
"--omit=dev",
"--no-audit",
"--no-fund",
"@getpaseo/server@0.8.0",
],
{ cwd: consumer, encoding: "utf8", timeout: 120_000 },
);
}
execFileSync(
"npm",
[
"install",
"--ignore-scripts",
"--omit=dev",
"--no-audit",
"--no-fund",
path.join(directory, packed[0].filename),
],
{ cwd: consumer, encoding: "utf8", timeout: 120_000 },
);
const serverRequire = createRequire(
path.join(consumer, "node_modules/@getpaseo/server/package.json"),
);
const wrapperPath = serverRequire.resolve("sherpa-onnx-node/package.json");
const wrapperRequire = createRequire(wrapperPath);
const wrapper = wrapperRequire(wrapperPath) as { version: string };
const native = wrapperRequire("sherpa-onnx-linux-x64/package.json") as { version: string };
expect(native.version).toBe(wrapper.version);
},
180_000,
);
-3
View File
@@ -19,9 +19,6 @@ export default defineConfig({
setupFiles: [path.resolve(__dirname, "./src/test-utils/vitest-setup.ts")],
pool: "forks",
fileParallelism: false,
// Even two concurrent Git-heavy suites can exhaust Windows test deadlines.
// Run files serially so their subprocesses do not compete across suites.
maxWorkers: process.platform === "win32" ? 1 : undefined,
exclude: ["**/node_modules/**", "**/dist/**", "**/.claude/**", "**/.dev/**"],
},
});