@@ -135,13 +135,19 @@ steps:
135135 client := & MockPipelinesClient {
136136 CreateFunc : func (ctx context.Context , org string , p buildkite.CreatePipeline ) (buildkite.Pipeline , * buildkite.Response , error ) {
137137
138+ // validate required fields
139+ assert .Equal ("org" , org )
140+ assert .Equal ("cluster-123" , p .ClusterID )
141+ assert .Equal ("Test Pipeline" , p .Name )
142+ assert .Equal ("https://example.com/repo.git" , p .Repository )
143+
138144 assert .Equal (testPipelineDefinition , p .Configuration )
139145
140146 return buildkite.Pipeline {
141147 ID : "123" ,
142148 Slug : "test-pipeline" ,
143149 Name : "Test Pipeline" ,
144- ClusterID : "abc -123" ,
150+ ClusterID : "cluster -123" ,
145151 CreatedAt : & buildkite.Timestamp {},
146152 Tags : []string {"tag1" , "tag2" },
147153 }, & buildkite.Response {
@@ -156,16 +162,12 @@ steps:
156162 assert .NotNil (tool )
157163 assert .NotNil (handler )
158164
159- request := createMCPRequest (t , map [string ]any {
160- "org" : "org" ,
161- "name" : "Test Pipeline" ,
162- "repository_url" : "https://example.com/repo.git" ,
163- })
165+ request := createMCPRequest (t , map [string ]any {})
164166
165167 args := CreatePipelineArgs {
166168 OrgSlug : "org" ,
167169 Name : "Test Pipeline" ,
168- ClusterID : "abc -123" ,
170+ ClusterID : "cluster -123" ,
169171 RepositoryURL : "https://example.com/repo.git" ,
170172 Description : "A test pipeline" ,
171173 Configuration : testPipelineDefinition ,
@@ -175,7 +177,7 @@ steps:
175177 result , err := handler (ctx , request , args )
176178 assert .NoError (err )
177179 textContent := getTextResult (t , result )
178- assert .Equal (`{"id":"123","name":"Test Pipeline","slug":"test-pipeline","created_at":"0001-01-01T00:00:00Z","skip_queued_branch_builds":false,"cancel_running_branch_builds":false,"cluster_id":"abc -123","tags":["tag1","tag2"],"provider":{"id":"","webhook_url":"","settings":null}}` , textContent .Text )
180+ assert .Equal (`{"id":"123","name":"Test Pipeline","slug":"test-pipeline","created_at":"0001-01-01T00:00:00Z","skip_queued_branch_builds":false,"cancel_running_branch_builds":false,"cluster_id":"cluster -123","tags":["tag1","tag2"],"provider":{"id":"","webhook_url":"","settings":null}}` , textContent .Text )
179181}
180182
181183func TestUpdatePipeline (t * testing.T ) {
@@ -194,6 +196,10 @@ steps:
194196 client := & MockPipelinesClient {
195197 UpdateFunc : func (ctx context.Context , org string , pipeline string , p buildkite.UpdatePipeline ) (buildkite.Pipeline , * buildkite.Response , error ) {
196198
199+ // validate required fields
200+ assert .Equal ("org" , org )
201+ assert .Equal ("test-pipeline" , pipeline )
202+
197203 assert .Equal (testPipelineDefinition , p .Configuration )
198204
199205 return buildkite.Pipeline {
@@ -214,10 +220,9 @@ steps:
214220 tool , handler := UpdatePipeline (ctx , client )
215221 assert .NotNil (tool )
216222 assert .NotNil (handler )
217- request := createMCPRequest (t , map [string ]any {
218- "org" : "org" ,
219- "pipeline_slug" : "test-pipeline" ,
220- })
223+
224+ request := createMCPRequest (t , map [string ]any {})
225+
221226 args := UpdatePipelineArgs {
222227 OrgSlug : "org" ,
223228 PipelineSlug : "test-pipeline" ,
0 commit comments