Skip to content

Commit 744219f

Browse files
author
LittleCoinCoin
committed
test(kiro): implement test data infrastructure for Kiro MCP integration
- Extend MCPHostConfigTestDataLoader with load_kiro_mcp_config() method - Add _create_kiro_mcp_config() template generator for Kiro configurations - Create test configuration files: * kiro_mcp.json: Empty configuration baseline * kiro_mcp_with_server.json: Single server with all Kiro-specific fields * kiro_mcp_complex.json: Multi-server with mixed local/remote configs - Add Kiro templates to _create_host_config_template() for consistency - Support both local (command/args) and remote (url/headers) server types - Include realistic Kiro field values (auggie command, codebase-retrieval tool) Test data follows established patterns from existing MCP host implementations and provides comprehensive coverage for model validation, CLI integration, and strategy operation tests.
1 parent 23c1e9d commit 744219f

File tree

5 files changed

+150
-0
lines changed

5 files changed

+150
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mcpServers": {}
3+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"mcpServers": {
3+
"local-server": {
4+
"command": "auggie",
5+
"args": ["--mcp"],
6+
"disabled": false,
7+
"autoApprove": ["codebase-retrieval"]
8+
},
9+
"remote-server": {
10+
"url": "https://api.example.com/mcp",
11+
"headers": {
12+
"Authorization": "Bearer token"
13+
},
14+
"disabled": true,
15+
"disabledTools": ["risky-tool"]
16+
}
17+
},
18+
"otherSettings": {
19+
"theme": "dark",
20+
"fontSize": 14
21+
}
22+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mcpServers": {}
3+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"mcpServers": {
3+
"existing-server": {
4+
"command": "auggie",
5+
"args": ["--mcp", "-m", "default", "-w", "."],
6+
"env": {
7+
"DEBUG": "true"
8+
},
9+
"disabled": false,
10+
"autoApprove": ["codebase-retrieval", "fetch"],
11+
"disabledTools": ["dangerous-tool"]
12+
}
13+
}
14+
}

tests/test_data_utils.py

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,25 @@ def load_mcp_server_config(self, server_type: str = "local") -> Dict[str, Any]:
292292
with open(config_path, 'r') as f:
293293
return json.load(f)
294294

295+
def load_kiro_mcp_config(self, config_type: str = "empty") -> Dict[str, Any]:
296+
"""Load Kiro-specific MCP configuration templates.
297+
298+
Args:
299+
config_type: Type of Kiro configuration to load
300+
- "empty": Empty mcpServers configuration
301+
- "with_server": Single server with all Kiro fields
302+
- "complex": Multi-server with mixed configurations
303+
304+
Returns:
305+
Kiro MCP configuration dictionary
306+
"""
307+
config_path = self.mcp_host_configs_dir / f"kiro_mcp_{config_type}.json"
308+
if not config_path.exists():
309+
self._create_kiro_mcp_config(config_type)
310+
311+
with open(config_path, 'r') as f:
312+
return json.load(f)
313+
295314
def _create_host_config_template(self, host_type: str, config_type: str):
296315
"""Create host-specific configuration templates with inheritance patterns."""
297316
templates = {
@@ -364,6 +383,50 @@ def _create_host_config_template(self, host_type: str, config_type: str):
364383
"args": ["server.py"]
365384
}
366385
}
386+
},
387+
388+
# Kiro family templates
389+
"kiro_simple": {
390+
"mcpServers": {
391+
"test_server": {
392+
"command": "auggie",
393+
"args": ["--mcp"],
394+
"disabled": False,
395+
"autoApprove": ["codebase-retrieval"]
396+
}
397+
}
398+
},
399+
"kiro_with_server": {
400+
"mcpServers": {
401+
"existing-server": {
402+
"command": "auggie",
403+
"args": ["--mcp", "-m", "default", "-w", "."],
404+
"env": {"DEBUG": "true"},
405+
"disabled": False,
406+
"autoApprove": ["codebase-retrieval", "fetch"],
407+
"disabledTools": ["dangerous-tool"]
408+
}
409+
}
410+
},
411+
"kiro_complex": {
412+
"mcpServers": {
413+
"local-server": {
414+
"command": "auggie",
415+
"args": ["--mcp"],
416+
"disabled": False,
417+
"autoApprove": ["codebase-retrieval"]
418+
},
419+
"remote-server": {
420+
"url": "https://api.example.com/mcp",
421+
"headers": {"Authorization": "Bearer token"},
422+
"disabled": True,
423+
"disabledTools": ["risky-tool"]
424+
}
425+
},
426+
"otherSettings": {
427+
"theme": "dark",
428+
"fontSize": 14
429+
}
367430
}
368431
}
369432

@@ -470,3 +533,48 @@ def _create_mcp_server_config(self, server_type: str):
470533
config_path = self.mcp_host_configs_dir / f"mcp_server_{server_type}.json"
471534
with open(config_path, 'w') as f:
472535
json.dump(config, f, indent=2)
536+
537+
def _create_kiro_mcp_config(self, config_type: str):
538+
"""Create Kiro-specific MCP configuration templates."""
539+
templates = {
540+
"empty": {
541+
"mcpServers": {}
542+
},
543+
"with_server": {
544+
"mcpServers": {
545+
"existing-server": {
546+
"command": "auggie",
547+
"args": ["--mcp", "-m", "default", "-w", "."],
548+
"env": {"DEBUG": "true"},
549+
"disabled": False,
550+
"autoApprove": ["codebase-retrieval", "fetch"],
551+
"disabledTools": ["dangerous-tool"]
552+
}
553+
}
554+
},
555+
"complex": {
556+
"mcpServers": {
557+
"local-server": {
558+
"command": "auggie",
559+
"args": ["--mcp"],
560+
"disabled": False,
561+
"autoApprove": ["codebase-retrieval"]
562+
},
563+
"remote-server": {
564+
"url": "https://api.example.com/mcp",
565+
"headers": {"Authorization": "Bearer token"},
566+
"disabled": True,
567+
"disabledTools": ["risky-tool"]
568+
}
569+
},
570+
"otherSettings": {
571+
"theme": "dark",
572+
"fontSize": 14
573+
}
574+
}
575+
}
576+
577+
config = templates.get(config_type, {"mcpServers": {}})
578+
config_path = self.mcp_host_configs_dir / f"kiro_mcp_{config_type}.json"
579+
with open(config_path, 'w') as f:
580+
json.dump(config, f, indent=2)

0 commit comments

Comments
 (0)