@testchimp/cli 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,6 +46,7 @@ export function buildCliProgram() {
46
46
  .option("--release <s>")
47
47
  .option("--environment <s>")
48
48
  .option("--branch-name <s>")
49
+ .option("--platform <web|ios|android>")
49
50
  .option("--file-paths <csv>", "comma-separated paths under platform tests root")
50
51
  .option("--folder-path <path>", "folder under tests root, slash-separated")
51
52
  .action(async (opts) => {
@@ -56,6 +57,8 @@ export function buildCliProgram() {
56
57
  body.environment = opts.environment;
57
58
  if (opts.branchName)
58
59
  body.branchName = opts.branchName;
60
+ if (opts.platform)
61
+ body.platform = opts.platform;
59
62
  const scope = {};
60
63
  if (opts.filePaths)
61
64
  scope.filePaths = String(opts.filePaths).split(",").map((s) => s.trim()).filter(Boolean);
@@ -74,6 +77,8 @@ export function buildCliProgram() {
74
77
  .option("--release <s>")
75
78
  .option("--environment <s>")
76
79
  .option("--branch-name <s>")
80
+ .option("--scenario-id <id>")
81
+ .option("--platform <web|ios|android>")
77
82
  .option("--file-paths <csv>")
78
83
  .option("--folder-path <path>")
79
84
  .action(async (opts) => {
@@ -84,6 +89,10 @@ export function buildCliProgram() {
84
89
  body.environment = opts.environment;
85
90
  if (opts.branchName)
86
91
  body.branchName = opts.branchName;
92
+ if (opts.scenarioId)
93
+ body.scenarioId = opts.scenarioId;
94
+ if (opts.platform)
95
+ body.platform = opts.platform;
87
96
  const scope = {};
88
97
  if (opts.filePaths)
89
98
  scope.filePaths = String(opts.filePaths).split(",").map((s) => s.trim()).filter(Boolean);
@@ -3,6 +3,10 @@ export declare const scopeSchema: z.ZodOptional<z.ZodObject<{
3
3
  filePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
4
4
  folderPath: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>>;
5
5
  }, z.core.$strip>>;
6
+ export declare const executionJobDimensionFilterSchema: z.ZodObject<{
7
+ dimension: z.ZodString;
8
+ values: z.ZodArray<z.ZodString>;
9
+ }, z.core.$strip>;
6
10
  export declare const listCoverageInput: z.ZodObject<{
7
11
  release: z.ZodOptional<z.ZodString>;
8
12
  environment: z.ZodOptional<z.ZodString>;
@@ -13,6 +17,11 @@ export declare const listCoverageInput: z.ZodObject<{
13
17
  includeNonCoveredUserStories: z.ZodOptional<z.ZodBoolean>;
14
18
  includeNonCoveredTestScenarios: z.ZodOptional<z.ZodBoolean>;
15
19
  branchName: z.ZodOptional<z.ZodString>;
20
+ platform: z.ZodOptional<z.ZodEnum<{
21
+ web: "web";
22
+ ios: "ios";
23
+ android: "android";
24
+ }>>;
16
25
  }, z.core.$strip>;
17
26
  export declare const listExecutionInput: z.ZodObject<{
18
27
  release: z.ZodOptional<z.ZodString>;
@@ -22,6 +31,18 @@ export declare const listExecutionInput: z.ZodObject<{
22
31
  folderPath: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>>;
23
32
  }, z.core.$strip>>;
24
33
  branchName: z.ZodOptional<z.ZodString>;
34
+ scenarioId: z.ZodOptional<z.ZodString>;
35
+ platform: z.ZodOptional<z.ZodEnum<{
36
+ web: "web";
37
+ ios: "ios";
38
+ android: "android";
39
+ }>>;
40
+ dimensionFilters: z.ZodOptional<z.ZodArray<z.ZodObject<{
41
+ dimension: z.ZodString;
42
+ values: z.ZodArray<z.ZodString>;
43
+ }, z.core.$strip>>>;
44
+ limit: z.ZodOptional<z.ZodNumber>;
45
+ offset: z.ZodOptional<z.ZodNumber>;
25
46
  }, z.core.$strip>;
26
47
  export declare const fetchExecutionReportInput: z.ZodObject<{
27
48
  batchInvocationId: z.ZodOptional<z.ZodString>;
@@ -5,6 +5,11 @@ export const scopeSchema = z
5
5
  folderPath: z.union([z.array(z.string()), z.string()]).optional(),
6
6
  })
7
7
  .optional();
8
+ const executionPlatformSchema = z.enum(["web", "ios", "android"]);
9
+ export const executionJobDimensionFilterSchema = z.object({
10
+ dimension: z.string().min(1),
11
+ values: z.array(z.string()).min(1),
12
+ });
8
13
  export const listCoverageInput = z.object({
9
14
  release: z.string().optional(),
10
15
  environment: z.string().optional(),
@@ -12,12 +17,18 @@ export const listCoverageInput = z.object({
12
17
  includeNonCoveredUserStories: z.boolean().optional(),
13
18
  includeNonCoveredTestScenarios: z.boolean().optional(),
14
19
  branchName: z.string().optional(),
20
+ platform: executionPlatformSchema.optional(),
15
21
  });
16
22
  export const listExecutionInput = z.object({
17
23
  release: z.string().optional(),
18
24
  environment: z.string().optional(),
19
25
  scope: scopeSchema,
20
26
  branchName: z.string().optional(),
27
+ scenarioId: z.string().optional(),
28
+ platform: executionPlatformSchema.optional(),
29
+ dimensionFilters: z.array(executionJobDimensionFilterSchema).optional(),
30
+ limit: z.number().int().positive().max(500).optional(),
31
+ offset: z.number().int().nonnegative().optional(),
21
32
  });
22
33
  export const fetchExecutionReportInput = z
23
34
  .object({
@@ -1,6 +1,16 @@
1
1
  import { normalizeScope } from "./normalize.js";
2
2
  import { runProvisionEphemeralEnvironmentAndWait } from "./ephemeralWait.js";
3
3
  import * as S from "./schemas.js";
4
+ function platformToProtoEnum(platform) {
5
+ switch (platform) {
6
+ case "ios":
7
+ return "IOS_EXECUTION_PLATFORM";
8
+ case "android":
9
+ return "ANDROID_EXECUTION_PLATFORM";
10
+ default:
11
+ return "WEB_EXECUTION_PLATFORM";
12
+ }
13
+ }
4
14
  function listCoverageBody(args) {
5
15
  const body = {};
6
16
  if (args.release != null)
@@ -16,6 +26,8 @@ function listCoverageBody(args) {
16
26
  }
17
27
  if (args.branchName != null && args.branchName.trim() !== "")
18
28
  body.branchName = args.branchName.trim();
29
+ if (args.platform != null)
30
+ body.platform = platformToProtoEnum(args.platform);
19
31
  return body;
20
32
  }
21
33
  function listExecutionBody(args) {
@@ -28,6 +40,24 @@ function listExecutionBody(args) {
28
40
  body.scope = normalizeScope(args.scope);
29
41
  if (args.branchName != null && args.branchName.trim() !== "")
30
42
  body.branchName = args.branchName.trim();
43
+ if (args.scenarioId != null && args.scenarioId.trim() !== "")
44
+ body.scenarioId = args.scenarioId.trim();
45
+ const dimensionFilters = [...(args.dimensionFilters ?? [])];
46
+ if (args.platform != null) {
47
+ const hasPlatformFilter = dimensionFilters.some((f) => f.dimension === "PLATFORM_EXECUTION_JOB_FILTER_DIMENSION");
48
+ if (!hasPlatformFilter) {
49
+ dimensionFilters.push({
50
+ dimension: "PLATFORM_EXECUTION_JOB_FILTER_DIMENSION",
51
+ values: [args.platform.toUpperCase()],
52
+ });
53
+ }
54
+ }
55
+ if (dimensionFilters.length > 0)
56
+ body.dimensionFilters = dimensionFilters;
57
+ if (args.limit != null)
58
+ body.limit = args.limit;
59
+ if (args.offset != null)
60
+ body.offset = args.offset;
31
61
  return body;
32
62
  }
33
63
  export const TOOL_DEFINITIONS = [
@@ -36,7 +66,7 @@ export const TOOL_DEFINITIONS = [
36
66
  description: "Fetch requirement (scenario) coverage under an optional platform-rooted folder scope (tests/... or plans/...). " +
37
67
  "Use scope.filePaths or scope.folderPath (platform tests/plans roots). Omit branchName for cross-branch coverage " +
38
68
  "(aggregates branch copies; execution jobs deduped by stable hash of tests-root-relative path + test name). " +
39
- "Pass branchName only when results must be limited to one Git branch.",
69
+ "Pass branchName only when results must be limited to one Git branch. Optional platform (web|ios|android) filters rollup.",
40
70
  inputSchema: S.listCoverageInput,
41
71
  execute: async (args, { postMcp }) => {
42
72
  const json = await postMcp("/api/mcp/list_requirement_coverage", listCoverageBody(args));
@@ -45,8 +75,8 @@ export const TOOL_DEFINITIONS = [
45
75
  },
46
76
  {
47
77
  kebab: "get-execution-history",
48
- description: "Fetch SmartTest execution history for an optional platform-rooted folder scope. " +
49
- "Use branchName and scope.filePaths as for coverage.",
78
+ description: "Fetch SmartTest execution history for an optional platform-rooted folder scope, or for a scenario when scenarioId is set. " +
79
+ "Use branchName and scope.filePaths as for coverage. Optional platform (web|ios|android) and dimensionFilters narrow results.",
50
80
  inputSchema: S.listExecutionInput,
51
81
  execute: async (args, { postMcp }) => {
52
82
  const json = await postMcp("/api/mcp/list_execution_history", listExecutionBody(args));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testchimp/cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "TestChimp CLI and MCP server — coverage, plans, EaaS, TrueCoverage (calls /api/mcp/*)",
5
5
  "type": "module",
6
6
  "main": "dist/bin/testchimp.js",