Skip to content

Commit d78bd41

Browse files
committed
remove e2e debug observability
1 parent 76067d7 commit d78bd41

4 files changed

Lines changed: 3 additions & 75 deletions

File tree

apps/internal-storybook/tests/helpers.ts

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,10 @@ export async function waitForMcpEndpoint(
2626
maxAttempts?: number;
2727
interval?: number;
2828
acceptStatuses?: number[];
29-
debugLabel?: string;
3029
storybookProcess?: StorybookProcess | null;
3130
} = {},
3231
): Promise<void> {
33-
const {
34-
maxAttempts = 120,
35-
interval = 500,
36-
acceptStatuses = [],
37-
debugLabel = 'mcp',
38-
storybookProcess,
39-
} = options;
32+
const { maxAttempts = 120, interval = 500, acceptStatuses = [], storybookProcess } = options;
4033
const { promise, resolve, reject } = Promise.withResolvers<void>();
4134
let attempts = 0;
4235
let lastStatus: number | null = null;
@@ -51,7 +44,7 @@ export async function waitForMcpEndpoint(
5144
clearInterval(intervalId);
5245
reject(
5346
new Error(
54-
`[${debugLabel}] Storybook exited before MCP became ready (pid=${storybookPid}, exitCode=${storybookExitCode})`,
47+
`Storybook exited before MCP became ready (pid=${storybookPid}, exitCode=${storybookExitCode})`,
5548
),
5649
);
5750
return;
@@ -63,27 +56,20 @@ export async function waitForMcpEndpoint(
6356
body: JSON.stringify(createMCPRequestBody('tools/list')),
6457
});
6558
lastStatus = response.status;
66-
console.log(
67-
`[${debugLabel}] MCP probe #${attempts}/${maxAttempts}: status=${response.status}`,
68-
);
6959
if (response.ok || acceptStatuses.includes(response.status)) {
7060
clearInterval(intervalId);
71-
console.log(
72-
`[${debugLabel}] MCP endpoint ready after ${attempts} probes (status=${response.status})`,
73-
);
7461
resolve();
7562
return;
7663
}
7764
} catch (error) {
7865
lastErrorMessage = error instanceof Error ? error.message : String(error);
79-
console.log(`[${debugLabel}] MCP probe #${attempts}/${maxAttempts}: ${lastErrorMessage}`);
8066
}
8167

8268
if (attempts >= maxAttempts) {
8369
clearInterval(intervalId);
8470
reject(
8571
new Error(
86-
`[${debugLabel}] MCP endpoint failed to start in time (attempts=${attempts}, lastStatus=${lastStatus ?? 'none'}, lastError=${lastErrorMessage ?? 'none'})`,
72+
`MCP endpoint failed to start in time (attempts=${attempts}, lastStatus=${lastStatus ?? 'none'}, lastError=${lastErrorMessage ?? 'none'})`,
8773
),
8874
);
8975
}
@@ -116,40 +102,6 @@ export function startStorybook(configDir: string, port: number): ReturnType<type
116102
});
117103
}
118104

119-
export function attachStorybookDebugLogging(
120-
storybookProcess: StorybookProcess | null,
121-
label: string,
122-
): void {
123-
if (!storybookProcess?.process) {
124-
console.log(`[${label}] Storybook process missing`);
125-
return;
126-
}
127-
const proc = storybookProcess.process;
128-
console.log(`[${label}] Storybook started (pid=${proc.pid ?? 'unknown'})`);
129-
proc.stdout?.setEncoding('utf8');
130-
proc.stderr?.setEncoding('utf8');
131-
proc.stdout?.on('data', (chunk: string) => {
132-
for (const line of chunk.split('\n')) {
133-
if (line.trim()) {
134-
console.log(`[${label}] stdout: ${line}`);
135-
}
136-
}
137-
});
138-
proc.stderr?.on('data', (chunk: string) => {
139-
for (const line of chunk.split('\n')) {
140-
if (line.trim()) {
141-
console.log(`[${label}] stderr: ${line}`);
142-
}
143-
}
144-
});
145-
proc.on('exit', (code, signal) => {
146-
console.log(`[${label}] Storybook exited (code=${code}, signal=${signal ?? 'none'})`);
147-
});
148-
proc.on('error', (error) => {
149-
console.log(`[${label}] Storybook process error: ${error.message}`);
150-
});
151-
}
152-
153105
export async function stopStorybook(storybookProcess: ReturnType<typeof x> | null): Promise<void> {
154106
if (!storybookProcess || !storybookProcess.process) {
155107
return;

apps/internal-storybook/tests/mcp-composition-auth.e2e.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
killPort,
88
startStorybook,
99
stopStorybook,
10-
attachStorybookDebugLogging,
1110
} from './helpers';
1211

1312
const PORT = 6008;
@@ -35,25 +34,18 @@ async function mcpRequest(method: string, params: any = {}, token?: string) {
3534

3635
describe('MCP Composition Auth E2E Tests', () => {
3736
beforeAll(async () => {
38-
console.log('[mcp-composition-auth] Starting setup');
3937
await killPort(PORT);
40-
console.log('[mcp-composition-auth] Port cleanup completed');
4138
storybookProcess = startStorybook('.storybook-composition-auth', PORT);
42-
attachStorybookDebugLogging(storybookProcess, 'mcp-composition-auth');
4339
await waitForMcpEndpoint(MCP_ENDPOINT, {
4440
maxAttempts: 80,
4541
acceptStatuses: [401],
46-
debugLabel: 'mcp-composition-auth',
4742
storybookProcess,
4843
});
49-
console.log('[mcp-composition-auth] MCP endpoint is ready');
5044
}, STARTUP_TIMEOUT);
5145

5246
afterAll(async () => {
53-
console.log('[mcp-composition-auth] Starting teardown');
5447
await stopStorybook(storybookProcess);
5548
storybookProcess = null;
56-
console.log('[mcp-composition-auth] Teardown completed');
5749
}, SHUTDOWN_TIMEOUT);
5850

5951
describe('OAuth Discovery', () => {

apps/internal-storybook/tests/mcp-composition.e2e.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
killPort,
88
startStorybook,
99
stopStorybook,
10-
attachStorybookDebugLogging,
1110
} from './helpers';
1211

1312
const PORT = 6007;
@@ -33,24 +32,17 @@ async function mcpRequest(method: string, params: any = {}) {
3332

3433
describe('MCP Composition E2E Tests', () => {
3534
beforeAll(async () => {
36-
console.log('[mcp-composition] Starting setup');
3735
await killPort(PORT);
38-
console.log('[mcp-composition] Port cleanup completed');
3936
storybookProcess = startStorybook('.storybook-composition', PORT);
40-
attachStorybookDebugLogging(storybookProcess, 'mcp-composition');
4137
await waitForMcpEndpoint(MCP_ENDPOINT, {
4238
maxAttempts: 80,
43-
debugLabel: 'mcp-composition',
4439
storybookProcess,
4540
});
46-
console.log('[mcp-composition] MCP endpoint is ready');
4741
}, STARTUP_TIMEOUT);
4842

4943
afterAll(async () => {
50-
console.log('[mcp-composition] Starting teardown');
5144
await stopStorybook(storybookProcess);
5245
storybookProcess = null;
53-
console.log('[mcp-composition] Teardown completed');
5446
}, SHUTDOWN_TIMEOUT);
5547

5648
describe('Multi-Source Documentation', () => {

apps/internal-storybook/tests/mcp-endpoint.e2e.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
killPort,
88
startStorybook,
99
stopStorybook,
10-
attachStorybookDebugLogging,
1110
} from './helpers';
1211

1312
const PORT = 6006;
@@ -33,25 +32,18 @@ async function mcpRequest(method: string, params: any = {}, id: number = 1) {
3332

3433
describe('MCP Endpoint E2E Tests', () => {
3534
beforeAll(async () => {
36-
console.log('[mcp-endpoint] Starting setup');
3735
await killPort(PORT);
38-
console.log('[mcp-endpoint] Port cleanup completed');
3936
storybookProcess = startStorybook('.storybook', PORT);
40-
attachStorybookDebugLogging(storybookProcess, 'mcp-endpoint');
4137

4238
await waitForMcpEndpoint(MCP_ENDPOINT, {
4339
maxAttempts: 80,
44-
debugLabel: 'mcp-endpoint',
4540
storybookProcess,
4641
});
47-
console.log('[mcp-endpoint] MCP endpoint is ready');
4842
}, STARTUP_TIMEOUT);
4943

5044
afterAll(async () => {
51-
console.log('[mcp-endpoint] Starting teardown');
5245
await stopStorybook(storybookProcess);
5346
storybookProcess = null;
54-
console.log('[mcp-endpoint] Teardown completed');
5547
}, SHUTDOWN_TIMEOUT);
5648

5749
describe('Session Initialization', () => {

0 commit comments

Comments
 (0)