Skip to content

Commit b6d5eaa

Browse files
docs: move envs/exit codes to their own help sections
1 parent 0d9429c commit b6d5eaa

10 files changed

Lines changed: 66 additions & 57 deletions

File tree

messages/agent.test.results.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ This command requires a job ID, which the original "agent test run" command disp
88

99
By default, this command outputs test results in human-readable tables for each test case. The tables show whether the test case passed, the expected and actual values, the test score, how long the test took, and more. Use the --result-format to display the test results in JSON or Junit format. Use the --output-dir flag to write the results to a file rather than to the terminal.
1010

11-
ERROR CODES
12-
13-
Succeeded (0) Results retrieved successfully. Test results (passed/failed) are in the output.
14-
Failed (1) Command couldn't execute due to invalid job ID, API errors, network issues, or system errors.
15-
16-
ENVIRONMENT VARIABLES
17-
18-
SF_TARGET_ORG Username or alias of your default org. Overrides the target-org configuration variable.
19-
2011
# flags.job-id.summary
2112

2213
Job ID of the completed agent test run.

messages/agent.test.resume.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ Use the --wait flag to specify the number of minutes for this command to wait fo
1010

1111
By default, this command outputs test results in human-readable tables for each test case. The tables show whether the test case passed, the expected and actual values, the test score, how long the test took, and more. Use the --result-format to display the test results in JSON or Junit format. Use the --output-dir flag to write the results to a file rather than to the terminal.
1212

13-
ERROR CODES
14-
15-
Succeeded (0) Test completed successfully. Test results (passed/failed) are in the JSON output.
16-
Failed (1) Command couldn't execute due to invalid job ID, API errors, network issues, or system errors. Exit code 1 also indicates tests encountered execution errors.
17-
18-
ENVIRONMENT VARIABLES
19-
20-
SF_TARGET_ORG Username or alias of your default org. Overrides the target-org configuration variable.
21-
2213
# flags.job-id.summary
2314

2415
Job ID of the original agent test run.

messages/agent.test.run-eval.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@ When you provide a JSON payload, it's sent directly to the API with optional nor
1212

1313
Supports 8+ evaluator types, including topic routing assertions, action invocation checks, string/numeric assertions, semantic similarity scoring, and LLM-based quality ratings.
1414

15-
ERROR CODES
16-
17-
Succeeded (0) Tests completed successfully. Test results (passed/failed) are in the JSON output.
18-
Failed (1) Execution error occurred. Tests couldn't run due to API errors, network issues, invalid parameters, or system errors.
19-
20-
ENVIRONMENT VARIABLES
21-
22-
SF_TARGET_ORG Username or alias of your default org. Overrides the target-org configuration variable.
23-
2415
# flags.spec.summary
2516

2617
Path to test spec file (YAML or JSON). Supports reading from stdin when piping content.

messages/agent.test.run.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ By default, this command starts the agent test in your org, but it doesn't wait
1010

1111
By default, this command outputs test results in human-readable tables for each test case, if the test completes in time. The tables show whether the test case passed, the expected and actual values, the test score, how long the test took, and more. Use the --result-format to display the test results in JSON or Junit format. Use the --output-dir flag to write the results to a file rather than to the terminal.
1212

13-
ERROR CODES
14-
15-
Succeeded (0) Test started successfully (without --wait), or test completed successfully (with --wait).
16-
Failed (1) Command couldn't execute due to API errors, network issues, invalid test name, or system errors. When using --wait, exit code 1 also indicates tests encountered execution errors.
17-
18-
ENVIRONMENT VARIABLES
19-
20-
SF_TARGET_ORG Username or alias of your default org. Overrides the target-org configuration variable.
21-
2213
# flags.api-name.summary
2314

2415
API name of the agent test to run; corresponds to the name of the AiEvaluationDefinition metadata component that implements the agent test.

messages/agent.validate.authoring-bundle.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ This command validates that the Agent Script file in the authoring bundle compil
1010

1111
This command uses the API name of the authoring bundle. If you don't provide an API name with the --api-name flag, the command searches the current DX project and outputs a list of authoring bundles that it found for you to choose from.
1212

13-
ERROR CODES
14-
15-
Succeeded (0) Agent Script file compiled successfully without errors.
16-
Failed (1) Compilation errors found in the Agent Script file.
17-
NotFound (2) Validation/compilation API returned HTTP 404. The API endpoint may not be available in your org or region.
18-
ServerError (3) Validation/compilation API returned HTTP 500. A server error occurred during compilation.
19-
20-
ENVIRONMENT VARIABLES
21-
22-
SF_TARGET_ORG Username or alias of your default org. Overrides the target-org configuration variable.
23-
2413
# examples
2514

2615
- Validate an authoring bundle by being prompted for its API name; use your default org:

src/commands/agent/test/results.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
18-
import { Messages } from '@salesforce/core';
17+
import { SfCommand, Flags, toHelpSection } from '@salesforce/sf-plugins-core';
18+
import { EnvironmentVariable, Messages } from '@salesforce/core';
1919
import { AgentTester, AgentTestResultsResponse } from '@salesforce/agents';
2020
import { resultFormatFlag, testOutputDirFlag, verboseFlag } from '../../../flags.js';
2121
import { handleTestResults } from '../../../handleTestResults.js';
@@ -30,6 +30,16 @@ export default class AgentTestResults extends SfCommand<AgentTestResultsResult>
3030
public static readonly description = messages.getMessage('description');
3131
public static readonly examples = messages.getMessages('examples');
3232

33+
public static readonly envVariablesSection = toHelpSection(
34+
'ENVIRONMENT VARIABLES',
35+
EnvironmentVariable.SF_TARGET_ORG
36+
);
37+
38+
public static readonly errorCodes = toHelpSection('ERROR CODES', {
39+
'Succeeded (0)': 'Results retrieved successfully. Test results (passed/failed) are in the output.',
40+
'Failed (1)': "Command couldn't execute due to invalid job ID, API errors, network issues, or system errors.",
41+
});
42+
3343
public static readonly flags = {
3444
'target-org': Flags.requiredOrg(),
3545
'api-version': Flags.orgApiVersion(),

src/commands/agent/test/resume.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
18-
import { Messages } from '@salesforce/core';
17+
import { SfCommand, Flags, toHelpSection } from '@salesforce/sf-plugins-core';
18+
import { EnvironmentVariable, Messages } from '@salesforce/core';
1919
import { AgentTester } from '@salesforce/agents';
2020
import { AgentTestCache } from '../../../agentTestCache.js';
2121
import { TestStages } from '../../../testStages.js';
@@ -30,6 +30,17 @@ export default class AgentTestResume extends SfCommand<AgentTestRunResult> {
3030
public static readonly description = messages.getMessage('description');
3131
public static readonly examples = messages.getMessages('examples');
3232

33+
public static readonly envVariablesSection = toHelpSection(
34+
'ENVIRONMENT VARIABLES',
35+
EnvironmentVariable.SF_TARGET_ORG
36+
);
37+
38+
public static readonly errorCodes = toHelpSection('ERROR CODES', {
39+
'Succeeded (0)': 'Test completed successfully. Test results (passed/failed) are in the JSON output.',
40+
'Failed (1)':
41+
"Command couldn't execute due to invalid job ID, API errors, network issues, or system errors. Exit code 1 also indicates tests encountered execution errors.",
42+
});
43+
3344
public static readonly flags = {
3445
'target-org': Flags.requiredOrg(),
3546
'api-version': Flags.orgApiVersion(),

src/commands/agent/test/run-eval.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616

1717
import { readFile } from 'node:fs/promises';
18-
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
19-
import { Messages, Org } from '@salesforce/core';
18+
import { Flags, SfCommand, toHelpSection } from '@salesforce/sf-plugins-core';
19+
import { EnvironmentVariable, Messages, Org } from '@salesforce/core';
2020
import { type EvalPayload, normalizePayload, splitIntoBatches } from '../../../evalNormalizer.js';
2121
import { type EvalApiResponse, formatResults, type ResultFormat } from '../../../evalFormatter.js';
2222
import { resultFormatFlag } from '../../../flags.js';
@@ -157,6 +157,17 @@ export default class AgentTestRunEval extends SfCommand<RunEvalResult> {
157157
public static state = 'beta';
158158
public static readonly hidden = true;
159159

160+
public static readonly envVariablesSection = toHelpSection(
161+
'ENVIRONMENT VARIABLES',
162+
EnvironmentVariable.SF_TARGET_ORG
163+
);
164+
165+
public static readonly errorCodes = toHelpSection('ERROR CODES', {
166+
'Succeeded (0)': 'Tests completed successfully. Test results (passed/failed) are in the JSON output.',
167+
'Failed (1)':
168+
"Execution error occurred. Tests couldn't run due to API errors, network issues, invalid parameters, or system errors.",
169+
});
170+
160171
public static readonly flags = {
161172
'target-org': Flags.requiredOrg(),
162173
'api-version': Flags.orgApiVersion(),

src/commands/agent/test/run.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
18-
import { Messages, SfError } from '@salesforce/core';
17+
import { SfCommand, Flags, toHelpSection } from '@salesforce/sf-plugins-core';
18+
import { EnvironmentVariable, Messages, SfError } from '@salesforce/core';
1919
import { AgentTester, AgentTestStartResponse } from '@salesforce/agents';
2020
import { colorize } from '@oclif/core/ux';
2121
import { CLIError } from '@oclif/core/errors';
@@ -62,6 +62,17 @@ export default class AgentTestRun extends SfCommand<AgentTestRunResult> {
6262
public static readonly description = messages.getMessage('description');
6363
public static readonly examples = messages.getMessages('examples');
6464

65+
public static readonly envVariablesSection = toHelpSection(
66+
'ENVIRONMENT VARIABLES',
67+
EnvironmentVariable.SF_TARGET_ORG
68+
);
69+
70+
public static readonly errorCodes = toHelpSection('ERROR CODES', {
71+
'Succeeded (0)': 'Test started successfully (without --wait), or test completed successfully (with --wait).',
72+
'Failed (1)':
73+
"Command couldn't execute due to API errors, network issues, invalid test name, or system errors. When using --wait, exit code 1 also indicates tests encountered execution errors.",
74+
});
75+
6576
public static readonly flags = {
6677
'target-org': Flags.requiredOrg(),
6778
'api-version': Flags.orgApiVersion(),

src/commands/agent/validate/authoring-bundle.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
17-
import { Messages } from '@salesforce/core';
16+
import { SfCommand, Flags, toHelpSection } from '@salesforce/sf-plugins-core';
17+
import { EnvironmentVariable, Messages } from '@salesforce/core';
1818
import { MultiStageOutput } from '@oclif/multi-stage-output';
1919
import { Agent } from '@salesforce/agents';
2020
import { colorize } from '@oclif/core/ux';
@@ -35,6 +35,19 @@ export default class AgentValidateAuthoringBundle extends SfCommand<AgentValidat
3535
public static readonly examples = messages.getMessages('examples');
3636
public static readonly requiresProject = true;
3737

38+
public static readonly envVariablesSection = toHelpSection(
39+
'ENVIRONMENT VARIABLES',
40+
EnvironmentVariable.SF_TARGET_ORG
41+
);
42+
43+
public static readonly errorCodes = toHelpSection('ERROR CODES', {
44+
'Succeeded (0)': 'Agent Script file compiled successfully without errors.',
45+
'Failed (1)': 'Compilation errors found in the Agent Script file.',
46+
'NotFound (2)':
47+
'Validation/compilation API returned HTTP 404. The API endpoint may not be available in your org or region.',
48+
'ServerError (3)': 'Validation/compilation API returned HTTP 500. A server error occurred during compilation.',
49+
});
50+
3851
public static readonly flags = {
3952
'target-org': Flags.requiredOrg(),
4053
'api-version': Flags.orgApiVersion(),

0 commit comments

Comments
 (0)