Repository navigation
test(mcp): drop two tests that others already cover - #323
Merged
Merged
Conversation
An audit of the MCP and tool-policy tests found two tests that protect nothing another test does not, each checked by breaking the code they cover: - McpConnection's "returns needs_sign_in for an unauthorized oauth server without opening a browser" had no browser in its fixture, so its title's promise is only asserted by "never opens a browser for background OAuth connections". - ToolAuthorizationBroker's "stores a blocked MCP tool call as an integration rule" fails only for bugs that "remembers an always-allowed MCP tool through its integration and never over a Block rule" and the risk mode test also catch. "discards sign-in results when the connection changed during the flow" looked like a third, but it is the only test of the error shown when a change interrupts a sign-in before it reaches the server. It stays, with a title that says so.
gustmrg
force-pushed
the
test/drop-duplicated-mcp-tool-tests
branch
from
October 31, 2026 19:21
43cba5d to
fcc491c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An audit of the MCP and tool-policy tests listed every test next to the behavior it protects. Two tests protected nothing another test does not, so they are removed. A first version of this PR removed two more, but breaking the code they cover showed each was the only test catching a real bug, so they stay. Nothing else changes.
tests/mcp-bridge.test.ts: removed"returns needs_sign_in for an unauthorized oauth server without opening a browser". Its fixture (provider: {}) cannot open a browser, so its title's promise is only asserted by"never opens a browser for background OAuth connections".tests/tool-authorization-broker.test.ts: removed"stores a blocked MCP tool call as an integration rule". Givingintegration_callblocks the wrong scope inblockCategorystill fails two kept tests.tests/mcp-service.test.ts: renamed"discards sign-in results when the connection changed during the flow"to"says the connection changed when that interrupts its sign-in before it reaches the server". It does not reach the commit re-check: it is the only test ofsignInFailurenaming the change instead of reporting a bare cancellation.tests/mcp-service.test.ts: kept"discards credentials exchanged for a connection that was removed before they were committed". It is the only test of thenot_foundbranch at commit, and of a removed connection's credentials being deleted whenremove()fails to do it.Testing
npm run lint: clean (two pre-existing warnings insrc/components/storage-*.tsx, untouched).npm run format:check,npm run typecheck(all four tsconfigs), andnpm run build: clean.npm teston Node 22: 2437 passed. The earlier note about 19 failures from this machine's SSH keys was wrong: they appear only on Node 26, and the three SSH test files pass on Node 22.Not in this PR
Two gaps this audit found are covered in a separate PR,
test(mcp): cover revoking access and deleting secrets for a connection.