-
-
Notifications
You must be signed in to change notification settings - Fork 146
Expand file tree
/
Copy pathvitest.config.ts
More file actions
151 lines (145 loc) · 5.2 KB
/
Copy pathvitest.config.ts
File metadata and controls
151 lines (145 loc) · 5.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import { defineConfig } from 'vitest/config';
const integrationBoundaryCoverageExcludes = [
// External model/provider adapters and process wrappers are covered by smoke/e2e tests.
'src/adapters/agenticLoop.ts',
'src/adapters/base.ts',
'src/adapters/claude.ts',
'src/adapters/codex.ts',
'src/adapters/codexResponses.ts',
'src/adapters/envPath.ts',
'src/adapters/gpt.ts',
'src/adapters/index.ts',
'src/adapters/local.ts',
'src/adapters/openrouter.ts',
'src/adapters/processRegistry.ts',
'src/adapters/resultParsing.ts',
'src/adapters/webTools.ts',
'src/adapters/chatStream.ts',
'src/adapters/codexModels.ts',
'src/adapters/lmstudio.ts',
'src/adapters/tools.ts',
// Linux namespace/mount + Unix-socket companion boundary. Its protocol,
// parsing, path, secret-mask, Git, lifecycle, and deployment contracts remain
// unit-tested, while the effectful backend is proven by the fail-closed
// startup probe inside the production companion (including concurrent
// loopback-only netns) and a real AppArmor canary. Counting unreachable
// macOS/ordinary-CI mount and socket branches as unit coverage would reward
// mocks instead of the kernel boundary that matters.
'src/cli/sandboxExecutorCommand.ts',
'src/sandboxExecutor/bubblewrap.ts',
'src/sandboxExecutor/client.ts',
'src/sandboxExecutor/entrypoint.ts',
'src/sandboxExecutor/server.ts',
// Agent roles that shell out to providers or depend on full workflow integration.
'src/agents/auditor.ts',
'src/agents/cliStreamParser.ts',
'src/agents/documenter.ts',
'src/agents/pairMetrics.ts',
'src/agents/pairWebhook.ts',
'src/agents/reviewer.ts',
'src/agents/worker.ts',
'src/agents/agentBus.ts',
'src/agents/agentPair.ts',
'src/automation/runnerState.ts',
// OAuth, service, CLI, and external issue/graph/memory persistence boundaries.
'src/auth/oauthPkce.ts',
'src/auth/oauthStore.ts',
'src/auth/openrouterPkce.ts',
'src/auth/linearPkce.ts',
'src/auth/openBrowser.ts',
'src/automation/taskSource.ts',
'src/cli/initWizard.ts',
// Self-documented effectful boundary (own header: "this file is the effectful
// boundary" — ink render + readline + execFileSync + fs); orchestration lives
// in the already-tested reviewAudit.ts.
'src/cli/reviewMaxCommand.tsx',
'src/core/envFile.ts',
'src/core/service.ts',
'src/core/config.ts',
'src/core/eventHub.ts',
'src/issues/graphql/resolvers.ts',
'src/issues/graphql/server.ts',
'src/issues/linearBridge.ts',
'src/issues/memoryBridge.ts',
'src/issues/sqliteStore.ts',
'src/knowledge/analyzer.ts',
'src/knowledge/gitInfo.ts',
'src/knowledge/graph.ts',
'src/knowledge/graphqlExporter.ts',
'src/knowledge/index.ts',
'src/knowledge/repository.ts',
'src/knowledge/scanner.ts',
'src/knowledge/store.ts',
'src/linear/linear.ts',
'src/linear/projectUpdater.ts',
'src/locale/index.ts',
'src/locale/prompts/en.ts',
'src/locale/prompts/ko.ts',
'src/mcp/mcpClient.ts',
'src/notify/notifier.ts',
'src/memory/codex.ts',
'src/memory/compaction.ts',
'src/memory/memoryCore.ts',
'src/memory/memoryOps.ts',
'src/registry/bsDetector.ts',
'src/registry/graphql/resolvers.ts',
'src/registry/memoryBridge.ts',
'src/registry/sqliteStore.ts',
'src/support/costTracker.ts',
'src/support/gitTracker.ts',
'src/support/planner.ts',
'src/support/projectMapper.ts',
'src/support/promptHelper.ts',
'src/support/planCommand.ts',
'src/support/chatSession.ts',
'src/support/rateLimiter.ts',
'src/support/repoMetadata.ts',
'src/support/timeWindow.ts',
'src/support/web.ts',
'src/support/dev.ts',
'src/support/chatBackend.ts',
'src/support/gitStatus.ts',
'src/github/github.ts',
'src/discord/discordCore.ts',
'src/discord/discordHandlers.ts',
'src/discord/discordPair.ts',
'src/taskState/store.ts',
// Ink TUI boundaries — alt-screen entry, network SSE, and effect hooks
// (real TTY / sockets); the pure parser+reducer carry the tested logic. EPIC INT-1813.
'src/tui/index.tsx',
'src/tui/sse.ts',
'src/tui/hooks/usePipelineEvents.ts',
'src/tui/hooks/useTerminalSize.ts',
'src/tui/components/WorkingIndicator.tsx',
'src/tui/panels/ChatPanel.tsx',
'src/tui/monitorApi.ts',
'src/tui/hooks/useMonitor.ts',
'src/tui/panels/MonitorPanel.tsx',
'src/tui/panels/LogsPanel.tsx',
];
export default defineConfig({
test: {
globals: true,
environment: 'node',
setupFiles: ['./vitest.setup.ts'],
include: ['src/**/*.test.ts', 'src/**/*.test.tsx', 'tests/**/*.test.ts'],
exclude: ['node_modules', 'dist'],
testTimeout: 30000,
coverage: {
provider: 'v8',
reporter: ['text', 'lcov'],
exclude: ['node_modules', 'dist', '**/*.test.ts', '**/*.test.tsx', ...integrationBoundaryCoverageExcludes],
// Ratcheted from the aspirational (and previously unenforced — CI never
// passed --coverage, so this 100% target was dead config) 100% down to a
// real floor a few points below the measured baseline (lines 92.95% /
// statements 91.89% / functions 92.04% / branches 83.75% as of this
// ratchet). Raise these as coverage improves; never lower them.
thresholds: {
lines: 90,
statements: 90,
functions: 90,
branches: 80,
},
},
},
});