Adding cf/agents tests (#11)
* Cloning demo repo * added test for agents/mcp --------- Co-authored-by: Glen Maddern <glen@glenmaddern.com>
This commit is contained in:
parent
ace3220fca
commit
7f019fed7f
1 changed files with 10420 additions and 10 deletions
|
|
@ -18,18 +18,21 @@ function getMCPServers() {
|
|||
throw new Error('hono-mcp port not found in test state')
|
||||
}
|
||||
|
||||
if (!state.cfAgentsPort) {
|
||||
throw new Error('cf-agents port not found in test state')
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
name: 'hono-mcp',
|
||||
url: `http://localhost:${state.honoPort}/mcp`,
|
||||
expectedTools: 1, // Minimum expected tools count
|
||||
},
|
||||
// Add more servers here as they become available
|
||||
// {
|
||||
// name: 'another-server',
|
||||
// url: 'http://localhost:9902/mcp',
|
||||
// expectedTools: 1,
|
||||
// },
|
||||
{
|
||||
name: 'cf-agents',
|
||||
url: `http://localhost:${state.cfAgentsPort}/mcp`,
|
||||
expectedTools: 1, // Minimum expected tools count
|
||||
},
|
||||
]
|
||||
} catch (error) {
|
||||
throw new Error(`Test environment not properly initialized: ${error}`)
|
||||
|
|
@ -161,6 +164,15 @@ describe('MCP Connection Integration Tests', () => {
|
|||
// Ignore errors - process might already be dead
|
||||
}
|
||||
|
||||
try {
|
||||
if (state?.cfAgentsServer && !state.cfAgentsServer.killed) {
|
||||
console.log('🔥 Force cleanup cf-agents server...')
|
||||
state.cfAgentsServer.kill('SIGKILL')
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore errors - process might already be dead
|
||||
}
|
||||
|
||||
try {
|
||||
if (state?.staticServer) {
|
||||
state.staticServer.close()
|
||||
|
|
|
|||
Loading…
Reference in a new issue