Skip to content

Commit 510b1ed

Browse files
fix: sync instructions
* fix: sync instructions * Update messages/runtest.md Co-authored-by: Juliet Shackell <[email protected]> * chore: revert json logic --------- Co-authored-by: Juliet Shackell <[email protected]>
1 parent a3a14c6 commit 510b1ed

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

messages/runtest.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Specify which tests to run by using the --class-names, --suite-names, or --tests
88

99
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 classes in your org. If you specify human-readable result format, use the --detailed-coverage flag to see detailed coverage results for each test method run.
1010

11-
Apex tests run asynchronously by default. The command waits for 1 minute (default), or for the value of the --wait flag; if the tests have finished, the command displays the results. If the tests haven't finished by the end of the wait time, the command displays a test run ID; use the "<%= config.bin %> apex get test --test-run-id" command to get the results.
11+
By default, Apex tests run asynchronously and immediately return a test run ID. You can use the --wait flag to specify the number of minutes to wait; if the tests finish in that timeframe, the command displays the results. If the tests haven't finished by the end of the wait time, the command displays a test run ID. Use the "<%= config.bin %> apex get test --test-run-id" command to get the results.
1212

1313
NOTE: The testRunCoverage value (JSON and JUnit result formats) is a percentage of the covered lines and total lines from all the Apex classes evaluated by the tests in this run.
1414

@@ -104,6 +104,10 @@ Display detailed code coverage per test.
104104

105105
Run "%s apex get test -i %s -o %s" to retrieve test results
106106

107+
# runTestSyncInstructions
108+
109+
Run with --synchronous or increase --wait timeout to wait for results.
110+
107111
# syncClassErr
108112

109113
Synchronous test runs can include test methods from only one Apex class. Omit the --synchronous flag or include tests from only one class

src/commands/apex/run/test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ export default class Test extends SfCommand<RunCommandResult> {
156156
const testReporter = new TestReporter(new Ux({ jsonEnabled: this.jsonEnabled() }), conn, this.config.bin);
157157
return testReporter.report(result, flags);
158158
} else {
159-
// async test run
159+
// Tests were ran asynchronously or the --wait timed out.
160+
// Log the proper 'apex get test' command for the user to run later
160161
this.log(messages.getMessage('runTestReportCommand', [this.config.bin, result.testRunId, conn.getUsername()]));
162+
this.info(messages.getMessage('runTestSyncInstructions'));
161163
return result;
162164
}
163165
}

0 commit comments

Comments
 (0)