Skip to content

Commit 02745ee

Browse files
Feat: Refactor CreateTestRunSchema by removing unused fields and simplifying structure
1 parent e1fe470 commit 02745ee

File tree

1 file changed

+8
-39
lines changed

1 file changed

+8
-39
lines changed

src/tools/testmanagement-utils/create-testrun.ts

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,11 @@ export const CreateTestRunSchema = z.object({
3030
.describe(
3131
"State of the test run. One of new_run, in_progress, under_review, rejected, done, closed",
3232
),
33-
assignee: z
34-
.string()
35-
.email()
36-
.optional()
37-
.describe("Email of the test run assignee"),
38-
test_case_assignee: z
39-
.string()
40-
.email()
41-
.optional()
42-
.describe("Email of the test case assignee"),
43-
tags: z.array(z.string()).optional().describe("Labels for the test run"),
4433
issues: z.array(z.string()).optional().describe("Linked issue IDs"),
4534
issue_tracker: z
4635
.object({ name: z.string(), host: z.string().url() })
4736
.optional()
4837
.describe("Issue tracker configuration"),
49-
configurations: z
50-
.array(z.number())
51-
.optional()
52-
.describe("List of configuration IDs"),
53-
test_plan_id: z.string().optional().describe("Identifier of the test plan"),
5438
test_cases: z
5539
.array(z.string())
5640
.optional()
@@ -59,27 +43,6 @@ export const CreateTestRunSchema = z.object({
5943
.array(z.number())
6044
.optional()
6145
.describe("Folder IDs to include"),
62-
include_all: z
63-
.boolean()
64-
.optional()
65-
.describe("If true, include all test cases in the project"),
66-
is_automation: z
67-
.boolean()
68-
.optional()
69-
.describe("Mark as automated if true, otherwise manual"),
70-
filter_test_cases: z
71-
.object({
72-
status: z.array(z.string()).optional(),
73-
priority: z.array(z.string()).optional(),
74-
case_type: z.array(z.string()).optional(),
75-
owner: z.array(z.string()).optional(),
76-
tags: z.array(z.string()).optional(),
77-
custom_fields: z
78-
.record(z.array(z.union([z.string(), z.number()])))
79-
.optional(),
80-
})
81-
.optional()
82-
.describe("Filters to apply before adding test cases"),
8346
}),
8447
});
8548

@@ -92,8 +55,14 @@ export async function createTestRun(
9255
rawArgs: CreateTestRunArgs,
9356
): Promise<CallToolResult> {
9457
try {
95-
// Validate and narrow
96-
const args = CreateTestRunSchema.parse(rawArgs);
58+
const inputArgs = {
59+
...rawArgs,
60+
test_run: {
61+
...rawArgs.test_run,
62+
include_all: false,
63+
},
64+
};
65+
const args = CreateTestRunSchema.parse(inputArgs);
9766

9867
const url = `https://test-management.browserstack.com/api/v2/projects/${encodeURIComponent(
9968
args.project_identifier,

0 commit comments

Comments
 (0)