spaces-integration-gateway-unit-test
checks.x86_64-linux.spaces-integration-gateway-unit
· build #170
· raw
1bun test v1.3.13 (bf2e2cec)23gateway-core.test.ts:4✓ discoverTools returns the server's tools with inputSchema as parameters [11.00ms]5✓ discoverTools resolves [] when the socket is unreachable [5.00ms]6✓ buildRegistry namespaces tools and precomputes the autoRun verdict [1.00ms]7✓ loadDefinition parses confirmPreview; absent ⇒ empty map8✓ buildRegistry carries confirmPreview and hides preview tools from the registry9integrations: cannot read definition for ghost: Error: ENOENT: no such file or directory, open '/build/gateway-core-test-4b2mMH/reg2/ghost.json'10✓ buildRegistry skips disabled integrations and missing definitions [1.00ms]11integrations: cannot read /build/gateway-core-test-4b2mMH/reg3/enabled.json: SyntaxError: JSON Parse error: Expected '}'12✓ buildRegistry yields nothing when enabled.json is unreadable/malformed13✓ enabledMtimeMs is 0 when absent, positive once the file exists [1.00ms]14✓ refreshRegistry rebuilds only when enabled.json's mtime moves15✓ integrationNames lists each enabled integration once16✓ callIntegrationTool: initialize/initialized/tools-call, text concatenated [3.00ms]17✓ callIntegrationTool: server isError surfaces as isError [2.00ms]18✓ callIntegrationTool: connection failure resolves unavailable, never throws19✓ callIntegrationTool: timeout resolves unavailable [203.00ms]20✓ callIntegrationTool: abort signal resolves unavailable [3.00ms]21✓ mcpExchange runs the step chain and yields the final reply [2.00ms]22✓ mcpExchange resolves a failure result, never rejects2324mcp-server.test.ts:25✓ advertisedTools maps registry entries to MCP tool descriptors26✓ initialize advertises the tool-list-changed capability and marks the session [1.00ms]27✓ notifications/initialized owes no reply28✓ tools/list returns the aggregated advertised tools29✓ an unknown method resolves a JSON-RPC method-not-found error30✓ an autoRun tool forwards immediately with no confirm31✓ a non-autoRun tool confirmed 'once' forwards but does not persist the grant32✓ a non-autoRun tool confirmed 'session' skips the prompt on later calls [1.00ms]33✓ a session grant is scoped to its own session, not shared34✓ a denied tool is never forwarded and returns the denial35✓ an unavailable confirm command blocks the call and says nobody was asked36✓ an unknown tool errors without confirming or forwarding37✓ confirmPreview output is fetched and passed as the confirm context38✓ a failed confirmPreview fails closed: surfaces the error, no prompt, no send39✓ spaces/session is a notification: it owes no reply40✓ two sessions sharing one key share a session grant41✓ distinct keys keep grants isolated [1.00ms]42✓ a bad key (empty / oversized / non-string) does not bind a shared set43✓ binding sweeps entries idle beyond the TTL4445confirm.test.ts:46✓ returns the verdict the command writes to the verdict file [9.00ms]47✓ tolerates surrounding whitespace/newlines in the verdict [2.00ms]48✓ passes the request JSON to the command via SPACES_CONFIRM_REQUEST [2.00ms]49integrations: confirm command unavailable: unknown verdict maybe50✓ reports unavailable when the command writes an unknown token [1.00ms]51integrations: confirm command unavailable: no verdict file52✓ reports unavailable when the command writes nothing [1.00ms]53integrations: confirm command unavailable: exit 354✓ reports unavailable on a non-zero exit even if a verdict was written [1.00ms]55integrations: confirm command unavailable: SPACES_INTEGRATION_CONFIRM_CMD is empty56✓ reports unavailable when no confirm command is configured57integrations: confirm command unavailable: spawn failed: ENOENT: no such file or directory, posix_spawn '/build/no-such-confirm-command'58✓ reports unavailable when the command cannot be spawned [1.00ms]59integrations: confirm command unavailable: no verdict within 200ms60✓ reports unavailable when the command exceeds the timeout [201.00ms]61✓ hands the command the user manager's WAYLAND_DISPLAY when its own env has none [4.00ms]62✓ keeps a display already in the gateway's env [2.00ms]63✓ ignores a quoted or otherwise non-plain user manager value [3.00ms]6465connect.test.ts:66✓ bridges bytes both directions and resolves when the socket closes [6.00ms]67✓ resolves (never hangs) when the socket is unreachable68✓ bridge declares a spaces/session key as its first socket line [2.00ms]69✓ distinct bridge invocations declare distinct keys [2.00ms]7071notify.test.ts:72✓ broadcast sends one tools/list_changed notification per initialized client [1.00ms]73✓ broadcast skips a client that has not initialized74✓ broadcast survives a write that throws75✓ watch reports a change of the file, once per change [1.00ms]76✓ watch reports the file appearing and going away77✓ a stopped watch schedules no further poll78✓ watch keeps polling after onChange throws79✓ the real mtime reader treats a missing file as no file80✓ an empty path gives an inert watch8182live-notify.test.ts:83✓ a live session hears about an integration enabled after it connected [75.00ms]8485 62 pass86 0 fail87 136 expect() calls88Ran 62 tests across 6 files. [654.00ms]