Skip to content

Commit 5d4378e

Browse files
committed
Add test data
1 parent 7c8f2c8 commit 5d4378e

22 files changed

Lines changed: 1153 additions & 8 deletions

File tree

workspaces/ballerina/ballerina-extension/src/features/ai/agent/tools/text-editor.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,9 +895,8 @@ export function createReadTool(execute: ReadExecute) {
895895
- You can optionally specify a line offset and limit (especially handy for long files).
896896
- Any lines longer than 2000 characters will be truncated
897897
- The file content will be returned as string
898-
- By default, it reads up to lines starting from the beginning of the file
899-
- You can optionally specify a line offset and limit (especially handy for long files)
900-
- For read a specific **component** of a file, If you know the line range ALWAYS prefer read that specific line range rather than the entire file.
898+
- If you know the exact line range of a COMPONENT you want to read, ALWAYS prefer reading that specific line range rather than the entire file.
899+
- If you dont know the line range to read, start by reading the entire file.
901900
- If the file is very large, consider using the offset and limit parameters to read it in chunks.
902901
- If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.`,
903902
inputSchema: z.object({

workspaces/ballerina/ballerina-extension/test/ai/evals/code/result-management/result-persistence.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export async function persistUsecaseResult(
9191

9292
for (const file of usecaseResult.files) {
9393
const filePath = path.join(codeDir, file.fileName);
94+
await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
9495
await fs.promises.writeFile(filePath, file.content);
9596
}
9697

workspaces/ballerina/ballerina-extension/test/ai/evals/code/test-cases.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ export const textEditSpecializedTestCases = [
194194
];
195195

196196
export const testCasesForExistingProject = [
197-
{
198-
prompt: "How can I implement distributed tracing with OpenTelemetry across the order service saga, ensuring that trace contexts are properly propagated through Kafka events and database transactions while maintaining correlation IDs for debugging payment and fulfillment failures?",
199-
projectPath: "simple_order_management_system"
200-
},
197+
// {
198+
// prompt: "How can I implement distributed tracing with OpenTelemetry across the order service saga, ensuring that trace contexts are properly propagated through Kafka events and database transactions while maintaining correlation IDs for debugging payment and fulfillment failures?",
199+
// projectPath: "simple_order_management_system"
200+
// },
201201
// {
202202
// prompt: "I need to refactor the current synchronous order creation flow to support asynchronous batch processing with dead letter queues for failed orders, implementing circuit breaker patterns for the pricing service calls and adding retry mechanisms with exponential backoff for Kafka publishing failures.",
203203
// projectPath: "simple_order_management_system"
@@ -366,8 +366,20 @@ export const langlibTestCases = [
366366
];
367367

368368
export const testCasesForCodeIndexing = [
369+
// {
370+
// prompt: "Refactor the customer creation flow to persist newly created customers in a SQL database instead of the in-memory customerStore map, implementing a repository layer with connection pooling, parameterized queries for security, and proper error handling for database failures while maintaining data validation and response consistency in the CustomerService.",
371+
// projectPath: "order_management_system"
372+
// },
373+
{
374+
prompt: "Change the delete endpoint in CustomerService so that instead of permanently removing the customer, it marks them as inactive by setting a deletedAt timestamp.",
375+
projectPath: "order_management_system"
376+
},
377+
{
378+
prompt: "Add a stockQuantity validation to the order creation flow so that when an order is successfully placed, the stock count of each ordered product is decremented in the product store.",
379+
projectPath: "order_management_system"
380+
},
369381
{
370-
prompt: "Refactor the customer creation flow to persist newly created customers in a SQL database instead of the in-memory customerStore map, implementing a repository layer with connection pooling, parameterized queries for security, and proper error handling for database failures while maintaining data validation and response consistency in the CustomerService.",
382+
prompt: "Add a coupon code system where customers can apply a discount coupon during order creation. The coupon should validate against a coupon store and reduce the total order amount accordingly.",
371383
projectPath: "order_management_system"
372384
}
373385
];
@@ -379,3 +391,4 @@ testCases.push(...textEditSpecializedTestCases);
379391
testCases.push(...testCasesForExistingProject);
380392
testCases.push(...testCasesForExistingSemanticErrors);
381393
testCases.push(...langlibTestCases);
394+
testCases.push(...testCasesForCodeIndexing);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
org = "test"
3+
name = "order_management_system"
4+
version = "0.1.0"
5+
distribution = "2201.13.1"
6+
7+
[build-options]
8+
observabilityIncluded = true

0 commit comments

Comments
 (0)