mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-02 19:08:33 +01:00
Address Greptile review: fix exclude path and drop dup mocks
- scripts/run-vitest-stable.mjs: use repo-root-relative paths for --exclude (vitest CWD is repoRoot, so server/-relative paths never matched and the route suites ran both in the excluded parallel phase and again serially) - workspace-runtime-routes-authz.test.ts: drop redundant vi.doMock layer that duplicated the top-level vi.mock factories for the same modules Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
c468ef39a2
commit
91ded61b3b
2 files changed
+2
-39
No files matched your search
@@ -5,7 +5,6 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
const repoRoot = process.cwd();
|
||||
const serverRoot = path.join(repoRoot, "server");
|
||||
const serverTestsDir = path.join(repoRoot, "server", "src", "__tests__");
|
||||
const nonServerProjects = [
|
||||
"@paperclipai/shared",
|
||||
@@ -64,10 +63,6 @@ function toRepoPath(file) {
|
||||
return path.relative(repoRoot, file).split(path.sep).join("/");
|
||||
}
|
||||
|
||||
function toServerPath(file) {
|
||||
return path.relative(serverRoot, file).split(path.sep).join("/");
|
||||
}
|
||||
|
||||
function isRouteOrAuthzTest(file) {
|
||||
if (routeTestPattern.test(file)) {
|
||||
return true;
|
||||
@@ -104,13 +99,10 @@ function runVitest(args, label) {
|
||||
|
||||
const routeTests = walk(serverTestsDir)
|
||||
.filter((file) => isRouteOrAuthzTest(toRepoPath(file)))
|
||||
.map((file) => ({
|
||||
repoPath: toRepoPath(file),
|
||||
serverPath: toServerPath(file),
|
||||
}))
|
||||
.map((file) => ({ repoPath: toRepoPath(file) }))
|
||||
.sort((a, b) => a.repoPath.localeCompare(b.repoPath));
|
||||
|
||||
const excludeRouteArgs = routeTests.flatMap((file) => ["--exclude", file.serverPath]);
|
||||
const excludeRouteArgs = routeTests.flatMap((file) => ["--exclude", file.repoPath]);
|
||||
for (const project of nonServerProjects) {
|
||||
runVitest(["--project", project], `non-server project ${project}`);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user