@frontmcp/testing 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/index.d.ts +2 -0
- package/auth/index.d.ts.map +1 -1
- package/auth/mock-cimd-server.d.ts +174 -0
- package/auth/mock-cimd-server.d.ts.map +1 -0
- package/auth/mock-oauth-server.d.ts +136 -6
- package/auth/mock-oauth-server.d.ts.map +1 -1
- package/auth/token-factory.d.ts.map +1 -1
- package/client/index.d.ts +1 -1
- package/client/index.d.ts.map +1 -1
- package/client/mcp-test-client.builder.d.ts +12 -0
- package/client/mcp-test-client.builder.d.ts.map +1 -1
- package/client/mcp-test-client.d.ts +48 -2
- package/client/mcp-test-client.d.ts.map +1 -1
- package/client/mcp-test-client.types.d.ts +60 -0
- package/client/mcp-test-client.types.d.ts.map +1 -1
- package/esm/fixtures/index.mjs +661 -83
- package/esm/index.mjs +3245 -219
- package/esm/package.json +5 -4
- package/esm/perf/index.mjs +4334 -0
- package/esm/perf/perf-setup.mjs +31 -0
- package/fixtures/fixture-types.d.ts +10 -1
- package/fixtures/fixture-types.d.ts.map +1 -1
- package/fixtures/index.js +661 -93
- package/fixtures/test-fixture.d.ts +1 -1
- package/fixtures/test-fixture.d.ts.map +1 -1
- package/index.d.ts +5 -1
- package/index.d.ts.map +1 -1
- package/index.js +3271 -219
- package/interceptor/interceptor-chain.d.ts +1 -0
- package/interceptor/interceptor-chain.d.ts.map +1 -1
- package/package.json +5 -4
- package/perf/baseline-store.d.ts +67 -0
- package/perf/baseline-store.d.ts.map +1 -0
- package/perf/index.d.ts +44 -0
- package/perf/index.d.ts.map +1 -0
- package/perf/index.js +4404 -0
- package/perf/jest-perf-reporter.d.ts +6 -0
- package/perf/jest-perf-reporter.d.ts.map +1 -0
- package/perf/leak-detector.d.ts +81 -0
- package/perf/leak-detector.d.ts.map +1 -0
- package/perf/metrics-collector.d.ts +83 -0
- package/perf/metrics-collector.d.ts.map +1 -0
- package/perf/perf-fixtures.d.ts +107 -0
- package/perf/perf-fixtures.d.ts.map +1 -0
- package/perf/perf-setup.d.ts +9 -0
- package/perf/perf-setup.d.ts.map +1 -0
- package/perf/perf-setup.js +50 -0
- package/perf/perf-test.d.ts +69 -0
- package/perf/perf-test.d.ts.map +1 -0
- package/perf/regression-detector.d.ts +55 -0
- package/perf/regression-detector.d.ts.map +1 -0
- package/perf/report-generator.d.ts +66 -0
- package/perf/report-generator.d.ts.map +1 -0
- package/perf/types.d.ts +439 -0
- package/perf/types.d.ts.map +1 -0
- package/platform/platform-client-info.d.ts +18 -0
- package/platform/platform-client-info.d.ts.map +1 -1
- package/server/index.d.ts +2 -0
- package/server/index.d.ts.map +1 -1
- package/server/port-registry.d.ts +179 -0
- package/server/port-registry.d.ts.map +1 -0
- package/server/test-server.d.ts +9 -5
- package/server/test-server.d.ts.map +1 -1
- package/transport/streamable-http.transport.d.ts +26 -0
- package/transport/streamable-http.transport.d.ts.map +1 -1
- package/transport/transport.interface.d.ts +9 -1
- package/transport/transport.interface.d.ts.map +1 -1
package/perf/types.d.ts
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file types.ts
|
|
3
|
+
* @description Type definitions for performance testing framework
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Memory metrics captured via process.memoryUsage()
|
|
7
|
+
*/
|
|
8
|
+
export interface MemoryMetrics {
|
|
9
|
+
/** Used heap size in bytes */
|
|
10
|
+
heapUsed: number;
|
|
11
|
+
/** Total heap size in bytes */
|
|
12
|
+
heapTotal: number;
|
|
13
|
+
/** Memory used by C++ objects bound to JS objects */
|
|
14
|
+
external: number;
|
|
15
|
+
/** Resident set size (total memory allocated for the process) */
|
|
16
|
+
rss: number;
|
|
17
|
+
/** Memory used by ArrayBuffers and SharedArrayBuffers */
|
|
18
|
+
arrayBuffers: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* CPU metrics captured via process.cpuUsage()
|
|
22
|
+
*/
|
|
23
|
+
export interface CpuMetrics {
|
|
24
|
+
/** User CPU time in microseconds */
|
|
25
|
+
user: number;
|
|
26
|
+
/** System CPU time in microseconds */
|
|
27
|
+
system: number;
|
|
28
|
+
/** Total CPU time (user + system) in microseconds */
|
|
29
|
+
total: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A point-in-time performance snapshot
|
|
33
|
+
*/
|
|
34
|
+
export interface PerfSnapshot {
|
|
35
|
+
/** Memory metrics at this point */
|
|
36
|
+
memory: MemoryMetrics;
|
|
37
|
+
/** CPU metrics since last measurement (or process start) */
|
|
38
|
+
cpu: CpuMetrics;
|
|
39
|
+
/** Timestamp when snapshot was taken */
|
|
40
|
+
timestamp: number;
|
|
41
|
+
/** Optional label for this snapshot */
|
|
42
|
+
label?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A complete performance measurement with baseline and samples
|
|
46
|
+
*/
|
|
47
|
+
export interface PerfMeasurement {
|
|
48
|
+
/** Test name */
|
|
49
|
+
name: string;
|
|
50
|
+
/** Project/app name */
|
|
51
|
+
project: string;
|
|
52
|
+
/** Baseline snapshot (captured before test) */
|
|
53
|
+
baseline: PerfSnapshot;
|
|
54
|
+
/** All measurement snapshots during the test */
|
|
55
|
+
measurements: PerfSnapshot[];
|
|
56
|
+
/** Final snapshot (captured after test) */
|
|
57
|
+
final?: PerfSnapshot;
|
|
58
|
+
/** Timing information */
|
|
59
|
+
timing: {
|
|
60
|
+
/** Test start timestamp */
|
|
61
|
+
startTime: number;
|
|
62
|
+
/** Test end timestamp */
|
|
63
|
+
endTime: number;
|
|
64
|
+
/** Total duration in milliseconds */
|
|
65
|
+
durationMs: number;
|
|
66
|
+
};
|
|
67
|
+
/** Memory delta (final - baseline) */
|
|
68
|
+
memoryDelta?: {
|
|
69
|
+
heapUsed: number;
|
|
70
|
+
heapTotal: number;
|
|
71
|
+
rss: number;
|
|
72
|
+
};
|
|
73
|
+
/** Detected issues during this test */
|
|
74
|
+
issues: PerfIssue[];
|
|
75
|
+
/** Leak detection results (if checkLeak was called) */
|
|
76
|
+
leakDetectionResults?: LeakDetectionResult[];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A performance issue detected during testing
|
|
80
|
+
*/
|
|
81
|
+
export interface PerfIssue {
|
|
82
|
+
/** Issue type */
|
|
83
|
+
type: 'memory-leak' | 'threshold-exceeded' | 'regression' | 'warning';
|
|
84
|
+
/** Issue severity */
|
|
85
|
+
severity: 'error' | 'warning';
|
|
86
|
+
/** Human-readable message */
|
|
87
|
+
message: string;
|
|
88
|
+
/** Metric that triggered the issue */
|
|
89
|
+
metric?: string;
|
|
90
|
+
/** Actual value that triggered the issue */
|
|
91
|
+
actual?: number;
|
|
92
|
+
/** Expected/threshold value */
|
|
93
|
+
expected?: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Thresholds for performance assertions
|
|
97
|
+
*/
|
|
98
|
+
export interface PerfThresholds {
|
|
99
|
+
/** Maximum heap delta in bytes (final - baseline) */
|
|
100
|
+
maxHeapDelta?: number;
|
|
101
|
+
/** Maximum test duration in milliseconds */
|
|
102
|
+
maxDurationMs?: number;
|
|
103
|
+
/** Maximum CPU time in microseconds */
|
|
104
|
+
maxCpuTime?: number;
|
|
105
|
+
/** Maximum RSS delta in bytes */
|
|
106
|
+
maxRssDelta?: number;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Options for memory leak detection
|
|
110
|
+
*/
|
|
111
|
+
export interface LeakDetectionOptions {
|
|
112
|
+
/** Number of iterations to run */
|
|
113
|
+
iterations?: number;
|
|
114
|
+
/** Memory growth threshold in bytes to consider a leak */
|
|
115
|
+
threshold?: number;
|
|
116
|
+
/** Warmup iterations (not counted) */
|
|
117
|
+
warmupIterations?: number;
|
|
118
|
+
/** Force GC between iterations */
|
|
119
|
+
forceGc?: boolean;
|
|
120
|
+
/** Delay between iterations in ms */
|
|
121
|
+
delayMs?: number;
|
|
122
|
+
/** Interval size for tracking memory growth (e.g., 10 means track 0-10, 10-20, etc.) */
|
|
123
|
+
intervalSize?: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Per-worker statistics in parallel leak detection
|
|
127
|
+
*/
|
|
128
|
+
export interface WorkerStats {
|
|
129
|
+
/** Worker index (0-based) */
|
|
130
|
+
workerId: number;
|
|
131
|
+
/** Requests per second for this worker */
|
|
132
|
+
requestsPerSecond: number;
|
|
133
|
+
/** Memory samples collected by this worker */
|
|
134
|
+
samples: number[];
|
|
135
|
+
/** Duration in milliseconds for this worker */
|
|
136
|
+
durationMs: number;
|
|
137
|
+
/** Number of iterations completed */
|
|
138
|
+
iterationsCompleted: number;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Client interface for parallel leak detection (minimal interface)
|
|
142
|
+
*/
|
|
143
|
+
export interface ParallelTestClient {
|
|
144
|
+
tools: {
|
|
145
|
+
call: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
146
|
+
list: () => Promise<unknown>;
|
|
147
|
+
};
|
|
148
|
+
resources: {
|
|
149
|
+
read: (uri: string) => Promise<unknown>;
|
|
150
|
+
};
|
|
151
|
+
disconnect?: () => Promise<void>;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Options for parallel memory leak detection using multiple clients
|
|
155
|
+
*/
|
|
156
|
+
export interface ParallelLeakDetectionOptions extends LeakDetectionOptions {
|
|
157
|
+
/** Number of parallel worker clients (default: 5) */
|
|
158
|
+
workers?: number;
|
|
159
|
+
/** Factory to create a new client for each worker (required for true parallelism) */
|
|
160
|
+
clientFactory?: () => Promise<ParallelTestClient>;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Result of parallel leak detection analysis
|
|
164
|
+
*/
|
|
165
|
+
export interface ParallelLeakDetectionResult extends LeakDetectionResult {
|
|
166
|
+
/** Number of workers used */
|
|
167
|
+
workersUsed: number;
|
|
168
|
+
/** Combined throughput across all workers (req/s) */
|
|
169
|
+
totalRequestsPerSecond: number;
|
|
170
|
+
/** Per-worker statistics */
|
|
171
|
+
perWorkerStats: WorkerStats[];
|
|
172
|
+
/** Total iterations across all workers */
|
|
173
|
+
totalIterations: number;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Memory measurement at a specific interval
|
|
177
|
+
*/
|
|
178
|
+
export interface IntervalMeasurement {
|
|
179
|
+
/** Start iteration of this interval */
|
|
180
|
+
startIteration: number;
|
|
181
|
+
/** End iteration of this interval */
|
|
182
|
+
endIteration: number;
|
|
183
|
+
/** Heap used at start of interval (bytes) */
|
|
184
|
+
heapAtStart: number;
|
|
185
|
+
/** Heap used at end of interval (bytes) */
|
|
186
|
+
heapAtEnd: number;
|
|
187
|
+
/** Memory delta for this interval (bytes) */
|
|
188
|
+
delta: number;
|
|
189
|
+
/** Formatted delta string */
|
|
190
|
+
deltaFormatted: string;
|
|
191
|
+
/** Growth rate per iteration in this interval */
|
|
192
|
+
growthRatePerIteration: number;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Graph data point for visualization
|
|
196
|
+
*/
|
|
197
|
+
export interface MemoryGraphPoint {
|
|
198
|
+
/** Iteration number */
|
|
199
|
+
iteration: number;
|
|
200
|
+
/** Heap used at this iteration (bytes) */
|
|
201
|
+
heapUsed: number;
|
|
202
|
+
/** Heap used formatted */
|
|
203
|
+
heapUsedFormatted: string;
|
|
204
|
+
/** Cumulative delta from start (bytes) */
|
|
205
|
+
cumulativeDelta: number;
|
|
206
|
+
/** Cumulative delta formatted */
|
|
207
|
+
cumulativeDeltaFormatted: string;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Result of leak detection analysis
|
|
211
|
+
*/
|
|
212
|
+
export interface LeakDetectionResult {
|
|
213
|
+
/** Whether a memory leak was detected */
|
|
214
|
+
hasLeak: boolean;
|
|
215
|
+
/** Estimated leak size in bytes per iteration */
|
|
216
|
+
leakSizePerIteration: number;
|
|
217
|
+
/** Total memory growth during test */
|
|
218
|
+
totalGrowth: number;
|
|
219
|
+
/** Growth rate (bytes per iteration) */
|
|
220
|
+
growthRate: number;
|
|
221
|
+
/** Linear regression R² value (1.0 = perfect linear growth) */
|
|
222
|
+
rSquared: number;
|
|
223
|
+
/** All heap measurements */
|
|
224
|
+
samples: number[];
|
|
225
|
+
/** Summary message */
|
|
226
|
+
message: string;
|
|
227
|
+
/** Interval-based measurements for detailed analysis */
|
|
228
|
+
intervals?: IntervalMeasurement[];
|
|
229
|
+
/** Graph data points for visualization */
|
|
230
|
+
graphData?: MemoryGraphPoint[];
|
|
231
|
+
/** Total duration of the leak detection test in milliseconds */
|
|
232
|
+
durationMs?: number;
|
|
233
|
+
/** Requests per second (iterations / duration in seconds) */
|
|
234
|
+
requestsPerSecond?: number;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Baseline statistics for a metric
|
|
238
|
+
*/
|
|
239
|
+
export interface MetricBaseline {
|
|
240
|
+
/** Mean value */
|
|
241
|
+
mean: number;
|
|
242
|
+
/** Standard deviation */
|
|
243
|
+
stdDev: number;
|
|
244
|
+
/** Minimum observed value */
|
|
245
|
+
min: number;
|
|
246
|
+
/** Maximum observed value */
|
|
247
|
+
max: number;
|
|
248
|
+
/** 95th percentile */
|
|
249
|
+
p95: number;
|
|
250
|
+
/** Number of samples */
|
|
251
|
+
sampleCount: number;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Baseline data for a single test
|
|
255
|
+
*/
|
|
256
|
+
export interface TestBaseline {
|
|
257
|
+
/** Test identifier */
|
|
258
|
+
testId: string;
|
|
259
|
+
/** Project name */
|
|
260
|
+
project: string;
|
|
261
|
+
/** Heap used baseline */
|
|
262
|
+
heapUsed: MetricBaseline;
|
|
263
|
+
/** Duration baseline */
|
|
264
|
+
durationMs: MetricBaseline;
|
|
265
|
+
/** CPU time baseline */
|
|
266
|
+
cpuTime: MetricBaseline;
|
|
267
|
+
/** When baseline was created */
|
|
268
|
+
createdAt: string;
|
|
269
|
+
/** Git commit hash */
|
|
270
|
+
commitHash?: string;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Complete baseline storage format
|
|
274
|
+
*/
|
|
275
|
+
export interface PerfBaseline {
|
|
276
|
+
/** Release/version tag */
|
|
277
|
+
release: string;
|
|
278
|
+
/** When baselines were generated */
|
|
279
|
+
timestamp: string;
|
|
280
|
+
/** Git commit hash */
|
|
281
|
+
commitHash?: string;
|
|
282
|
+
/** All test baselines */
|
|
283
|
+
tests: Record<string, TestBaseline>;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Configuration for regression detection
|
|
287
|
+
*/
|
|
288
|
+
export interface RegressionConfig {
|
|
289
|
+
/** Warning threshold as percentage (default: 10) */
|
|
290
|
+
warningThresholdPercent?: number;
|
|
291
|
+
/** Error threshold as percentage (default: 25) */
|
|
292
|
+
errorThresholdPercent?: number;
|
|
293
|
+
/** Minimum absolute change to report (avoids noise on small values) */
|
|
294
|
+
minAbsoluteChange?: number;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Result of regression analysis for a single metric
|
|
298
|
+
*/
|
|
299
|
+
export interface MetricRegression {
|
|
300
|
+
/** Metric name */
|
|
301
|
+
metric: string;
|
|
302
|
+
/** Baseline value */
|
|
303
|
+
baseline: number;
|
|
304
|
+
/** Current value */
|
|
305
|
+
current: number;
|
|
306
|
+
/** Change percentage */
|
|
307
|
+
changePercent: number;
|
|
308
|
+
/** Absolute change */
|
|
309
|
+
absoluteChange: number;
|
|
310
|
+
/** Regression status */
|
|
311
|
+
status: 'ok' | 'warning' | 'regression';
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Complete regression analysis result
|
|
315
|
+
*/
|
|
316
|
+
export interface RegressionResult {
|
|
317
|
+
/** Test identifier */
|
|
318
|
+
testId: string;
|
|
319
|
+
/** Overall status */
|
|
320
|
+
status: 'ok' | 'warning' | 'regression';
|
|
321
|
+
/** Individual metric regressions */
|
|
322
|
+
metrics: MetricRegression[];
|
|
323
|
+
/** Summary message */
|
|
324
|
+
message: string;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Summary statistics for a test run
|
|
328
|
+
*/
|
|
329
|
+
export interface PerfTestSummary {
|
|
330
|
+
/** Total tests run */
|
|
331
|
+
totalTests: number;
|
|
332
|
+
/** Tests that passed */
|
|
333
|
+
passedTests: number;
|
|
334
|
+
/** Tests with warnings */
|
|
335
|
+
warningTests: number;
|
|
336
|
+
/** Tests that failed */
|
|
337
|
+
failedTests: number;
|
|
338
|
+
/** Tests with detected memory leaks */
|
|
339
|
+
leakTests: number;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Per-project summary
|
|
343
|
+
*/
|
|
344
|
+
export interface ProjectSummary {
|
|
345
|
+
/** Project name */
|
|
346
|
+
project: string;
|
|
347
|
+
/** Summary statistics */
|
|
348
|
+
summary: PerfTestSummary;
|
|
349
|
+
/** All measurements for this project */
|
|
350
|
+
measurements: PerfMeasurement[];
|
|
351
|
+
/** Regression results (if baseline available) */
|
|
352
|
+
regressions?: RegressionResult[];
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Complete performance report
|
|
356
|
+
*/
|
|
357
|
+
export interface PerfReport {
|
|
358
|
+
/** Report generation timestamp */
|
|
359
|
+
timestamp: string;
|
|
360
|
+
/** Git commit hash */
|
|
361
|
+
commitHash?: string;
|
|
362
|
+
/** Git branch name */
|
|
363
|
+
branch?: string;
|
|
364
|
+
/** Overall summary */
|
|
365
|
+
summary: PerfTestSummary;
|
|
366
|
+
/** Per-project breakdowns */
|
|
367
|
+
projects: ProjectSummary[];
|
|
368
|
+
/** Baseline used for comparison (if any) */
|
|
369
|
+
baseline?: {
|
|
370
|
+
release: string;
|
|
371
|
+
timestamp: string;
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Performance fixture available in perfTest functions
|
|
376
|
+
*/
|
|
377
|
+
export interface PerfFixtures {
|
|
378
|
+
/** Capture baseline snapshot */
|
|
379
|
+
baseline(): Promise<PerfSnapshot>;
|
|
380
|
+
/** Capture a measurement snapshot */
|
|
381
|
+
measure(label?: string): PerfSnapshot;
|
|
382
|
+
/** Run leak detection on an operation */
|
|
383
|
+
checkLeak(operation: () => Promise<void>, options?: LeakDetectionOptions): Promise<LeakDetectionResult>;
|
|
384
|
+
/**
|
|
385
|
+
* Run parallel leak detection using multiple clients.
|
|
386
|
+
* This achieves higher throughput by running N workers concurrently.
|
|
387
|
+
*
|
|
388
|
+
* @param operationFactory - Factory that receives a client and worker index, returns an operation function
|
|
389
|
+
* @param options - Detection options including worker count and client factory
|
|
390
|
+
* @returns Parallel leak detection result with combined throughput metrics
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* ```typescript
|
|
394
|
+
* const result = await perf.checkLeakParallel(
|
|
395
|
+
* (client, workerId) => async () => {
|
|
396
|
+
* await client.tools.call('my-tool', { key: `worker-${workerId}` });
|
|
397
|
+
* },
|
|
398
|
+
* {
|
|
399
|
+
* iterations: 1000,
|
|
400
|
+
* workers: 5,
|
|
401
|
+
* clientFactory: () => server.createClient(),
|
|
402
|
+
* }
|
|
403
|
+
* );
|
|
404
|
+
* expect(result.totalRequestsPerSecond).toBeGreaterThan(300);
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
checkLeakParallel(operationFactory: (client: ParallelTestClient, workerId: number) => () => Promise<void>, options: ParallelLeakDetectionOptions & {
|
|
408
|
+
clientFactory: () => Promise<ParallelTestClient>;
|
|
409
|
+
}): Promise<ParallelLeakDetectionResult>;
|
|
410
|
+
/** Assert performance thresholds */
|
|
411
|
+
assertThresholds(thresholds: PerfThresholds): void;
|
|
412
|
+
/** Get all measurements so far */
|
|
413
|
+
getMeasurements(): PerfSnapshot[];
|
|
414
|
+
/** Get the current test name */
|
|
415
|
+
getTestName(): string;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Extended test fixtures including performance
|
|
419
|
+
*/
|
|
420
|
+
export interface PerfTestFixtures {
|
|
421
|
+
/** Performance fixture */
|
|
422
|
+
perf: PerfFixtures;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Performance test configuration
|
|
426
|
+
*/
|
|
427
|
+
export interface PerfTestConfig {
|
|
428
|
+
/** Server entry file path */
|
|
429
|
+
server?: string;
|
|
430
|
+
/** Project name */
|
|
431
|
+
project?: string;
|
|
432
|
+
/** Enable public mode */
|
|
433
|
+
publicMode?: boolean;
|
|
434
|
+
/** Default thresholds for all tests */
|
|
435
|
+
defaultThresholds?: PerfThresholds;
|
|
436
|
+
/** Force GC before baseline */
|
|
437
|
+
forceGcOnBaseline?: boolean;
|
|
438
|
+
}
|
|
439
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/perf/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;IACZ,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;CACf;AAMD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,MAAM,EAAE,aAAa,CAAC;IACtB,4DAA4D;IAC5D,GAAG,EAAE,UAAU,CAAC;IAChB,wCAAwC;IAC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CAAC,CAAC;IACxC,oCAAoC;IACpC,gBAAgB,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI,CAAC;IACnD,kCAAkC;IAClC,eAAe,IAAI,YAAY,EAAE,CAAC;IAClC,gCAAgC;IAChC,WAAW,IAAI,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0BAA0B;IAC1B,IAAI,EAAE,YAAY,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,cAAc,CAAC;IACnC,+BAA+B;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -74,11 +74,29 @@ export interface ExperimentalCapabilities {
|
|
|
74
74
|
[MCP_APPS_EXTENSION_KEY]?: McpAppsExtension;
|
|
75
75
|
[key: string]: unknown;
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Form elicitation capability options.
|
|
79
|
+
*/
|
|
80
|
+
export interface FormElicitationCapability {
|
|
81
|
+
/** Whether to apply default values from the schema */
|
|
82
|
+
applyDefaults?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Elicitation capabilities for interactive user input.
|
|
86
|
+
* Note: MCP SDK expects form/url to be objects, not booleans.
|
|
87
|
+
*/
|
|
88
|
+
export interface ElicitationCapabilities {
|
|
89
|
+
/** Support for form-based elicitation - use empty object {} to enable */
|
|
90
|
+
form?: FormElicitationCapability | Record<string, unknown>;
|
|
91
|
+
/** Support for URL-based elicitation - use empty object {} to enable */
|
|
92
|
+
url?: Record<string, unknown>;
|
|
93
|
+
}
|
|
77
94
|
/**
|
|
78
95
|
* Client capabilities sent during MCP initialization.
|
|
79
96
|
*/
|
|
80
97
|
export interface TestClientCapabilities {
|
|
81
98
|
sampling?: Record<string, unknown>;
|
|
99
|
+
elicitation?: ElicitationCapabilities;
|
|
82
100
|
experimental?: ExperimentalCapabilities;
|
|
83
101
|
}
|
|
84
102
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-client-info.d.ts","sourceRoot":"","sources":["../../src/platform/platform-client-info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAG,4BAAqC,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAiDhF;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM,CAEjE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAEvE;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAUxE,CAAC;AAMF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,CAAC,sBAAsB,CAAC,CAAC,EAAE,gBAAgB,CAAC;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,YAAY,CAAC,EAAE,wBAAwB,CAAC;CACzC;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,sBAAsB,
|
|
1
|
+
{"version":3,"file":"platform-client-info.d.ts","sourceRoot":"","sources":["../../src/platform/platform-client-info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAG,4BAAqC,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAiDhF;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM,CAEjE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAEvE;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAUxE,CAAC;AAMF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,CAAC,sBAAsB,CAAC,CAAC,EAAE,gBAAgB,CAAC;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,IAAI,CAAC,EAAE,yBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3D,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,YAAY,CAAC,EAAE,wBAAwB,CAAC;CACzC;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,sBAAsB,CAuB1F;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAE/E"}
|
package/server/index.d.ts
CHANGED
|
@@ -4,4 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { TestServer } from './test-server';
|
|
6
6
|
export type { TestServerOptions, TestServerInfo } from './test-server';
|
|
7
|
+
export { reservePort, getProjectPort, getProjectPorts, getPortRange, releaseAllPorts, getReservedPorts, findAvailablePort, E2E_PORT_RANGES, } from './port-registry';
|
|
8
|
+
export type { E2EProject } from './port-registry';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
package/server/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGvE,OAAO,EACL,WAAW,EACX,cAAc,EACd,eAAe,EACf,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file port-registry.ts
|
|
3
|
+
* @description Centralized port management for E2E tests to prevent port conflicts
|
|
4
|
+
*
|
|
5
|
+
* This module provides:
|
|
6
|
+
* 1. Dedicated port ranges for each E2E test project
|
|
7
|
+
* 2. Port reservation with proper locking
|
|
8
|
+
* 3. Verification that ports are actually available before assignment
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Port range configuration for E2E test projects.
|
|
12
|
+
* Each project gets a dedicated range of 10 ports to support multiple servers.
|
|
13
|
+
*
|
|
14
|
+
* Base port: 50000 (well above common services)
|
|
15
|
+
* Range size: 10 ports per project
|
|
16
|
+
*/
|
|
17
|
+
export declare const E2E_PORT_RANGES: {
|
|
18
|
+
readonly 'demo-e2e-public': {
|
|
19
|
+
readonly start: 50000;
|
|
20
|
+
readonly size: 10;
|
|
21
|
+
};
|
|
22
|
+
readonly 'demo-e2e-cache': {
|
|
23
|
+
readonly start: 50010;
|
|
24
|
+
readonly size: 10;
|
|
25
|
+
};
|
|
26
|
+
readonly 'demo-e2e-config': {
|
|
27
|
+
readonly start: 50020;
|
|
28
|
+
readonly size: 10;
|
|
29
|
+
};
|
|
30
|
+
readonly 'demo-e2e-direct': {
|
|
31
|
+
readonly start: 50030;
|
|
32
|
+
readonly size: 10;
|
|
33
|
+
};
|
|
34
|
+
readonly 'demo-e2e-errors': {
|
|
35
|
+
readonly start: 50040;
|
|
36
|
+
readonly size: 10;
|
|
37
|
+
};
|
|
38
|
+
readonly 'demo-e2e-hooks': {
|
|
39
|
+
readonly start: 50050;
|
|
40
|
+
readonly size: 10;
|
|
41
|
+
};
|
|
42
|
+
readonly 'demo-e2e-multiapp': {
|
|
43
|
+
readonly start: 50060;
|
|
44
|
+
readonly size: 10;
|
|
45
|
+
};
|
|
46
|
+
readonly 'demo-e2e-notifications': {
|
|
47
|
+
readonly start: 50070;
|
|
48
|
+
readonly size: 10;
|
|
49
|
+
};
|
|
50
|
+
readonly 'demo-e2e-providers': {
|
|
51
|
+
readonly start: 50080;
|
|
52
|
+
readonly size: 10;
|
|
53
|
+
};
|
|
54
|
+
readonly 'demo-e2e-standalone': {
|
|
55
|
+
readonly start: 50090;
|
|
56
|
+
readonly size: 10;
|
|
57
|
+
};
|
|
58
|
+
readonly 'demo-e2e-orchestrated': {
|
|
59
|
+
readonly start: 50100;
|
|
60
|
+
readonly size: 10;
|
|
61
|
+
};
|
|
62
|
+
readonly 'demo-e2e-transparent': {
|
|
63
|
+
readonly start: 50110;
|
|
64
|
+
readonly size: 10;
|
|
65
|
+
};
|
|
66
|
+
readonly 'demo-e2e-cimd': {
|
|
67
|
+
readonly start: 50120;
|
|
68
|
+
readonly size: 10;
|
|
69
|
+
};
|
|
70
|
+
readonly 'demo-e2e-skills': {
|
|
71
|
+
readonly start: 50200;
|
|
72
|
+
readonly size: 10;
|
|
73
|
+
};
|
|
74
|
+
readonly 'demo-e2e-remote': {
|
|
75
|
+
readonly start: 50210;
|
|
76
|
+
readonly size: 10;
|
|
77
|
+
};
|
|
78
|
+
readonly 'demo-e2e-openapi': {
|
|
79
|
+
readonly start: 50220;
|
|
80
|
+
readonly size: 10;
|
|
81
|
+
};
|
|
82
|
+
readonly 'demo-e2e-ui': {
|
|
83
|
+
readonly start: 50230;
|
|
84
|
+
readonly size: 10;
|
|
85
|
+
};
|
|
86
|
+
readonly 'demo-e2e-codecall': {
|
|
87
|
+
readonly start: 50240;
|
|
88
|
+
readonly size: 10;
|
|
89
|
+
};
|
|
90
|
+
readonly 'demo-e2e-remember': {
|
|
91
|
+
readonly start: 50250;
|
|
92
|
+
readonly size: 10;
|
|
93
|
+
};
|
|
94
|
+
readonly 'demo-e2e-elicitation': {
|
|
95
|
+
readonly start: 50260;
|
|
96
|
+
readonly size: 10;
|
|
97
|
+
};
|
|
98
|
+
readonly 'demo-e2e-agents': {
|
|
99
|
+
readonly start: 50270;
|
|
100
|
+
readonly size: 10;
|
|
101
|
+
};
|
|
102
|
+
readonly 'demo-e2e-transport-recreation': {
|
|
103
|
+
readonly start: 50280;
|
|
104
|
+
readonly size: 10;
|
|
105
|
+
};
|
|
106
|
+
readonly 'demo-e2e-redis': {
|
|
107
|
+
readonly start: 50300;
|
|
108
|
+
readonly size: 10;
|
|
109
|
+
};
|
|
110
|
+
readonly 'demo-e2e-serverless': {
|
|
111
|
+
readonly start: 50310;
|
|
112
|
+
readonly size: 10;
|
|
113
|
+
};
|
|
114
|
+
readonly 'mock-oauth': {
|
|
115
|
+
readonly start: 50900;
|
|
116
|
+
readonly size: 10;
|
|
117
|
+
};
|
|
118
|
+
readonly 'mock-api': {
|
|
119
|
+
readonly start: 50910;
|
|
120
|
+
readonly size: 10;
|
|
121
|
+
};
|
|
122
|
+
readonly 'mock-cimd': {
|
|
123
|
+
readonly start: 50920;
|
|
124
|
+
readonly size: 10;
|
|
125
|
+
};
|
|
126
|
+
readonly default: {
|
|
127
|
+
readonly start: 51000;
|
|
128
|
+
readonly size: 100;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
export type E2EProject = keyof typeof E2E_PORT_RANGES;
|
|
132
|
+
/**
|
|
133
|
+
* Get the port range for a project
|
|
134
|
+
*/
|
|
135
|
+
export declare function getPortRange(project: string): {
|
|
136
|
+
start: number;
|
|
137
|
+
size: number;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Reserve a port for a project.
|
|
141
|
+
* Returns a port number and a release function.
|
|
142
|
+
*
|
|
143
|
+
* The port is held by a temporary server until released, preventing race conditions.
|
|
144
|
+
*
|
|
145
|
+
* @param project - E2E project name (used to determine port range)
|
|
146
|
+
* @param preferredPort - Optional specific port to use
|
|
147
|
+
* @returns Object with port number and release function
|
|
148
|
+
*/
|
|
149
|
+
export declare function reservePort(project: string, preferredPort?: number): Promise<{
|
|
150
|
+
port: number;
|
|
151
|
+
release: () => Promise<void>;
|
|
152
|
+
}>;
|
|
153
|
+
/**
|
|
154
|
+
* Get the primary port for a project (first port in its range)
|
|
155
|
+
*/
|
|
156
|
+
export declare function getProjectPort(project: string): number;
|
|
157
|
+
/**
|
|
158
|
+
* Get all ports for a project (for multi-server scenarios)
|
|
159
|
+
*/
|
|
160
|
+
export declare function getProjectPorts(project: string, count: number): number[];
|
|
161
|
+
/**
|
|
162
|
+
* Release all reserved ports (for cleanup in afterAll)
|
|
163
|
+
*/
|
|
164
|
+
export declare function releaseAllPorts(): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* Get information about currently reserved ports (for debugging)
|
|
167
|
+
*/
|
|
168
|
+
export declare function getReservedPorts(): Array<{
|
|
169
|
+
port: number;
|
|
170
|
+
project: string;
|
|
171
|
+
reservedAt: number;
|
|
172
|
+
}>;
|
|
173
|
+
/**
|
|
174
|
+
* Find an available port (legacy compatibility function)
|
|
175
|
+
*
|
|
176
|
+
* @deprecated Use reservePort() for better port management
|
|
177
|
+
*/
|
|
178
|
+
export declare function findAvailablePort(): Promise<number>;
|
|
179
|
+
//# sourceMappingURL=port-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port-registry.d.ts","sourceRoot":"","sources":["../../src/server/port-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCl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