Skip to content

Commit 2adf42e

Browse files
Merge pull request #505 from salesforcecli/sb/apextestupdates
fix: added examples to apex run and apex get
2 parents 1d0563b + 78ab3bc commit 2adf42e

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

messages/gettest.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Provide a test run ID to display test results for an enqueued or completed async
2222

2323
- Specify a directory in which to save the test results from the org with the specified username (rather than your default org):
2424

25-
<%= config.bin %> <%= command.id %> --test-run-id <test run id> --code-coverage --output-dir <path to outputdir> --target-org me@myorg',
25+
<%= config.bin %> <%= command.id %> --test-run-id <test run id> --code-coverage --output-dir <path to outputdir> --target-org me@myorg'
26+
2627

2728
# flags.test-run-id.summary
2829

messages/runtest.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,31 @@ NOTE: The testRunCoverage value (JSON and JUnit result formats) is a percentage
3434

3535
<%= config.bin %> <%= command.id %> --test-level RunLocalTests --output-dir <path to outputdir> --target-org me@my.org
3636

37+
- Run all tests in the org asynchronously:
38+
39+
<%= config.bin %> <%= command.id %> --target-org myscratch
40+
41+
- Run all tests synchronously; the command waits to display the test results until all tests finish:
42+
43+
<%= config.bin %> <%= command.id %> --synchronous
44+
45+
- Run specific tests using the --test-level flag:
46+
47+
<%= config.bin %> <%= command.id %> --test-level RunLocalTests
48+
49+
- Run Apex tests on all the methods in the specified class; output results in Test Anything Protocol (TAP) format and request code coverage results:
50+
51+
<%= config.bin %> <%= command.id %> --class-names TestA --class-names TestB --result-format tap --code-coverage
52+
53+
- Run Apex tests on methods specified using the standard Class.method notation; if you specify a test class without a method, the command runs all methods in the class:
54+
55+
<%= config.bin %> <%= command.id %> --tests TestA.excitingMethod --tests TestA.boringMethod --tests TestB
56+
57+
- Run Apex tests on methods specified using the standard Class.method notation with a namespace:
58+
59+
<%= config.bin %> <%= command.id %> --tests ns.TestA.excitingMethod --tests ns.TestA.boringMethod --tests ns.TestB
60+
61+
3762
# flags.class-names.summary
3863

3964
Apex test class names to run; default is all classes.
@@ -80,9 +105,9 @@ Level of tests to run; default is RunLocalTests.
80105

81106
Here's what the levels mean:
82107

83-
- RunSpecifiedTests — Only the tests that you specify are run.
84-
- RunLocalTests — All tests in your org are run, except the ones that originate from installed managed packages.
85-
- RunAllTestsInOrg — All tests are in your org and in installed managed packages are run
108+
- RunSpecifiedTests — Only the tests that you specify in the runTests option are run. Code coverage requirements differ from the default coverage requirements when using this test level. The executed tests must cover each class and trigger in the deployment package for a minimum of 75% code coverage. This coverage is computed for each class and triggers individually, and is different than the overall coverage percentage.
109+
- RunLocalTests — All local tests in your org, including tests that originate from no-namespaced unlocked packages, are run. The tests that originate from installed managed packages and namespaced unlocked packages aren't run. This test level is the default for production deployments that include Apex classes or triggers.
110+
- RunAllTestsInOrg — All tests are run. The tests include all tests in your org.
86111

87112
# flags.wait.summary
88113

0 commit comments

Comments
 (0)