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
@@ -56,37 +56,9 @@ vi.mock("../routes/workspace-runtime-service-authz.js", () => ({
|
||||
assertCanManageExecutionWorkspaceRuntimeServices: mockAssertCanManageExecutionWorkspaceRuntimeServices,
|
||||
}));
|
||||
|
||||
function registerWorkspaceRouteMocks() {
|
||||
vi.doMock("../telemetry.js", () => ({
|
||||
getTelemetryClient: mockGetTelemetryClient,
|
||||
}));
|
||||
|
||||
vi.doMock("../services/index.js", () => ({
|
||||
environmentService: () => mockEnvironmentService,
|
||||
executionWorkspaceService: () => mockExecutionWorkspaceService,
|
||||
logActivity: mockLogActivity,
|
||||
projectService: () => mockProjectService,
|
||||
secretService: () => mockSecretService,
|
||||
workspaceOperationService: () => mockWorkspaceOperationService,
|
||||
}));
|
||||
|
||||
vi.doMock("../services/workspace-runtime.js", () => ({
|
||||
cleanupExecutionWorkspaceArtifacts: vi.fn(),
|
||||
startRuntimeServicesForWorkspaceControl: vi.fn(),
|
||||
stopRuntimeServicesForExecutionWorkspace: vi.fn(),
|
||||
stopRuntimeServicesForProjectWorkspace: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.doMock("../routes/workspace-runtime-service-authz.js", () => ({
|
||||
assertCanManageProjectWorkspaceRuntimeServices: mockAssertCanManageProjectWorkspaceRuntimeServices,
|
||||
assertCanManageExecutionWorkspaceRuntimeServices: mockAssertCanManageExecutionWorkspaceRuntimeServices,
|
||||
}));
|
||||
}
|
||||
|
||||
let appImportCounter = 0;
|
||||
|
||||
async function createProjectApp(actor: Record<string, unknown>) {
|
||||
registerWorkspaceRouteMocks();
|
||||
appImportCounter += 1;
|
||||
const routeModulePath = `../routes/projects.js?workspace-runtime-routes-authz-${appImportCounter}`;
|
||||
const middlewareModulePath = `../middleware/index.js?workspace-runtime-routes-authz-${appImportCounter}`;
|
||||
@@ -106,7 +78,6 @@ async function createProjectApp(actor: Record<string, unknown>) {
|
||||
}
|
||||
|
||||
async function createExecutionWorkspaceApp(actor: Record<string, unknown>) {
|
||||
registerWorkspaceRouteMocks();
|
||||
appImportCounter += 1;
|
||||
const routeModulePath = `../routes/execution-workspaces.js?workspace-runtime-routes-authz-${appImportCounter}`;
|
||||
const middlewareModulePath = `../middleware/index.js?workspace-runtime-routes-authz-${appImportCounter}`;
|
||||
|
||||
Reference in new issue
Block a user