Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/local-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ not build the Workbench e2e example payload):
- `npm-cli-resolution.test.ts` (Windows official + Unix/nvm + PATH + split-prefix/pnpm `npm_execpath`)
- `packed-install-bin.test.ts` (packaged installer bin from a consumer cwd)
- `rstest-worker-isolation.test.ts` (canonical TMPDIR; macOS `/tmp` → `/private/tmp`)
- `rstest-generated-module-win32-rename.test.ts` (transient Windows rename retry;
mocks `node:fs/promises`, so it needs this pool's per-file module isolation)

That is the slice that can actually diverge by OS. macOS matters because
Claude, Codex, and Cursor authors commonly develop there; Windows is in the
Expand Down
3 changes: 2 additions & 1 deletion rstest.host-filesystem.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from '@rstest/core';

import { moduleMockTestFiles } from './rstest.integration-tests.ts';
import {
poolTimeouts,
processPoolMaxWorkers,
Expand Down Expand Up @@ -33,7 +34,7 @@ export const hostFilesystemTestFiles = [

export default defineConfig({
extends: withAgentBundleRslibConfig(),
include: [...hostFilesystemTestFiles],
include: [...hostFilesystemTestFiles, ...moduleMockTestFiles],
globalSetup: [...workspaceGlobalSetup],
pool: { maxWorkers },
setupFiles: [...workspaceSetupFiles],
Expand Down
10 changes: 10 additions & 0 deletions rstest.integration-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,13 @@ export const templateTestFiles: readonly string[] = [
export const fixtureProjectTestFiles: readonly string[] = [
'packages/agent-bundle/fixtures/**/tests/**',
];

/**
* Files that mock a module with `rs.mock`. The unit pool shares one module
* cache per worker (`isolate: false`), so the mock never reaches a module
* another file in that worker loaded first. They run in the per-file isolated
* `test:host-filesystem` pool instead.
*/
export const moduleMockTestFiles: readonly string[] = [
'packages/agent-bundle/tests/rstest-generated-module-win32-rename.test.ts',
];
2 changes: 2 additions & 0 deletions rstest.unit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
fixtureProjectTestFiles,
integrationTestFiles,
mcpConformanceTestFiles,
moduleMockTestFiles,
nativeHostTestFiles,
packedReleaseOnlyTestFiles,
packedTestFiles,
Expand All @@ -30,6 +31,7 @@ export default defineConfig({
...fixtureProjectTestFiles,
...integrationTestFiles,
...mcpConformanceTestFiles,
...moduleMockTestFiles,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep the rename test in the local merge gate

Excluding this file from the unit pool moves it exclusively to test:host-filesystem, but neither the standard check script (package.json:26) nor the local-CI legs (scripts/local-ci.mjs:373-376) invoke that pool. Consequently, the documented local merge gate can pass without exercising this regression at all; retain it in an isolated pool that the local gate runs, while optionally also including it in the cross-OS filesystem job.

AGENTS.md reference: AGENTS.md:L147-L154

Useful? React with 👍 / 👎.

...nativeHostTestFiles,
// Packs and installs like packedTestFiles, and is release-boundary-only:
// `test:packed:release` owns it, not the build-free per-PR pool.
Expand Down
Loading