@@ -25,7 +25,7 @@ import (
2525
2626// TestServer verifies basic MCP functionality with both stdio and http transports.
2727// Both transports run in stateful mode (ListChanged enabled) and test:
28- // - Tool calls (unhealthyApplications, unhealthyApplicationResources )
28+ // - Tool calls (argocd_list_unhealthy_applications, argocd_list_unhealthy_application_resources )
2929// - Error handling (argocd-error, unreachable scenarios)
3030// - Metrics collection (for http transport)
3131// - Session reuse across multiple tool calls
@@ -57,22 +57,22 @@ func TestStatefulServer(t *testing.T) {
5757 session := td .init (t )
5858 defer session .Close ()
5959
60- t .Run ("call/unhealthyApplications /ok" , func (t * testing.T ) {
60+ t .Run ("call/argocd_list_unhealthy_applications /ok" , func (t * testing.T ) {
6161 // get the metrics before the call
6262 var mcpCallsTotalMetricBefore int64
6363 var mcpCallsDurationSecondsInfBucketBefore int64
6464 if td .name == "http" {
6565 mcpCallsTotalMetricBefore , mcpCallsDurationSecondsInfBucketBefore = getMetrics (t , "http://localhost:50081" , map [string ]string {
6666 "server" : "argocd-mcp-server" ,
6767 "method" : "tools/call" ,
68- "name" : "unhealthyApplications " ,
68+ "name" : "argocd_list_unhealthy_applications " ,
6969 "success" : "true" ,
7070 })
7171 }
7272
7373 // when
7474 result , err := session .CallTool (context .Background (), & mcp.CallToolParams {
75- Name : "unhealthyApplications " ,
75+ Name : "argocd_list_unhealthy_applications " ,
7676 })
7777
7878 // then
@@ -102,7 +102,7 @@ func TestStatefulServer(t *testing.T) {
102102 mcpCallsTotalMetricAfter , mcpCallsDurationSecondsInfBucketAfter := getMetrics (t , "http://localhost:50081" , map [string ]string {
103103 "server" : "argocd-mcp-server" ,
104104 "method" : "tools/call" ,
105- "name" : "unhealthyApplications " ,
105+ "name" : "argocd_list_unhealthy_applications " ,
106106 "success" : "true" ,
107107 })
108108 assert .Equal (t , mcpCallsTotalMetricBefore + 1 , mcpCallsTotalMetricAfter )
@@ -111,21 +111,21 @@ func TestStatefulServer(t *testing.T) {
111111
112112 })
113113
114- t .Run ("call/unhealthyApplicationResources /ok" , func (t * testing.T ) {
114+ t .Run ("call/argocd_list_unhealthy_application_resources /ok" , func (t * testing.T ) {
115115 var mcpCallsTotalMetricBefore int64
116116 var mcpCallsDurationSecondsInfBucketBefore int64
117117 if td .name == "http" {
118118 mcpCallsTotalMetricBefore , mcpCallsDurationSecondsInfBucketBefore = getMetrics (t , "http://localhost:50081" , map [string ]string {
119119 "server" : "argocd-mcp-server" ,
120120 "method" : "tools/call" ,
121- "name" : "unhealthyApplicationResources " ,
121+ "name" : "argocd_list_unhealthy_application_resources " ,
122122 "success" : "true" ,
123123 })
124124 }
125125
126126 // when
127127 result , err := session .CallTool (context .Background (), & mcp.CallToolParams {
128- Name : "unhealthyApplicationResources " ,
128+ Name : "argocd_list_unhealthy_application_resources " ,
129129 Arguments : map [string ]any {
130130 "name" : "example" ,
131131 },
@@ -186,29 +186,29 @@ func TestStatefulServer(t *testing.T) {
186186 mcpCallsTotalMetricAfter , mcpCallsDurationSecondsInfBucketAfter := getMetrics (t , "http://localhost:50081" , map [string ]string {
187187 "server" : "argocd-mcp-server" ,
188188 "method" : "tools/call" ,
189- "name" : "unhealthyApplicationResources " ,
189+ "name" : "argocd_list_unhealthy_application_resources " ,
190190 "success" : "true" ,
191191 })
192192 assert .Equal (t , mcpCallsTotalMetricBefore + 1 , mcpCallsTotalMetricAfter )
193193 assert .Equal (t , mcpCallsDurationSecondsInfBucketBefore + 1 , mcpCallsDurationSecondsInfBucketAfter )
194194 }
195195 })
196196
197- t .Run ("call/unhealthyApplicationResources /argocd-error" , func (t * testing.T ) {
197+ t .Run ("call/argocd_list_unhealthy_application_resources /argocd-error" , func (t * testing.T ) {
198198 var mcpCallsTotalMetricBefore int64
199199 var mcpCallsDurationSecondsInfBucketBefore int64
200200 if td .name == "http" {
201201 mcpCallsTotalMetricBefore , mcpCallsDurationSecondsInfBucketBefore = getMetrics (t , "http://localhost:50081" , map [string ]string {
202202 "server" : "argocd-mcp-server" ,
203203 "method" : "tools/call" ,
204- "name" : "unhealthyApplicationResources " ,
204+ "name" : "argocd_list_unhealthy_application_resources " ,
205205 "success" : "false" ,
206206 })
207207 }
208208
209209 // when
210210 result , err := session .CallTool (context .Background (), & mcp.CallToolParams {
211- Name : "unhealthyApplicationResources " ,
211+ Name : "argocd_list_unhealthy_application_resources " ,
212212 Arguments : map [string ]any {
213213 "name" : "example-error" ,
214214 },
@@ -222,7 +222,7 @@ func TestStatefulServer(t *testing.T) {
222222 mcpCallsTotalMetricAfter , mcpCallsDurationSecondsInfBucketAfter := getMetrics (t , "http://localhost:50081" , map [string ]string {
223223 "server" : "argocd-mcp-server" ,
224224 "method" : "tools/call" ,
225- "name" : "unhealthyApplicationResources " ,
225+ "name" : "argocd_list_unhealthy_application_resources " ,
226226 "success" : "false" ,
227227 })
228228 assert .Equal (t , mcpCallsTotalMetricBefore + 1 , mcpCallsTotalMetricAfter )
@@ -262,10 +262,10 @@ func TestStatefulServer(t *testing.T) {
262262 // given
263263 session := td .init (t )
264264 defer session .Close ()
265- t .Run ("call/unhealthyApplications /argocd-unreachable" , func (t * testing.T ) {
265+ t .Run ("call/argocd_list_unhealthy_applications /argocd-unreachable" , func (t * testing.T ) {
266266 // when
267267 result , err := session .CallTool (context .Background (), & mcp.CallToolParams {
268- Name : "unhealthyApplications " ,
268+ Name : "argocd_list_unhealthy_applications " ,
269269 })
270270
271271 // then
@@ -306,7 +306,7 @@ func TestStatelessServer(t *testing.T) {
306306
307307 // Step 4: Verify tools work correctly with content validation
308308 result , callErr := session .CallTool (ctx , & mcp.CallToolParams {
309- Name : "unhealthyApplications " ,
309+ Name : "argocd_list_unhealthy_applications " ,
310310 })
311311 require .NoError (t , callErr )
312312 require .False (t , result .IsError , "tool call should succeed" )
0 commit comments