@@ -1350,3 +1350,93 @@ func Test_MemoryUsage_SlidingWindow_vs_NoWindow(t *testing.T) {
13501350 t .Logf ("Sliding window: %s" , profile1 .String ())
13511351 t .Logf ("No window: %s" , profile2 .String ())
13521352}
1353+
1354+ func Test_ListWorkflowRuns (t * testing.T ) {
1355+ // Verify tool definition once
1356+ mockClient := github .NewClient (nil )
1357+ tool , _ := ListWorkflowRuns (stubGetClientFn (mockClient ), translations .NullTranslationHelper )
1358+ require .NoError (t , toolsnaps .Test (tool .Name , tool ))
1359+
1360+ assert .Equal (t , "list_workflow_runs" , tool .Name )
1361+ assert .NotEmpty (t , tool .Description )
1362+ inputSchema := tool .InputSchema .(* jsonschema.Schema )
1363+ assert .Contains (t , inputSchema .Properties , "owner" )
1364+ assert .Contains (t , inputSchema .Properties , "repo" )
1365+ assert .Contains (t , inputSchema .Properties , "workflow_id" )
1366+ assert .ElementsMatch (t , inputSchema .Required , []string {"owner" , "repo" , "workflow_id" })
1367+ }
1368+
1369+ func Test_GetWorkflowRun (t * testing.T ) {
1370+ // Verify tool definition once
1371+ mockClient := github .NewClient (nil )
1372+ tool , _ := GetWorkflowRun (stubGetClientFn (mockClient ), translations .NullTranslationHelper )
1373+ require .NoError (t , toolsnaps .Test (tool .Name , tool ))
1374+
1375+ assert .Equal (t , "get_workflow_run" , tool .Name )
1376+ assert .NotEmpty (t , tool .Description )
1377+ inputSchema := tool .InputSchema .(* jsonschema.Schema )
1378+ assert .Contains (t , inputSchema .Properties , "owner" )
1379+ assert .Contains (t , inputSchema .Properties , "repo" )
1380+ assert .Contains (t , inputSchema .Properties , "run_id" )
1381+ assert .ElementsMatch (t , inputSchema .Required , []string {"owner" , "repo" , "run_id" })
1382+ }
1383+
1384+ func Test_GetWorkflowRunLogs (t * testing.T ) {
1385+ // Verify tool definition once
1386+ mockClient := github .NewClient (nil )
1387+ tool , _ := GetWorkflowRunLogs (stubGetClientFn (mockClient ), translations .NullTranslationHelper )
1388+ require .NoError (t , toolsnaps .Test (tool .Name , tool ))
1389+
1390+ assert .Equal (t , "get_workflow_run_logs" , tool .Name )
1391+ assert .NotEmpty (t , tool .Description )
1392+ inputSchema := tool .InputSchema .(* jsonschema.Schema )
1393+ assert .Contains (t , inputSchema .Properties , "owner" )
1394+ assert .Contains (t , inputSchema .Properties , "repo" )
1395+ assert .Contains (t , inputSchema .Properties , "run_id" )
1396+ assert .ElementsMatch (t , inputSchema .Required , []string {"owner" , "repo" , "run_id" })
1397+ }
1398+
1399+ func Test_ListWorkflowJobs (t * testing.T ) {
1400+ // Verify tool definition once
1401+ mockClient := github .NewClient (nil )
1402+ tool , _ := ListWorkflowJobs (stubGetClientFn (mockClient ), translations .NullTranslationHelper )
1403+ require .NoError (t , toolsnaps .Test (tool .Name , tool ))
1404+
1405+ assert .Equal (t , "list_workflow_jobs" , tool .Name )
1406+ assert .NotEmpty (t , tool .Description )
1407+ inputSchema := tool .InputSchema .(* jsonschema.Schema )
1408+ assert .Contains (t , inputSchema .Properties , "owner" )
1409+ assert .Contains (t , inputSchema .Properties , "repo" )
1410+ assert .Contains (t , inputSchema .Properties , "run_id" )
1411+ assert .ElementsMatch (t , inputSchema .Required , []string {"owner" , "repo" , "run_id" })
1412+ }
1413+
1414+ func Test_RerunWorkflowRun (t * testing.T ) {
1415+ // Verify tool definition once
1416+ mockClient := github .NewClient (nil )
1417+ tool , _ := RerunWorkflowRun (stubGetClientFn (mockClient ), translations .NullTranslationHelper )
1418+ require .NoError (t , toolsnaps .Test (tool .Name , tool ))
1419+
1420+ assert .Equal (t , "rerun_workflow_run" , tool .Name )
1421+ assert .NotEmpty (t , tool .Description )
1422+ inputSchema := tool .InputSchema .(* jsonschema.Schema )
1423+ assert .Contains (t , inputSchema .Properties , "owner" )
1424+ assert .Contains (t , inputSchema .Properties , "repo" )
1425+ assert .Contains (t , inputSchema .Properties , "run_id" )
1426+ assert .ElementsMatch (t , inputSchema .Required , []string {"owner" , "repo" , "run_id" })
1427+ }
1428+
1429+ func Test_RerunFailedJobs (t * testing.T ) {
1430+ // Verify tool definition once
1431+ mockClient := github .NewClient (nil )
1432+ tool , _ := RerunFailedJobs (stubGetClientFn (mockClient ), translations .NullTranslationHelper )
1433+ require .NoError (t , toolsnaps .Test (tool .Name , tool ))
1434+
1435+ assert .Equal (t , "rerun_failed_jobs" , tool .Name )
1436+ assert .NotEmpty (t , tool .Description )
1437+ inputSchema := tool .InputSchema .(* jsonschema.Schema )
1438+ assert .Contains (t , inputSchema .Properties , "owner" )
1439+ assert .Contains (t , inputSchema .Properties , "repo" )
1440+ assert .Contains (t , inputSchema .Properties , "run_id" )
1441+ assert .ElementsMatch (t , inputSchema .Required , []string {"owner" , "repo" , "run_id" })
1442+ }
0 commit comments