test: restore thread-first vitest defaults

This commit is contained in:
Peter Steinberger
2026-04-05 11:29:01 +01:00
parent dbac5fa258
commit 41d08a6feb
12 changed files with 57 additions and 45 deletions

View File

@@ -12,7 +12,7 @@ describe("loadBoundaryIncludePatternsFromEnv", () => {
});
describe("boundary vitest config", () => {
it("keeps boundary suites on the shared runner with shared test bootstrap", () => {
it("keeps boundary suites on the non-isolated runner with shared test bootstrap", () => {
const config = createBoundaryVitestConfig({});
expect(config.test?.isolate).toBe(false);

View File

@@ -13,14 +13,14 @@ describe("projects vitest config", () => {
expect(baseConfig.test?.projects).toEqual([...rootVitestProjects]);
});
it("keeps the heavy root projects on fork workers only where explicitly required", () => {
expect(createGatewayVitestConfig().test.pool).toBe("forks");
expect(createAgentsVitestConfig().test.pool).toBe("forks");
expect(createCommandsVitestConfig().test.pool).toBe("forks");
it("keeps root projects on the shared thread-first pool by default", () => {
expect(createGatewayVitestConfig().test.pool).toBe("threads");
expect(createAgentsVitestConfig().test.pool).toBe("threads");
expect(createCommandsVitestConfig().test.pool).toBe("threads");
expect(createContractsVitestConfig().test.pool).toBe("threads");
});
it("keeps the contracts lane on the shared non-isolated runner", () => {
it("keeps the contracts lane on the non-isolated runner by default", () => {
const config = createContractsVitestConfig();
expect(config.test.isolate).toBe(false);
expect(config.test.runner).toBe("./test/non-isolated-runner.ts");
@@ -36,13 +36,13 @@ describe("projects vitest config", () => {
expect(config.test.deps?.optimizer?.web?.enabled).toBe(true);
});
it("keeps the unit lane on the shared non-isolated runner", () => {
it("keeps the unit lane on the non-isolated runner by default", () => {
const config = createUnitVitestConfig();
expect(config.test.isolate).toBe(false);
expect(config.test.runner).toBe("./test/non-isolated-runner.ts");
});
it("keeps the bundled lane on the shared non-isolated runner", () => {
it("keeps the bundled lane on thread workers with the non-isolated runner", () => {
expect(bundledConfig.test?.pool).toBe("threads");
expect(bundledConfig.test?.isolate).toBe(false);
expect(bundledConfig.test?.runner).toBe("./test/non-isolated-runner.ts");

View File

@@ -51,7 +51,7 @@ import { BUNDLED_PLUGIN_TEST_GLOB, bundledPluginFile } from "./helpers/bundled-p
const EXTENSIONS_CHANNEL_GLOB = ["extensions", "channel", "**"].join("/");
describe("resolveVitestIsolation", () => {
it("defaults shared scoped configs to non-isolated workers", () => {
it("defaults shared scoped configs to the non-isolated runner", () => {
expect(resolveVitestIsolation({})).toBe(false);
});
@@ -63,7 +63,7 @@ describe("resolveVitestIsolation", () => {
});
describe("createScopedVitestConfig", () => {
it("applies non-isolated mode by default", () => {
it("applies the non-isolated runner by default", () => {
const config = createScopedVitestConfig(["src/example.test.ts"], { env: {} });
expect(config.test?.isolate).toBe(false);
expect(config.test?.runner).toBe("./test/non-isolated-runner.ts");
@@ -160,7 +160,7 @@ describe("scoped vitest configs", () => {
const defaultUtilsConfig = createUtilsVitestConfig({});
const defaultWizardConfig = createWizardVitestConfig({});
it("keeps most scoped lanes on thread workers with the non-isolated runner", () => {
it("keeps scoped lanes on threads with the shared non-isolated runner", () => {
for (const config of [
defaultChannelsConfig,
defaultAcpConfig,
@@ -176,19 +176,18 @@ describe("scoped vitest configs", () => {
expect(config.test?.isolate).toBe(false);
expect(config.test?.runner).toBe("./test/non-isolated-runner.ts");
}
});
it("keeps gateway, commands, and agents on fork workers", () => {
for (const config of [defaultGatewayConfig, defaultCommandsConfig, defaultAgentsConfig]) {
expect(config.test?.pool).toBe("forks");
expect(config.test?.pool).toBe("threads");
expect(config.test?.isolate).toBe(false);
expect(config.test?.runner).toBe("./test/non-isolated-runner.ts");
}
});
it("defaults channel tests to non-isolated thread mode", () => {
it("defaults channel tests to threads with the non-isolated runner", () => {
expect(defaultChannelsConfig.test?.isolate).toBe(false);
expect(defaultChannelsConfig.test?.pool).toBe("threads");
expect(defaultChannelsConfig.test?.runner).toBe("./test/non-isolated-runner.ts");
});
it("keeps the core channel lane limited to non-extension roots", () => {
@@ -222,9 +221,10 @@ describe("scoped vitest configs", () => {
}
});
it("defaults extension tests to non-isolated thread mode", () => {
it("defaults extension tests to threads with the non-isolated runner", () => {
expect(defaultExtensionsConfig.test?.isolate).toBe(false);
expect(defaultExtensionsConfig.test?.pool).toBe("threads");
expect(defaultExtensionsConfig.test?.runner).toBe("./test/non-isolated-runner.ts");
});
it("normalizes extension channel include patterns relative to the scoped dir", () => {

View File

@@ -3,20 +3,20 @@ import uiConfig from "../ui/vitest.config.ts";
import uiNodeConfig from "../ui/vitest.node.config.ts";
describe("ui package vitest config", () => {
it("keeps the standalone ui package on forks with isolation enabled", () => {
expect(uiConfig.test?.pool).toBe("forks");
it("keeps the standalone ui package on thread workers with isolation enabled", () => {
expect(uiConfig.test?.pool).toBe("threads");
expect(uiConfig.test?.isolate).toBe(true);
expect(uiConfig.test?.projects).toHaveLength(3);
for (const project of uiConfig.test?.projects ?? []) {
expect(project.test?.pool).toBe("forks");
expect(project.test?.pool).toBe("threads");
expect(project.test?.isolate).toBe(true);
expect(project.test?.runner).toBeUndefined();
}
});
it("keeps the standalone ui node config on forks with isolation enabled", () => {
expect(uiNodeConfig.test?.pool).toBe("forks");
it("keeps the standalone ui node config on thread workers with isolation enabled", () => {
expect(uiNodeConfig.test?.pool).toBe("threads");
expect(uiNodeConfig.test?.isolate).toBe(true);
expect(uiNodeConfig.test?.runner).toBeUndefined();
});

View File

@@ -68,7 +68,7 @@ describe("loadExtraExcludePatternsFromEnv", () => {
});
describe("unit vitest config", () => {
it("defaults unit tests to non-isolated mode", () => {
it("defaults unit tests to the non-isolated runner", () => {
const unitConfig = createUnitVitestConfig({});
expect(unitConfig.test?.isolate).toBe(false);
expect(unitConfig.test?.runner).toBe("./test/non-isolated-runner.ts");