Refactor MCP server configuration structure in E2E tests and agent management
- Change the MCP server configuration from a map to a slice in both the E2E test helper functions and the agent management code, improving consistency in data representation. - Update the test cases to reflect the new server structure, ensuring compatibility with the modified MCP configuration.
This commit is contained in:
parent
38abd0e95b
commit
b4a9132dae
3 changed files with 14 additions and 14 deletions
|
|
@ -583,9 +583,9 @@ func TestScanDependencies(t *testing.T) {
|
||||||
os.WriteFile(filepath.Join(assistantDir, "package.yao"), []byte(`{
|
os.WriteFile(filepath.Join(assistantDir, "package.yao"), []byte(`{
|
||||||
"name":"test-scan",
|
"name":"test-scan",
|
||||||
"mcp": {
|
"mcp": {
|
||||||
"servers": {
|
"servers": [
|
||||||
"rag": {"server_id": "yao.rag-tools"}
|
{"server_id": "yao.rag-tools"}
|
||||||
}
|
]
|
||||||
}
|
}
|
||||||
}`), 0644)
|
}`), 0644)
|
||||||
|
|
||||||
|
|
@ -610,9 +610,9 @@ func TestScanDependenciesSkipUnscoped(t *testing.T) {
|
||||||
os.WriteFile(filepath.Join(assistantDir, "package.yao"), []byte(`{
|
os.WriteFile(filepath.Join(assistantDir, "package.yao"), []byte(`{
|
||||||
"name":"test-local",
|
"name":"test-local",
|
||||||
"mcp": {
|
"mcp": {
|
||||||
"servers": {
|
"servers": [
|
||||||
"echo": {"server_id": "echo"}
|
{"server_id": "echo"}
|
||||||
}
|
]
|
||||||
}
|
}
|
||||||
}`), 0644)
|
}`), 0644)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ type packageYao struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type mcpConfig struct {
|
type mcpConfig struct {
|
||||||
Servers map[string]mcpServerEntry `json:"servers,omitempty"`
|
Servers []mcpServerEntry `json:"servers,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type mcpServerEntry struct {
|
type mcpServerEntry struct {
|
||||||
|
|
|
||||||
|
|
@ -178,9 +178,9 @@ func buildV2AgentApp(t *testing.T) string {
|
||||||
"options": { "temperature": 0.5 },
|
"options": { "temperature": 0.5 },
|
||||||
"public": false,
|
"public": false,
|
||||||
"mcp": {
|
"mcp": {
|
||||||
"servers": {
|
"servers": [
|
||||||
"registry-mcp": { "server_id": "`+testScope+`.registry-mcp" }
|
{ "server_id": "`+testScope+`.registry-mcp" }
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tags": ["Test", "Registry", "V2"],
|
"tags": ["Test", "Registry", "V2"],
|
||||||
"sort": 999,
|
"sort": 999,
|
||||||
|
|
@ -309,10 +309,10 @@ func buildV2AnalyticsApp(t *testing.T) string {
|
||||||
"options": { "temperature": 0.2 },
|
"options": { "temperature": 0.2 },
|
||||||
"public": false,
|
"public": false,
|
||||||
"mcp": {
|
"mcp": {
|
||||||
"servers": {
|
"servers": [
|
||||||
"registry-mcp": { "server_id": "`+testScope+`.registry-mcp" },
|
{ "server_id": "`+testScope+`.registry-mcp" },
|
||||||
"data-tools": { "server_id": "`+testScope+`.data-tools" }
|
{ "server_id": "`+testScope+`.data-tools" }
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"tags": ["Test", "Registry", "Analytics", "V2"],
|
"tags": ["Test", "Registry", "Analytics", "V2"],
|
||||||
"sort": 998,
|
"sort": 998,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue