Skip to content

Commit d0aafed

Browse files
docs: rearrange message locations
1 parent c912f11 commit d0aafed

File tree

5 files changed

+35
-113
lines changed

5 files changed

+35
-113
lines changed

messages/logicruntest.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

messages/runlogictest.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,38 @@ Invoke tests for Apex and Flows in an org.
44

55
# description
66

7-
This command provides a single, unified interface to run tests for multiple metadata types.
8-
By default, the command executes asynchronously, returning a test run ID. Use 'sf logic get test' to retrieve the results.
9-
Use the --synchronous flag to wait for the test run to complete and see the results in the command output.
10-
To run specific tests, use --test-names. To run all tests of a certain type, use --test-level with --test-category. If neither is specified, all local tests for all categories will be run.
7+
This command provides a single and unified way to run tests for multiple Salesforce features, such as Apex classes and Flows. Running the tests together with a single command ensures seamless interoperability between the features.
118

12-
# examples
9+
By default, the command executes asynchronously and returns a test run ID. Then use the "sf logic get test" command to retrieve the results. If you want to wait for the test run to complete and see the results in the command output, use the --synchronous flag.
1310

14-
- Run a mix of specific named tests for Apex and Flow asynchronously:
11+
To run specific tests, use the --tests flag, passing it the Apex test class names or the Flow tests in the form Flowtest.<name>. You can also run specific test methods, although if you run the tests synchronously, the methods must belong to a single Apex class or Flow test. To run all tests of a certain category, use --test-level with --test-category. If neither flag is specified, all local tests for all categories are run by default. You can also use the --class-names and --suite-names flags to run Apex test classes or suites.
1512

16-
<%= config.bin %> <%= command.id %> --test-names MyApexClassTest,FlowTest.ProcessOrder
13+
To see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level summary of the test run and the code coverage values for the tested classes or flows. If you specify human-readable result format, use the --detailed-coverage flag to see detailed coverage results for each test method run.
1714

18-
- Run all local tests for only the Apex and Flow categories, waiting for the results to complete:
15+
You must have the "View All Data" org system permission to use this command. The permission is disabled by default and can be enabled only by a system administrator.
1916

20-
<%= config.bin %> <%= command.id %> --test-level RunLocalTests --test-category Apex --test-category Flow --synchronous
17+
# examples
2118

22-
- Run all local tests for ALL categories (the default behavior) and save the JUnit results to the "test-results" directory:
19+
- Run a mix of specific Apex and Flow tests asynchronously in your default org:
2320

24-
<%= config.bin %> <%= command.id %> --result-format junit --output-dir test-results --synchronous
21+
<%= config.bin %> <%= command.id %> --tests MyApexClassTest,FlowTest.ProcessOrder
2522

26-
# flags.logicTests.summary
23+
- Run all local Apex and Flow tests and wait for the results to complete; run the tests in the org with alias "my-scratch":
2724

28-
Comma-separated list of test names to run. Can include Apex classes, Flow tests (FlowTest.<name>), and Agent tests (AgentTest.<name>).
25+
<%= config.bin %> <%= command.id %> --test-level RunLocalTests --test-category Apex --test-category Flow --synchronous --target-org my-scratch
2926

30-
# flags.test-category.summary
27+
- Run two methods in an Apex test class and an Apex test suite:
3128

32-
Category of tests to run.
29+
<%= config.bin %> <%= command.id %> --class-names MyApexClassTest.methodA --class-names MyApexClassTest.methodB --suite-names MySuite
3330

34-
# flags.test-category.description
31+
- Run all local tests for all categories (the default behavior), save the JUnit results to the "test-results" directory, and include code coverage results:
3532

36-
Category of tests to run. Can be specified multiple times. Valid values are 'Apex' and 'Flow'.
33+
<%= config.bin %> <%= command.id %> --result-format junit --output-dir test-results --synchronous --code-coverage
3734

38-
# runLogicTestReportCommand
35+
# flags.logicTests.summary
36+
37+
Comma-separated list of test names to run. Can include Apex test classes and Flow tests.
38+
39+
# flags.test-category.summary
3940

40-
Run "%s logic get test -i %s -o %s" to retrieve test results
41+
Category of tests to run, such as Apex or Flow.

messages/runtest.md

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -127,44 +127,3 @@ Display detailed code coverage per test.
127127
# flags.concise.summary
128128

129129
Display only failed test results; works with human-readable output only.
130-
131-
# runTestReportCommand
132-
133-
Run "%s apex get test -i %s -o %s" to retrieve test results
134-
135-
# runLogicTestReportCommand
136-
137-
Run "%s logic get test -i %s -o %s" to retrieve test results
138-
139-
# runTestSyncInstructions
140-
141-
Run with --synchronous or increase --wait timeout to wait for results.
142-
143-
# syncClassErr
144-
145-
Synchronous test runs can include test methods from only one Apex class. Omit the --synchronous flag or include tests from only one class.
146-
147-
# syncClassErrForUnifiedLogic
148-
149-
Synchronous test runs can include test methods from either a single Apex class or a single Flow test. Omit the --synchronous flag or include test methods from only one class or Flow.
150-
151-
# testLevelErr
152-
153-
When specifying classnames, suitenames, or tests, indicate RunSpecifiedTests as the testlevel
154-
155-
# testResultProcessErr
156-
157-
Encountered an error when processing test results
158-
%s
159-
160-
# apexTestReportFormatHint
161-
162-
Run "sf apex get test %s --result-format <format>" to retrieve test results in a different format.
163-
164-
# outputDirHint
165-
166-
Test result files written to %s
167-
168-
# apexLibErr
169-
170-
Unknown error in Apex Library: %s

src/commands/logic/run/test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export default class RunTestLogic extends SfCommand<RunCommandResult> {
9494
}),
9595
'test-category': arrayWithDeprecation({
9696
summary: messages.getMessage('flags.test-category.summary'),
97-
description: messages.getMessage('flags.test-category.description'),
9897
options: ['Agent', 'Apex', 'Flow'],
9998
}),
10099
};

src/reporters/testReporter.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { JsonReporter, RunResult } from './jsonReporter.js';
2323
const FAILURE_EXIT_CODE = 100;
2424

2525
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
26-
const messages = Messages.loadMessages('@salesforce/plugin-apex', 'runtest');
26+
const messages = Messages.loadMessages('@salesforce/plugin-apex', 'runtestcommon');
2727

2828
export class TestReporter {
2929
/**
@@ -72,7 +72,13 @@ export class TestReporter {
7272
}
7373
switch (options['result-format']) {
7474
case 'human':
75-
this.logHuman(result, options['detailed-coverage'] as boolean, options['concise'], options['output-dir'], options.isUnifiedLogic);
75+
this.logHuman(
76+
result,
77+
options['detailed-coverage'] as boolean,
78+
options['concise'],
79+
options['output-dir'],
80+
options.isUnifiedLogic
81+
);
7682
break;
7783
case 'tap':
7884
this.logTap(result);
@@ -187,7 +193,13 @@ export class TestReporter {
187193
}
188194
}
189195

190-
private logHuman(result: TestResult, detailedCoverage: boolean, concise: boolean, outputDir?: string, isUnifiedLogic?: boolean): void {
196+
private logHuman(
197+
result: TestResult,
198+
detailedCoverage: boolean,
199+
concise: boolean,
200+
outputDir?: string,
201+
isUnifiedLogic?: boolean
202+
): void {
191203
if (outputDir) {
192204
this.ux.log(messages.getMessage('outputDirHint', [outputDir]));
193205
}

0 commit comments

Comments
 (0)