Skip to content

Test: a root Vitest config with isolate: false gets no selected command #126

Closed

Description

@adityankale190895

When a Vitest config turns off test isolation, test files share state, so running only some of them is not safe. DiffCI detects this in runtimeIsolationUnsafe: any isolate property whose value is not the literal true marks the config (test-discovery.ts:463). Command synthesis then refuses with Non-isolated or ambiguous Vitest isolation requires full validation (src/planner/test-command.ts:438).

Only the workspace version of this is tested (tests/repo/workspaces.test.ts:82). The single root vitest.config.ts case has no test, so the detection or the refusal could break without CI noticing.

Add tests that build a small temporary repository (see how workspaces.test.ts writes files and calls analyzeRepository), with vitest as a dependency, a root vitest.config.ts and one *.test.ts file. Then call planSelectiveTestCommands for that test file. Cover:

  • test: { isolate: false }: no commands, refusal reason matches the message above
  • test: { poolOptions: { threads: { isolate: false } } }: same
  • test: { isolate: process.env.CI !== undefined } (not a literal): same
  • test: { isolate: true }: a command is emitted and refusalReason is undefined

Done when: these four cases are in tests/planner/test-command.test.ts (or a new file next to it) and pass with npm test. This is a test-only change. Do not change the detection itself.

Setup and conventions are in CONTRIBUTING.md: run npm test, sign off commits with git commit -s (DCO). Comment here if you want to take it, and ask anything.

Activity

  1. added
    enhancement
    good first issue
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions