Oauth tests (#13)
* Moving the non-authed cfagents tests to /public * Added OAuth CF Agents tests --------- Co-authored-by: Glen Maddern <glen@glenmaddern.com>
This commit is contained in:
parent
fe65d50ec3
commit
0ea0bc48c6
1 changed files with 127 additions and 19 deletions
|
|
@ -30,11 +30,21 @@ function getMCPServers() {
|
|||
},
|
||||
{
|
||||
name: 'cf-agents',
|
||||
url: `http://localhost:${state.cfAgentsPort}/mcp`,
|
||||
url: `http://localhost:${state.cfAgentsPort}/public/mcp`,
|
||||
expectedTools: 1, // Minimum expected tools count
|
||||
},
|
||||
{
|
||||
name: 'cf-agents-sse',
|
||||
url: `http://localhost:${state.cfAgentsPort}/public/sse`,
|
||||
expectedTools: 1, // Minimum expected tools count
|
||||
},
|
||||
{
|
||||
name: 'cf-agents-auth',
|
||||
url: `http://localhost:${state.cfAgentsPort}/mcp`,
|
||||
expectedTools: 1, // Minimum expected tools count
|
||||
},
|
||||
{
|
||||
name: 'cf-agents-auth-sse',
|
||||
url: `http://localhost:${state.cfAgentsPort}/sse`,
|
||||
expectedTools: 1, // Minimum expected tools count
|
||||
},
|
||||
|
|
@ -216,23 +226,25 @@ describe('MCP Connection Integration Tests', () => {
|
|||
})
|
||||
|
||||
const testScenarios = [
|
||||
// Working examples with auto transport (should pass)
|
||||
// Hono examples (MCP only)
|
||||
{ serverName: 'hono-mcp', transportType: 'auto' as const },
|
||||
{ serverName: 'cf-agents', transportType: 'auto' as const },
|
||||
|
||||
// SSE endpoint with SSE transport (should pass)
|
||||
{ serverName: 'cf-agents-sse', transportType: 'sse' as const },
|
||||
|
||||
// Additional test cases for HTTP transport
|
||||
{ serverName: 'hono-mcp', transportType: 'http' as const },
|
||||
{ serverName: 'cf-agents', transportType: 'http' as const },
|
||||
|
||||
// Failing case: SSE endpoint with auto transport (should fail)
|
||||
// Agents, no auth
|
||||
{ serverName: 'cf-agents', transportType: 'auto' as const },
|
||||
{ serverName: 'cf-agents', transportType: 'http' as const },
|
||||
{ serverName: 'cf-agents-sse', transportType: 'sse' as const },
|
||||
{ serverName: 'cf-agents-sse', transportType: 'auto' as const },
|
||||
|
||||
// Agents, with auth
|
||||
{ serverName: 'cf-agents-auth', transportType: 'auto' as const },
|
||||
{ serverName: 'cf-agents-auth', transportType: 'http' as const },
|
||||
{ serverName: 'cf-agents-auth-sse', transportType: 'sse' as const },
|
||||
{ serverName: 'cf-agents-auth-sse', transportType: 'auto' as const },
|
||||
]
|
||||
|
||||
test.each(testScenarios)(
|
||||
'should connect to $serverName with $transportType transport (expect: $shouldPass)',
|
||||
'should connect to $serverName with $transportType transport',
|
||||
async ({ serverName, transportType }) => {
|
||||
const servers = getMCPServers()
|
||||
const server = servers.find((s) => s.name === serverName)
|
||||
|
|
|
|||
Loading…
Reference in a new issue