Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(ci): warm the mcp metrics test catalog once (#127597)

posthog[bot]9bddd5cb4cb3
diff --git a/services/mcp/tests/hono/tool-executor-metrics.test.ts b/services/mcp/tests/hono/tool-executor-metrics.test.ts
index 350e18f22907..dd660ddf1706 100644
--- a/services/mcp/tests/hono/tool-executor-metrics.test.ts
+++ b/services/mcp/tests/hono/tool-executor-metrics.test.ts
@@ -1,4 +1,4 @@
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'
const { mockToolCallsInc, mockToolDurationObserve, mockToolDurationStartTimer, mockToolErrorsInc } = vi.hoisted(() => {
const mockStop = vi.fn()
@@ -97,7 +97,12 @@ describe('ToolExecutor metrics', () => {
let catalog: ToolCatalog
let executor: ToolExecutor
- beforeEach(async () => {
+ beforeAll(async () => {
+ catalog = new ToolCatalog()
+ await catalog.warmup()
+ })
+
+ beforeEach(() => {
mockToolCallsInc.mockClear()
mockToolDurationObserve.mockClear()
mockToolDurationStartTimer.mockClear()
@@ -106,8 +111,6 @@ describe('ToolExecutor metrics', () => {
vi.mocked(trackExecuteSqlGeneration).mockClear()
vi.mocked(trackToolSpan).mockClear()
- catalog = new ToolCatalog()
- await catalog.warmup()
executor = new ToolExecutor(catalog, new InstructionsBuilder(''))
})