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
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
},
"devDependencies": {
"@cldmv/fix-headers": "^1.3.10",
"@cldmv/vitest-runner": "^1.2.0",
"@cldmv/vitest-runner": "^1.5.1",
"@eslint/css": "^2.0.0",
"@eslint/js": "^10.0.1",
"@eslint/json": "^2.0.1",
Expand Down
27 changes: 27 additions & 0 deletions tests/vitests/run-all-vitest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ const PER_FILE_HEAP_OVERRIDES = [
{ pattern: "metadata/metadata-edge-cases", heapMb: 6144 }
];

// Scratch dirs (gitignored, same pair the repo's own eslint/prettier ignores use) that test
// discovery must never enter. `tmp/` holds per-agent git worktrees (tmp/agents/*/wt) and staged
// fixtures β€” each carries its own full copy of tests/vitests/suites, which partial-path pattern
// resolution could otherwise match and run against the wrong (worktree's) tree. `trash/` is the
// same class of scratch bucket. See @cldmv/vitest-runner's `exclude` option.
const DEFAULT_EXCLUDE_PATTERNS = ["tmp/**", "trash/**"];

/**
* Print CLI help for the compatibility wrapper.
* @returns {void} Prints help text to stdout.
Expand All @@ -176,6 +183,8 @@ LEGACY FLAGS:
RUNNER FLAGS (forwarded to @cldmv/vitest-runner API):
--workers <n> Number of workers (overrides VITEST_WORKERS)
--solo-pattern <pat> Add extra solo pattern (repeatable)
--exclude <glob> Add extra discovery-exclude glob, relative to cwd (repeatable;
default: tmp/**, trash/**)
--test-list <file> JSON list of test files
--file-pattern <regex> Custom discovery regex
--log-file <path> Mirror output log path (quiet coverage mode)
Expand Down Expand Up @@ -204,6 +213,7 @@ EXAMPLES:
* testFilePattern?: RegExp,
* logFile?: string,
* earlyRunPatterns: string[],
* excludePatterns: string[],
* vitestArgs: string[],
* testPatterns: string[]
* }} Parsed argument groups.
Expand All @@ -220,6 +230,7 @@ function parseArguments(args) {
let testFilePattern;
let logFile;
const earlyRunPatterns = [...SOLO_RUN_PATTERNS];
const excludePatterns = [...DEFAULT_EXCLUDE_PATTERNS];
const vitestArgs = [];
const testPatterns = [];

Expand Down Expand Up @@ -274,6 +285,20 @@ function parseArguments(args) {
continue;
}

if (arg === "--exclude") {
const next = args[i + 1];
if (next && !next.startsWith("-")) {
excludePatterns.push(next);
i++;
}
continue;
}

if (arg.startsWith("--exclude=")) {
excludePatterns.push(arg.split("=").slice(1).join("="));
continue;
}

if (arg === "--test-list") {
const next = args[i + 1];
if (next && !next.startsWith("-")) {
Expand Down Expand Up @@ -342,6 +367,7 @@ function parseArguments(args) {
testFilePattern,
logFile,
earlyRunPatterns,
excludePatterns,
vitestArgs,
testPatterns
};
Expand Down Expand Up @@ -392,6 +418,7 @@ function buildRunOptions(parsed) {
testPatterns: normalizedPatterns,
vitestArgs: [...parsed.vitestArgs],
earlyRunPatterns: parsed.earlyRunPatterns,
exclude: parsed.excludePatterns,
perFileHeapOverrides: PER_FILE_HEAP_OVERRIDES,
conditions: ["slothlet-dev"],
nodeEnv: process.env.NODE_ENV || "development"
Expand Down
Loading