@provartesting/provardx-cli 1.5.1 → 1.5.2

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.
@@ -0,0 +1,41 @@
1
+ /**
2
+ * How the project's provardx-properties.json runs this test case.
3
+ *
4
+ * `direct` means the test case path appears in `testCase` or `testCases` and
5
+ * no `.testinstance` references it — data-driven `<dataTable>` rows will not
6
+ * iterate. `plan` means the test case is referenced by at least one
7
+ * `.testinstance` under `plans/`, so data-driven execution works. `unknown`
8
+ * means the properties file could not be resolved or parsed (no
9
+ * `~/.sf/config.json`, file outside allowed paths, missing project root, etc.)
10
+ * — callers should default to the safe behaviour (emit the structural
11
+ * warning) when the mode is unknown.
12
+ */
13
+ export type TestCasePlanMode = 'direct' | 'plan' | 'unknown';
14
+ export interface ResolvedTestCaseMode {
15
+ mode: TestCasePlanMode;
16
+ /** The properties-file path consulted (when resolved). */
17
+ propertiesFilePath?: string;
18
+ /** The project root resolved from the properties file (when present). */
19
+ projectPath?: string;
20
+ }
21
+ interface ResolveOptions {
22
+ /** Path to the test case file under validation. */
23
+ testCaseFilePath: string;
24
+ /** Allowed-paths policy from the MCP server config. */
25
+ allowedPaths: string[];
26
+ /** Override of ~/.sf/config.json location for testing. */
27
+ sfConfigPathOverride?: string;
28
+ /** Override of provardx-properties.json location for testing. */
29
+ propertiesFilePathOverride?: string;
30
+ }
31
+ /**
32
+ * Resolve whether a given test case file is referenced directly via
33
+ * `testCase`/`testCases` or via a `.testinstance` inside a plan.
34
+ *
35
+ * The resolution flow is intentionally best-effort and silent: any file
36
+ * read failure, JSON parse error, or path-policy violation collapses to
37
+ * `mode: 'unknown'` so the caller falls back to default behaviour rather
38
+ * than surfacing a confusing error from the validator.
39
+ */
40
+ export declare function resolveTestCasePlanMode(opts: ResolveOptions): ResolvedTestCaseMode;
41
+ export {};
@@ -0,0 +1,208 @@
1
+ /*
2
+ * Copyright (c) 2024 Provar Limited.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ /* eslint-disable camelcase */
8
+ import fs from 'node:fs';
9
+ import os from 'node:os';
10
+ import path from 'node:path';
11
+ import { assertPathAllowed } from '../security/pathPolicy.js';
12
+ /**
13
+ * Resolve whether a given test case file is referenced directly via
14
+ * `testCase`/`testCases` or via a `.testinstance` inside a plan.
15
+ *
16
+ * The resolution flow is intentionally best-effort and silent: any file
17
+ * read failure, JSON parse error, or path-policy violation collapses to
18
+ * `mode: 'unknown'` so the caller falls back to default behaviour rather
19
+ * than surfacing a confusing error from the validator.
20
+ */
21
+ export function resolveTestCasePlanMode(opts) {
22
+ const propsPath = readPropertiesFilePath(opts);
23
+ if (!propsPath)
24
+ return { mode: 'unknown' };
25
+ let propsObj;
26
+ try {
27
+ propsObj = JSON.parse(fs.readFileSync(propsPath, 'utf-8'));
28
+ }
29
+ catch {
30
+ return { mode: 'unknown', propertiesFilePath: propsPath };
31
+ }
32
+ const projectPath = typeof propsObj['projectPath'] === 'string' ? propsObj['projectPath'] : null;
33
+ if (!projectPath) {
34
+ // Without a project root we cannot resolve relative `testCase` entries or
35
+ // walk `plans/`. The mode is unknown.
36
+ return { mode: 'unknown', propertiesFilePath: propsPath };
37
+ }
38
+ let resolvedProjectPath;
39
+ try {
40
+ resolvedProjectPath = path.resolve(projectPath);
41
+ assertPathAllowed(resolvedProjectPath, opts.allowedPaths);
42
+ }
43
+ catch {
44
+ return { mode: 'unknown', propertiesFilePath: propsPath };
45
+ }
46
+ const resolvedTestCasePath = path.resolve(opts.testCaseFilePath);
47
+ // A `.testinstance` reference inside any plan wins — plan mode supports
48
+ // data-driven iteration.
49
+ if (isReferencedFromPlanInstance(resolvedProjectPath, resolvedTestCasePath)) {
50
+ return { mode: 'plan', propertiesFilePath: propsPath, projectPath: resolvedProjectPath };
51
+ }
52
+ if (isReferencedDirectly(propsObj, resolvedProjectPath, resolvedTestCasePath)) {
53
+ return { mode: 'direct', propertiesFilePath: propsPath, projectPath: resolvedProjectPath };
54
+ }
55
+ return { mode: 'unknown', propertiesFilePath: propsPath, projectPath: resolvedProjectPath };
56
+ }
57
+ /**
58
+ * Resolve the active properties file path. Prefers an explicit override
59
+ * (used by tests), then `~/.sf/config.json`'s `PROVARDX_PROPERTIES_FILE_PATH`.
60
+ *
61
+ * Both the override and the value read from `~/.sf/config.json` are funnelled
62
+ * through `assertPathAllowed` so a caller cannot trick the resolver into
63
+ * reading a properties file outside the configured `allowedPaths`. Any policy
64
+ * violation collapses to `null` to preserve the helper's best-effort contract.
65
+ */
66
+ function readPropertiesFilePath(opts) {
67
+ if (opts.propertiesFilePathOverride) {
68
+ return enforceAllowed(opts.propertiesFilePathOverride, opts.allowedPaths);
69
+ }
70
+ try {
71
+ const sfConfigPath = opts.sfConfigPathOverride ?? path.join(os.homedir(), '.sf', 'config.json');
72
+ if (!fs.existsSync(sfConfigPath))
73
+ return null;
74
+ const sfConfig = JSON.parse(fs.readFileSync(sfConfigPath, 'utf-8'));
75
+ const propsPath = sfConfig['PROVARDX_PROPERTIES_FILE_PATH'];
76
+ if (!propsPath)
77
+ return null;
78
+ return enforceAllowed(propsPath, opts.allowedPaths);
79
+ }
80
+ catch {
81
+ return null;
82
+ }
83
+ }
84
+ /**
85
+ * Resolve a candidate properties-file path through `assertPathAllowed`, then
86
+ * canonicalize via `fs.realpathSync` when the file exists so a symlink
87
+ * inside an allowed directory cannot redirect the read outside it. Returns
88
+ * `null` on any policy violation, missing file, or unexpected error — the
89
+ * caller treats `null` as "mode unknown" and falls back to default behaviour.
90
+ */
91
+ function enforceAllowed(candidate, allowedPaths) {
92
+ try {
93
+ const resolved = path.resolve(candidate);
94
+ assertPathAllowed(resolved, allowedPaths);
95
+ if (!fs.existsSync(resolved))
96
+ return null;
97
+ try {
98
+ return fs.realpathSync(resolved);
99
+ }
100
+ catch {
101
+ return resolved;
102
+ }
103
+ }
104
+ catch {
105
+ return null;
106
+ }
107
+ }
108
+ /**
109
+ * Does the properties file's top-level `testCase` or `testCases` array
110
+ * reference this test case file? Entries are interpreted relative to
111
+ * `<projectPath>/tests/` (per the Provar runtime convention).
112
+ */
113
+ function isReferencedDirectly(props, projectPath, testCaseFilePath) {
114
+ const entries = [];
115
+ const tc = props['testCase'];
116
+ const tcs = props['testCases'];
117
+ for (const candidate of [tc, tcs]) {
118
+ if (typeof candidate === 'string') {
119
+ entries.push(candidate);
120
+ }
121
+ else if (Array.isArray(candidate)) {
122
+ for (const e of candidate) {
123
+ if (typeof e === 'string')
124
+ entries.push(e);
125
+ }
126
+ }
127
+ }
128
+ if (entries.length === 0)
129
+ return false;
130
+ const testsDir = path.join(projectPath, 'tests');
131
+ const targetNorm = path.resolve(testCaseFilePath).toLowerCase();
132
+ for (const entry of entries) {
133
+ // Provar accepts both bare names ("MyTest") and relative paths
134
+ // ("Module/MyTest.testcase"). Allow either; match with and without the
135
+ // `.testcase` extension.
136
+ const variants = [];
137
+ const trimmed = entry.replace(/^[/\\]+/, '');
138
+ variants.push(path.resolve(testsDir, trimmed));
139
+ if (!/\.testcase$/i.test(trimmed)) {
140
+ variants.push(path.resolve(testsDir, `${trimmed}.testcase`));
141
+ }
142
+ for (const v of variants) {
143
+ if (v.toLowerCase() === targetNorm)
144
+ return true;
145
+ }
146
+ }
147
+ return false;
148
+ }
149
+ /**
150
+ * Walk `<projectPath>/plans/` for `.testinstance` files referencing this
151
+ * test case via `testCasePath="..."`. Best-effort — any read error skips
152
+ * the offending file.
153
+ */
154
+ function isReferencedFromPlanInstance(projectPath, testCaseFilePath) {
155
+ const plansDir = path.join(projectPath, 'plans');
156
+ if (!fs.existsSync(plansDir))
157
+ return false;
158
+ const testsDir = path.join(projectPath, 'tests');
159
+ const targetNorm = path.resolve(testCaseFilePath).toLowerCase();
160
+ let found = false;
161
+ const walk = (dir) => {
162
+ if (found)
163
+ return;
164
+ let entries;
165
+ try {
166
+ entries = fs.readdirSync(dir, { withFileTypes: true });
167
+ }
168
+ catch {
169
+ return;
170
+ }
171
+ for (const entry of entries) {
172
+ if (found)
173
+ return;
174
+ if (entry.name.startsWith('.') && !entry.name.endsWith('.testinstance'))
175
+ continue;
176
+ const full = path.join(dir, entry.name);
177
+ if (entry.isDirectory()) {
178
+ walk(full);
179
+ continue;
180
+ }
181
+ if (!entry.name.endsWith('.testinstance'))
182
+ continue;
183
+ let content;
184
+ try {
185
+ content = fs.readFileSync(full, 'utf-8');
186
+ }
187
+ catch {
188
+ continue;
189
+ }
190
+ const matches = content.matchAll(/testCasePath=["']([^"']+)["']/g);
191
+ for (const m of matches) {
192
+ const rel = m[1].replace(/\\/g, '/');
193
+ // testCasePath in Provar testinstances is conventionally relative to
194
+ // `<projectPath>/tests/`. Also tolerate paths relative to project root.
195
+ const candidates = [path.resolve(testsDir, rel), path.resolve(projectPath, rel)];
196
+ for (const c of candidates) {
197
+ if (c.toLowerCase() === targetNorm) {
198
+ found = true;
199
+ return;
200
+ }
201
+ }
202
+ }
203
+ }
204
+ };
205
+ walk(plansDir);
206
+ return found;
207
+ }
208
+ //# sourceMappingURL=testCasePlanMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testCasePlanMode.js","sourceRoot":"","sources":["../../../src/mcp/utils/testCasePlanMode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8BAA8B;AAC9B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAmC9D;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAoB;IAC1D,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAE3C,IAAI,QAAiC,CAAC;IACtC,IAA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;QACH,CAAC;IACH,CAAC,CAAC;IAEF,IAAI,CAAC,QAAQ,CAAC,CAAC;IACf,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const WARNING_CODES: {
2
+ readonly PROVARHOME_001: "PROVARHOME-001";
3
+ readonly DATA_001: "DATA-001";
4
+ readonly PARALLEL_001: "PARALLEL-001";
5
+ readonly SCHEMA_001: "SCHEMA-001";
6
+ readonly RUN_001: "RUN-001";
7
+ readonly JUNIT_001: "JUNIT-001";
8
+ };
9
+ export type WarningCode = (typeof WARNING_CODES)[keyof typeof WARNING_CODES];
10
+ export declare function formatWarning(code: WarningCode, message: string, suggestion?: string): string;
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright (c) 2024 Provar Limited.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ export const WARNING_CODES = {
8
+ PROVARHOME_001: 'PROVARHOME-001',
9
+ DATA_001: 'DATA-001',
10
+ PARALLEL_001: 'PARALLEL-001',
11
+ SCHEMA_001: 'SCHEMA-001',
12
+ RUN_001: 'RUN-001',
13
+ JUNIT_001: 'JUNIT-001',
14
+ };
15
+ export function formatWarning(code, message, suggestion) {
16
+ const base = `WARNING [${code}]: ${message}`;
17
+ return suggestion ? `${base} Did you mean '${suggestion}'?` : base;
18
+ }
19
+ //# sourceMappingURL=warningCodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warningCodes.js","sourceRoot":"","sources":["../../../src/mcp/utils/warningCodes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,cAAc,EAAE,gBAAgB;IAChC,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CACd,CAAC;AAIX,MAAM,UAAU,aAAa,CAAC,IAAiB,EAAE,OAAe,EAAE,UAAmB;IACnF,MAAM,IAAI,GAAG,YAAY,IAAI,MAAM,OAAO,EAAE,CAAC;IAC7C,OAAO,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,kBAAkB,UAAU,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACrE,CAAC"}
@@ -2036,5 +2036,5 @@
2036
2036
  ]
2037
2037
  }
2038
2038
  },
2039
- "version": "1.5.1"
2039
+ "version": "1.5.2"
2040
2040
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@provartesting/provardx-cli",
3
3
  "description": "A plugin for the Salesforce CLI to orchestrate testing activities and report quality metrics to Provar Quality Hub",
4
- "version": "1.5.1",
4
+ "version": "1.5.2",
5
5
  "mcpName": "io.github.ProvarTesting/provar",
6
6
  "license": "BSD-3-Clause",
7
7
  "plugins": [