You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/accuracy/getPerformanceAdvisor.test.ts
+21-51Lines changed: 21 additions & 51 deletions
Original file line number
Diff line number
Diff line change
@@ -35,21 +35,27 @@ const mockedTools = {
35
35
},
36
36
};
37
37
38
+
constlistProjectsAndClustersToolCalls=[
39
+
{
40
+
toolName: "atlas-list-projects",
41
+
parameters: {},
42
+
optional: true,
43
+
},
44
+
{
45
+
toolName: "atlas-list-clusters",
46
+
parameters: {
47
+
projectId: "mflix",
48
+
},
49
+
optional: true,
50
+
},
51
+
];
52
+
38
53
describeAccuracyTests([
39
54
// Test for Suggested Indexes operation
40
55
{
41
56
prompt: "Can you give me index suggestions for the database 'mflix' in the project 'mflix' and cluster 'mflix-cluster'?",
42
57
expectedToolCalls: [
43
-
{
44
-
toolName: "atlas-list-projects",
45
-
parameters: {},
46
-
},
47
-
{
48
-
toolName: "atlas-list-clusters",
49
-
parameters: {
50
-
projectId: "mflix",
51
-
},
52
-
},
58
+
...listProjectsAndClustersToolCalls,
53
59
{
54
60
toolName: "atlas-get-performance-advisor",
55
61
parameters: {
@@ -65,16 +71,7 @@ describeAccuracyTests([
65
71
{
66
72
prompt: "Show me drop index suggestions for the 'mflix' project and 'mflix-cluster' cluster",
67
73
expectedToolCalls: [
68
-
{
69
-
toolName: "atlas-list-projects",
70
-
parameters: {},
71
-
},
72
-
{
73
-
toolName: "atlas-list-clusters",
74
-
parameters: {
75
-
projectId: "mflix",
76
-
},
77
-
},
74
+
...listProjectsAndClustersToolCalls,
78
75
{
79
76
toolName: "atlas-get-performance-advisor",
80
77
parameters: {
@@ -88,18 +85,9 @@ describeAccuracyTests([
88
85
},
89
86
// Test for Slow Query Logs operation
90
87
{
91
-
prompt: "Show me the slow query logs for the 'mflix' project and 'mflix-cluster' cluster for the namespaces 'mflix.movies' and 'mflix.shows' since January 1st, 2025.",
88
+
prompt: "Show me the slow query logs for the 'mflix' project and 'mflix-cluster' cluster for the namespaces 'mflix.movies' and 'mflix.shows' since January 1st, 2025 (a date that is certainly in the past!).",
92
89
expectedToolCalls: [
93
-
{
94
-
toolName: "atlas-list-projects",
95
-
parameters: {},
96
-
},
97
-
{
98
-
toolName: "atlas-list-clusters",
99
-
parameters: {
100
-
projectId: "mflix",
101
-
},
102
-
},
90
+
...listProjectsAndClustersToolCalls,
103
91
{
104
92
toolName: "atlas-get-performance-advisor",
105
93
parameters: {
@@ -117,16 +105,7 @@ describeAccuracyTests([
117
105
{
118
106
prompt: "Give me schema suggestions for the 'mflix' project and 'mflix-cluster' cluster",
119
107
expectedToolCalls: [
120
-
{
121
-
toolName: "atlas-list-projects",
122
-
parameters: {},
123
-
},
124
-
{
125
-
toolName: "atlas-list-clusters",
126
-
parameters: {
127
-
projectId: "mflix",
128
-
},
129
-
},
108
+
...listProjectsAndClustersToolCalls,
130
109
{
131
110
toolName: "atlas-get-performance-advisor",
132
111
parameters: {
@@ -142,16 +121,7 @@ describeAccuracyTests([
142
121
{
143
122
prompt: "Show me all performance advisor recommendations for the 'mflix' project and 'mflix-cluster' cluster",
0 commit comments