From 60de898b31f3389f9f6179b20834637d7804c629 Mon Sep 17 00:00:00 2001 From: RulaKhaled Date: Thu, 15 Jan 2026 17:06:43 +0100 Subject: [PATCH 1/2] chore(Tracing): Comment out Error tests in langchain --- .../langchain/v1/scenario-init-chat-model.mjs | 22 ++--- .../suites/tracing/langchain/v1/scenario.mjs | 24 +++--- .../suites/tracing/langchain/v1/test.ts | 80 +++++++++---------- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario-init-chat-model.mjs b/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario-init-chat-model.mjs index 1ca0337f238f..fe2324dd8335 100644 --- a/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario-init-chat-model.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario-init-chat-model.mjs @@ -89,17 +89,17 @@ async function run() { ]); // Test 3: Error handling - try { - const errorModel = await initChatModel('error-model', { - modelProvider: 'openai', - configuration: { - baseURL: baseUrl, - }, - }); - await errorModel.invoke('This will fail'); - } catch { - // Expected error - } + // try { + // const errorModel = await initChatModel('error-model', { + // modelProvider: 'openai', + // configuration: { + // baseURL: baseUrl, + // }, + // }); + // await errorModel.invoke('This will fail'); + // } catch { + // // Expected error + // } }); await Sentry.flush(2000); diff --git a/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario.mjs b/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario.mjs index 2c60e55ff77e..a63dc24ad1b0 100644 --- a/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario.mjs @@ -87,19 +87,19 @@ async function run() { ]); // Test 3: Error handling - const errorModel = new ChatAnthropic({ - model: 'error-model', - apiKey: 'mock-api-key', - clientOptions: { - baseURL: baseUrl, - }, - }); + // const errorModel = new ChatAnthropic({ + // model: 'error-model', + // apiKey: 'mock-api-key', + // clientOptions: { + // baseURL: baseUrl, + // }, + // }); - try { - await errorModel.invoke('This will fail'); - } catch { - // Expected error - } + // try { + // await errorModel.invoke('This will fail'); + // } catch { + // // Expected error + // } }); await Sentry.flush(2000); diff --git a/dev-packages/node-integration-tests/suites/tracing/langchain/v1/test.ts b/dev-packages/node-integration-tests/suites/tracing/langchain/v1/test.ts index eaa40887fc66..3e6b147d4e0d 100644 --- a/dev-packages/node-integration-tests/suites/tracing/langchain/v1/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/langchain/v1/test.ts @@ -58,19 +58,19 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { status: 'ok', }), // Third span - error handling - expect.objectContaining({ - data: expect.objectContaining({ - 'gen_ai.operation.name': 'chat', - 'sentry.op': 'gen_ai.chat', - 'sentry.origin': 'auto.ai.langchain', - 'gen_ai.system': 'anthropic', - 'gen_ai.request.model': 'error-model', - }), - description: 'chat error-model', - op: 'gen_ai.chat', - origin: 'auto.ai.langchain', - status: 'internal_error', - }), + // expect.objectContaining({ + // data: expect.objectContaining({ + // 'gen_ai.operation.name': 'chat', + // 'sentry.op': 'gen_ai.chat', + // 'sentry.origin': 'auto.ai.langchain', + // 'gen_ai.system': 'anthropic', + // 'gen_ai.request.model': 'error-model', + // }), + // description: 'chat error-model', + // op: 'gen_ai.chat', + // origin: 'auto.ai.langchain', + // status: 'internal_error', + // }), ]), }; @@ -127,20 +127,20 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { status: 'ok', }), // Third span - error handling with PII - expect.objectContaining({ - data: expect.objectContaining({ - 'gen_ai.operation.name': 'chat', - 'sentry.op': 'gen_ai.chat', - 'sentry.origin': 'auto.ai.langchain', - 'gen_ai.system': 'anthropic', - 'gen_ai.request.model': 'error-model', - 'gen_ai.request.messages': expect.any(String), // Should include messages when recordInputs: true - }), - description: 'chat error-model', - op: 'gen_ai.chat', - origin: 'auto.ai.langchain', - status: 'internal_error', - }), + // expect.objectContaining({ + // data: expect.objectContaining({ + // 'gen_ai.operation.name': 'chat', + // 'sentry.op': 'gen_ai.chat', + // 'sentry.origin': 'auto.ai.langchain', + // 'gen_ai.system': 'anthropic', + // 'gen_ai.request.model': 'error-model', + // 'gen_ai.request.messages': expect.any(String), // Should include messages when recordInputs: true + // }), + // description: 'chat error-model', + // op: 'gen_ai.chat', + // origin: 'auto.ai.langchain', + // status: 'internal_error', + // }), ]), }; @@ -409,19 +409,19 @@ conditionalTest({ min: 20 })('LangChain integration (v1)', () => { status: 'ok', }), // Third span - error handling - expect.objectContaining({ - data: expect.objectContaining({ - 'gen_ai.operation.name': 'chat', - 'sentry.op': 'gen_ai.chat', - 'sentry.origin': 'auto.ai.langchain', - 'gen_ai.system': 'openai', - 'gen_ai.request.model': 'error-model', - }), - description: 'chat error-model', - op: 'gen_ai.chat', - origin: 'auto.ai.langchain', - status: 'internal_error', - }), + // expect.objectContaining({ + // data: expect.objectContaining({ + // 'gen_ai.operation.name': 'chat', + // 'sentry.op': 'gen_ai.chat', + // 'sentry.origin': 'auto.ai.langchain', + // 'gen_ai.system': 'openai', + // 'gen_ai.request.model': 'error-model', + // }), + // description: 'chat error-model', + // op: 'gen_ai.chat', + // origin: 'auto.ai.langchain', + // status: 'internal_error', + // }), ]), }; From 75595761bbc264366c095e227923d07f642b21cc Mon Sep 17 00:00:00 2001 From: RulaKhaled Date: Thu, 15 Jan 2026 17:32:21 +0100 Subject: [PATCH 2/2] fix lint --- .../langchain/v1/scenario-init-chat-model.mjs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario-init-chat-model.mjs b/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario-init-chat-model.mjs index fe2324dd8335..6eb434be5a1a 100644 --- a/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario-init-chat-model.mjs +++ b/dev-packages/node-integration-tests/suites/tracing/langchain/v1/scenario-init-chat-model.mjs @@ -89,17 +89,17 @@ async function run() { ]); // Test 3: Error handling - // try { - // const errorModel = await initChatModel('error-model', { - // modelProvider: 'openai', - // configuration: { - // baseURL: baseUrl, - // }, - // }); - // await errorModel.invoke('This will fail'); - // } catch { - // // Expected error - // } + // try { + // const errorModel = await initChatModel('error-model', { + // modelProvider: 'openai', + // configuration: { + // baseURL: baseUrl, + // }, + // }); + // await errorModel.invoke('This will fail'); + // } catch { + // // Expected error + // } }); await Sentry.flush(2000);