run_test_group
Execute a predefined group of tests for WordPress/WooCommerce plugins using configuration from qit.json to validate functionality and security.
Instructions
Run a group of tests defined in qit.json configuration file.
⚠️ QIT CLI not detected. QIT CLI not found. Please install it using one of these methods:
Via Composer (recommended): composer require woocommerce/qit-cli --dev
Set QIT_CLI_PATH environment variable: export QIT_CLI_PATH=/path/to/qit
Ensure 'qit' is available in your system PATH
For more information, visit: https://github.com/woocommerce/qit-cli
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group | Yes | Name of the test group defined in qit.json | |
| config | No | Path to qit.json configuration file | |
| wait | No | Wait for all tests to complete before returning | |
| json | No | Return output in JSON format |
Implementation Reference
- src/tools/test-execution.ts:253-268 (handler)The async handler function for the 'run_test_group' tool. It constructs CLI arguments for the 'run:group' command using the provided group name and optional flags (config, wait, json), sets an appropriate timeout, and executes the command via executeAndFormat.handler: async (args: { group: string; config?: string; wait?: boolean; json?: boolean; }) => { const cmdArgs = buildArgs("run:group", [args.group], { config: args.config, wait: args.wait, json: args.json, }); const timeout = args.wait ? 1800000 : 300000; return executeAndFormat(cmdArgs, { timeout }); },
- src/tools/test-execution.ts:238-252 (schema)Zod input schema defining parameters for the run_test_group tool: required 'group' string, optional 'config', 'wait', and 'json'.inputSchema: z.object({ group: z.string().describe("Name of the test group defined in qit.json"), config: z .string() .optional() .describe("Path to qit.json configuration file"), wait: z .boolean() .optional() .describe("Wait for all tests to complete before returning"), json: z .boolean() .optional() .describe("Return output in JSON format"), }),
- src/tools/test-execution.ts:234-269 (registration)The complete definition object for the 'run_test_group' tool, including name, description, inputSchema, and handler, exported as part of testExecutionTools.run_test_group: { name: "run_test_group", description: "Run a group of tests defined in qit.json configuration file.", inputSchema: z.object({ group: z.string().describe("Name of the test group defined in qit.json"), config: z .string() .optional() .describe("Path to qit.json configuration file"), wait: z .boolean() .optional() .describe("Wait for all tests to complete before returning"), json: z .boolean() .optional() .describe("Return output in JSON format"), }), handler: async (args: { group: string; config?: string; wait?: boolean; json?: boolean; }) => { const cmdArgs = buildArgs("run:group", [args.group], { config: args.config, wait: args.wait, json: args.json, }); const timeout = args.wait ? 1800000 : 300000; return executeAndFormat(cmdArgs, { timeout }); }, },
- src/tools/index.ts:10-12 (registration)Registration of testExecutionTools (containing run_test_group) by spreading into the allTools export used by the MCP server.export const allTools = { ...authTools, ...testExecutionTools,
- src/server.ts:29-35 (registration)MCP server lists all tools from allTools, converting Zod schemas to JSON schema for the ListToolsRequestHandler.const tools = Object.entries(allTools).map(([_, tool]) => ({ name: tool.name, description: cliInfo ? tool.description : `${tool.description}\n\n⚠️ QIT CLI not detected. ${getQitCliNotFoundError()}`, inputSchema: zodToJsonSchema(tool.inputSchema), }));