@salesforce/plugin-apex 2.3.14 → 2.3.16

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.
Files changed (3) hide show
  1. package/README.md +239 -226
  2. package/oclif.manifest.json +1 -1
  3. package/package.json +12 -12
package/README.md CHANGED
@@ -87,334 +87,347 @@ Happy debugging!
87
87
 
88
88
  <!-- commands -->
89
89
 
90
- The available commands in the Apex plugin:
91
- <br /><br />
90
+ - [`sfdx apex:get:log`](#sfdx-apexgetlog)
91
+ - [`sfdx apex:get:test`](#sfdx-apexgettest)
92
+ - [`sfdx apex:list:log`](#sfdx-apexlistlog)
93
+ - [`sfdx apex:run`](#sfdx-apexrun)
94
+ - [`sfdx apex:run:test`](#sfdx-apexruntest)
95
+ - [`sfdx apex:tail:log`](#sfdx-apextaillog)
92
96
 
93
- ### `sfdx force:apex:log:get`
97
+ ## `sfdx apex:get:log`
94
98
 
95
- fetch debug logs
99
+ Fetch the specified log or given number of most recent logs from the org.
96
100
 
97
101
  ```
98
102
  USAGE
99
- $ sfdx force:apex:log:get [-i <id>] [-n <number>] [-d <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
100
- trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
103
+ $ sfdx apex:get:log -o <value> [--json] [--api-version <value>] [-i <value>] [-n <value>] [-d <value>]
101
104
 
102
- OPTIONS
103
- -d, --outputdir=outputdir
104
- directory for saving the log files
105
+ FLAGS
106
+ -d, --output-dir=<value> Directory for saving the log files.
107
+ -i, --log-id=<value> ID of the specific log to display.
108
+ -n, --number=<value> Number of the most recent logs to display.
109
+ -o, --target-org=<value> (required) Username or alias of the target org.
110
+ --api-version=<value> Override the api version used for api requests made by this command
105
111
 
106
- -i, --logid=logid
107
- id of the log to display
112
+ GLOBAL FLAGS
113
+ --json Format output as json.
108
114
 
109
- -n, --number=number
110
- number of most recent logs to display
115
+ DESCRIPTION
116
+ Fetch the specified log or given number of most recent logs from the org.
111
117
 
112
- -u, --targetusername=targetusername
113
- username or alias for the target org; overrides default target org
118
+ To get the IDs for your debug logs, run "sfdx apex log list". Executing this command without flags returns the most
119
+ recent log.
114
120
 
115
- --apiversion=apiversion
116
- override the api version used for api requests made by this command
121
+ ALIASES
122
+ $ sfdx force:apex:log:get
117
123
 
118
- --json
119
- format output as JSON
124
+ EXAMPLES
125
+ Fetch the log in your default org using an ID:
120
126
 
121
- --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)
122
- [default: warn] logging level for this command invocation
127
+ $ sfdx apex:get:log --log-id <log id>
123
128
 
124
- DESCRIPTION
125
- Fetches the specified log or given number of most recent logs from the scratch
126
- org.
127
- To get the IDs for your debug logs, run "sfdx force:apex:log:list".
128
- Use the --logid parameter to return a specific log.
129
- Use the --number parameter to return the specified number of recent logs.
130
- Use the --outputdir parameter to specify the directory to store the logs in.
131
- Executing this command without parameters returns the most recent log.
129
+ Fetch the log in the org with the specified username using an ID:
132
130
 
133
- EXAMPLES
134
- $ sfdx force:apex:log:get -i <log id>
135
- $ sfdx force:apex:log:get -i <log id> -u me@my.org
136
- $ sfdx force:apex:log:get -n 2 -c
137
- $ sfdx force:apex:log:get -d Users/Desktop/logs -n 2
131
+ $ sfdx apex:get:log --log-id <log id> --target-org me@my.org
132
+
133
+ Fetch the two most recent logs in your default org:
134
+
135
+ $ sfdx apex:get:log --number 2
136
+
137
+ Similar to previous example, but save the two log files in the specified directory:
138
+
139
+ $ sfdx apex:get:log --output-dir /Users/sfdxUser/logs --number 2
140
+
141
+ FLAG DESCRIPTIONS
142
+ -d, --output-dir=<value> Directory for saving the log files.
143
+
144
+ The location can be an absolute path or relative to the current working directory. The default is the current
145
+ directory.
138
146
  ```
139
147
 
140
- _See code: [force/apex/log/log.ts](https://github.com/salesforcecli/plugin-apex/blob/main/src/commands/force/apex/log/get.ts)_
141
- <br /><br />
148
+ _See code: [src/commands/apex/get/log.ts](https://github.com/salesforcecli/plugin-apex/blob/2.3.16/src/commands/apex/get/log.ts)_
142
149
 
143
- ### `sfdx force:apex:log:list`
150
+ ## `sfdx apex:get:test`
144
151
 
145
- display a list of IDs and general information about debug logs
152
+ Display test results for a specific asynchronous test run.
146
153
 
147
154
  ```
148
155
  USAGE
149
- $ sfdx force:apex:log:list [-u <string>] [--apiversion <string>] [--json] [--loglevel
150
- trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
156
+ $ sfdx apex:get:test -o <value> -i <value> [--json] [--api-version <value>] [-c] [-d <value>] [-r
157
+ human|tap|junit|json]
151
158
 
152
- OPTIONS
153
- -u, --targetusername=targetusername
154
- username or alias for the target org; overrides default target org
159
+ FLAGS
160
+ -c, --code-coverage Retrieve code coverage results.
161
+ -d, --output-dir=<value> Directory in which to store test result files.
162
+ -i, --test-run-id=<value> (required) ID of the test run.
163
+ -o, --target-org=<value> (required) Username or alias of the target org.
164
+ -r, --result-format=<option> [default: human] Format of the results.
165
+ <options: human|tap|junit|json>
166
+ --api-version=<value> Override the api version used for api requests made by this command
155
167
 
156
- --apiversion=apiversion
157
- override the api version used for api requests made by this command
168
+ GLOBAL FLAGS
169
+ --json Format output as json.
158
170
 
159
- --json
160
- format output as JSON
171
+ DESCRIPTION
172
+ Display test results for a specific asynchronous test run.
161
173
 
162
- --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)
163
- [default: warn] logging level for this command invocation
174
+ Provide a test run ID to display test results for an enqueued or completed asynchronous test run. The test run ID is
175
+ displayed after running the "sfdx apex test run" command.
164
176
 
165
- DESCRIPTION
166
- Test this command in a project to list the IDs and general information for all debug logs
167
- in your default org.
168
- To fetch a specific log from your org, obtain the ID from this command's output, then run
169
- the “sfdx force:apex:log:get” command.
177
+ ALIASES
178
+ $ sfdx force:apex:test:report
170
179
 
171
180
  EXAMPLES
172
- $ sfdx force:apex:log:list
173
- $ sfdx force:apex:log:list -u me@my.org
181
+ Display test results for your default org using a test run ID:
182
+
183
+ $ sfdx apex:get:test --test-run-id <test run id>
184
+
185
+ Similar to previous example, but output the result in JUnit format:
186
+
187
+ $ sfdx apex:get:test --test-run-id <test run id> --result-format junit
188
+
189
+ Also retrieve code coverage results and output in JSON format:
190
+
191
+ $ sfdx apex:get:test --test-run-id <test run id> --code-coverage --json
192
+
193
+ Specify a directory in which to save the test results from the org with the specified username (rather than your
194
+ default org):
195
+
196
+ $ sfdx apex:get:test --test-run-id <test run id> --code-coverage --output-dir <path to outputdir> --target-org \
197
+ me@myorg',
174
198
  ```
175
199
 
176
- _See code: [force/apex/log/log.ts](https://github.com/salesforcecli/plugin-apex/blob/main/src/commands/force/apex/log/list.ts)_
177
- <br /><br />
200
+ _See code: [src/commands/apex/get/test.ts](https://github.com/salesforcecli/plugin-apex/blob/2.3.16/src/commands/apex/get/test.ts)_
178
201
 
179
- ### `sfdx force:apex:log:tail`
202
+ ## `sfdx apex:list:log`
180
203
 
181
- ensures logging is active and returns the logs to the running user
204
+ Display a list of IDs and general information about debug logs.
182
205
 
183
206
  ```
184
207
  USAGE
185
- $ sfdx force:apex:log:list [-u <string>] [--apiversion <string>] [--json] [--loglevel
186
- trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] [-c] [-d <string>] [-s]
208
+ $ sfdx apex:list:log -o <value> [--json] [--api-version <value>]
187
209
 
188
- OPTIONS
189
- -u, --targetusername=targetusername
190
- username or alias for the target org; overrides default target org
210
+ FLAGS
211
+ -o, --target-org=<value> (required) Username or alias of the target org.
212
+ --api-version=<value> Override the api version used for api requests made by this command
191
213
 
192
- --apiversion=apiversion
193
- override the api version used for api requests made by this command
214
+ GLOBAL FLAGS
215
+ --json Format output as json.
216
+
217
+ DESCRIPTION
218
+ Display a list of IDs and general information about debug logs.
194
219
 
195
- --json
196
- format output as JSON
220
+ Run this command in a project to list the IDs and general information for all debug logs in your default org.
197
221
 
198
- --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)
199
- [default: warn] logging level for this command invocation
222
+ To fetch a specific log from your org, obtain the ID from this command's output, then run the “sfdx apex log get”
223
+ command.
200
224
 
201
- -c, --color
202
- colorize noteworthy log lines
225
+ ALIASES
226
+ $ sfdx force:apex:log:list
203
227
 
204
- -d, --debuglevel=debuglevel
205
- debug level for trace flag
228
+ EXAMPLES
229
+ List the IDs and information about the debug logs in your default org:
206
230
 
207
- -s, --skiptraceflag
208
- skip trace flag setup
231
+ $ sfdx apex:list:log
209
232
 
210
- DESCRIPTION
211
- Activates debug logging and displays logs in the terminal. You can also pipe the logs to a file.
212
- To exit logging early, type Ctrl+C into the terminal.
233
+ Similar to previous example, but use the org with the specified username:
213
234
 
214
- EXAMPLES
215
- $ sfdx force:apex:log:tail
216
- $ sfdx force:apex:log:tail --debuglevel MyDebugLevel
217
- $ sfdx force:apex:log:tail -c -s
235
+ $ sfdx apex:list:log --target-org me@my.org
218
236
  ```
219
237
 
220
- _See code: [force/apex/log/log.ts](https://github.com/salesforcecli/plugin-apex/blob/main/src/commands/force/apex/log/tail.ts)_
221
- <br /><br />
238
+ _See code: [src/commands/apex/list/log.ts](https://github.com/salesforcecli/plugin-apex/blob/2.3.16/src/commands/apex/list/log.ts)_
222
239
 
223
- ### `sfdx force:apex:execute`
240
+ ## `sfdx apex:run`
224
241
 
225
- executes anonymous Apex code
242
+ Execute anonymous Apex code entered on the command line or from a local file.
226
243
 
227
244
  ```
228
245
  USAGE
229
- $ sfdx force:apex:execute [-f <filepath>] [-u <string>] [--apiversion <string>] [--json]
230
- [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
231
-
232
- OPTIONS
233
- -f, --apexcodefile=apexcodefile
234
- path to a local file that contains Apex code
246
+ $ sfdx apex:run -o <value> [--json] [--api-version <value>] [-f <value>]
235
247
 
236
- -u, --targetusername=targetusername
237
- username or alias for the target org; overrides default target org
248
+ FLAGS
249
+ -f, --file=<value> Path to a local file that contains Apex code.
250
+ -o, --target-org=<value> (required) Username or alias of the target org.
251
+ --api-version=<value> Override the api version used for api requests made by this command
238
252
 
239
- --apiversion=apiversion
240
- override the api version used for api requests made by this command
253
+ GLOBAL FLAGS
254
+ --json Format output as json.
241
255
 
242
- --json
243
- format output as json
256
+ DESCRIPTION
257
+ Execute anonymous Apex code entered on the command line or from a local file.
244
258
 
245
- --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)
246
- [default: warn] logging level for this command invocation
259
+ If you don’t run this command from within a Salesforce DX project, you must specify the —-target-org flag.
247
260
 
248
- DESCRIPTION
249
- Executes one or more lines of anonymous Apex code entered on the command line, or executes
250
- the code in a local file.
251
- If you don’t run this command from within a Salesforce DX project, —-targetusername is
252
- required.
253
- To execute your code interactively, run this command with no parameters. At the prompt,
254
- enter all your Apex code; press CTRL-D when you're finished. Your code is then executed in
255
- a single execute anonymous request.
261
+ To execute your code interactively, run this command with no flags. At the prompt, enter all your Apex code; press
262
+ CTRL-D when you're finished. Your code is then executed in a single execute anonymous request.
256
263
  For more information, see "Anonymous Blocks" in the Apex Developer Guide.
257
264
 
258
- EXAMPLES
259
- $ sfdx force:apex:execute -u testusername@salesforce.org -f ~/test.apex
260
- $ sfdx force:apex:execute -f ~/test.apex
265
+ ALIASES
261
266
  $ sfdx force:apex:execute
262
- Start typing Apex code. Press the Enter key after each line, then press CTRL+D when
263
- finished.
267
+
268
+ EXAMPLES
269
+ Execute the Apex code that's in the ~/test.apex file in the org with the specified username:
270
+
271
+ $ sfdx apex:run --target-org testusername@salesforce.org --file ~/test.apex
272
+
273
+ Similar to previous example, but execute the code in your default org:
274
+
275
+ $ sfdx apex:run --file ~/test.apex
276
+
277
+ Run the command with no flags to start interactive mode; the code will execute in your default org when you exit. At
278
+ the prompt, start type Apex code and press the Enter key after each line. Press CTRL+D when finished.
279
+
280
+ $ sfdx apex:run
264
281
  ```
265
282
 
266
- _See code: [force/apex/test.ts](https://github.com/salesforcecli/plugin-apex/blob/main/src/commands/force/apex/execute.ts)_
267
- <br /><br />
283
+ _See code: [src/commands/apex/run.ts](https://github.com/salesforcecli/plugin-apex/blob/2.3.16/src/commands/apex/run.ts)_
268
284
 
269
- ### `sfdx force:apex:test:run`
285
+ ## `sfdx apex:run:test`
270
286
 
271
- invoke Apex tests
287
+ Invoke Apex tests in an org.
272
288
 
273
289
  ```
274
290
  USAGE
275
- $ sfdx force:apex:test:run [-d <string>] [-l RunLocalTests|RunAllTestsInOrg|RunSpecifiedTests] [-n <string>] [-r human|tap|junit|json]
276
- [-s <string>] [-t <string>] [-w <string>] [-y] [-v -c] [-u <string>] [--apiversion <string>] [--verbose] [--json]
277
- [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
291
+ $ sfdx apex:run:test -o <value> [--json] [--api-version <value>] [-d <value>] [-l
292
+ RunLocalTests|RunAllTestsInOrg|RunSpecifiedTests] [-n <value> | -s <value> | -t <value>] [-r human|tap|junit|json]
293
+ [-w <value>] [-y] [-v -c]
294
+
295
+ FLAGS
296
+ -c, --code-coverage Retrieve code coverage results.
297
+ -d, --output-dir=<value> Directory in which to store test run files.
298
+ -l, --test-level=<option> Level of tests to run; default is RunLocalTests.
299
+ <options: RunLocalTests|RunAllTestsInOrg|RunSpecifiedTests>
300
+ -n, --class-names=<value>... Apex test class names to run; default is all classes.
301
+ -o, --target-org=<value> (required) Username or alias of the target org.
302
+ -r, --result-format=<option> [default: human] Format of the test results.
303
+ <options: human|tap|junit|json>
304
+ -s, --suite-names=<value>... Apex test suite names to run; default is all suites.
305
+ -t, --tests=<value>... Apex test class names or IDs and, if applicable, test methods to run; default is all
306
+ tests.
307
+ -v, --detailed-coverage Display detailed code coverage per test.
308
+ -w, --wait=<value> Sets the streaming client socket timeout in minutes; specify a longer wait time if
309
+ timeouts occur frequently.
310
+ -y, --synchronous Runs test methods from a single Apex class synchronously; if not specified, tests are
311
+ run asynchronously.
312
+ --api-version=<value> Override the api version used for api requests made by this command
313
+
314
+ GLOBAL FLAGS
315
+ --json Format output as json.
278
316
 
279
- OPTIONS
280
- -c, --codecoverage
281
- runs code coverage and retrieves results
317
+ DESCRIPTION
318
+ Invoke Apex tests in an org.
282
319
 
283
- -d, --outputdir=outputdir
284
- directory to store test run files
320
+ Specify which tests to run by using the --class-names, --suite-names, or --tests flags. Alternatively, use the
321
+ --test-level flag to run all the tests in your org, local tests, or specified tests.
285
322
 
286
- -l, --testlevel=(RunLocalTests|RunAllTestsInOrg|RunSpecifiedTests)
287
- specifies which tests to run, using one of these TestLevel enum values:
288
- RunSpecifiedTests—Only the tests that you specify are run.
289
- RunLocalTests—All tests in your org are run, except the ones that originate from
290
- installed managed packages.
291
- RunAllTestsInOrg—All tests are in your org and in installed managed packages are run
323
+ To see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level
324
+ summary of the test run and the code coverage values for classes in your org. If you specify human-readable result
325
+ format, use the --detailed-coverage flag to see detailed coverage results for each test method run.
292
326
 
293
- -n, --classnames=classnames
294
- comma-separated list of Apex test class names to run; if you select --classnames, you
295
- can't specify --suitenames or --tests
327
+ By default, Apex tests run asynchronously and immediately return a test run ID. You can use the --wait flag to specify
328
+ the number of minutes to wait; if the tests finish in that timeframe, the command displays the results. If the tests
329
+ haven't finished by the end of the wait time, the command displays a test run ID. Use the "sfdx apex get test
330
+ --test-run-id" command to get the results.
296
331
 
297
- -r, --resultformat=(human|tap|junit|json)
298
- Permissible values are: human, tap, junit, json
332
+ NOTE: The testRunCoverage value (JSON and JUnit result formats) is a percentage of the covered lines and total lines
333
+ from all the Apex classes evaluated by the tests in this run.
299
334
 
300
- -s, --suitenames=suitenames
301
- comma-separated list of Apex test suite names to run; if you select --suitenames, you
302
- can't specify --classnames or --tests
335
+ ALIASES
336
+ $ sfdx force:apex:test:run
303
337
 
304
- -t, --tests=tests
305
- comma-separated list of Apex test class names or IDs and, if applicable, test methods to
306
- run; if you specify --tests, you can't specify --classnames or --suitenames
338
+ EXAMPLES
339
+ Run all Apex tests and suites in your default org:
307
340
 
308
- -u, --targetusername=targetusername
309
- username or alias for the target org; overrides default target org
341
+ $ sfdx apex:run:test
310
342
 
311
- -v, --detailedcoverage
312
- display detailed code coverage per test
343
+ Run the specified Apex test classes in your default org and display results in human-readable form:
313
344
 
314
- -w, --wait=wait
315
- sets the streaming client socket timeout in minutes; specify a longer wait time if timeouts occur
316
- frequently
345
+ $ sfdx apex:run:test --class-names MyClassTest --class-names MyOtherClassTest --result-format human
317
346
 
318
- -y, --synchronous
319
- runs test methods from a single Apex class synchronously; if not specified, tests are
320
- run ansynchronously
347
+ Run the specified Apex test suites in your default org and include code coverage results and additional details:
321
348
 
322
- --apiversion=apiversion
323
- override the api version used for api requests made by this command
349
+ $ sfdx apex:run:test --suite-names MySuite --suite-names MyOtherSuite --code-coverage --detailed-coverage
324
350
 
325
- --json
326
- format output as JSON
351
+ Run the specified Apex tests in your default org and display results in human-readable output:
327
352
 
328
- --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)
329
- [default: warn] [default: warn] logging level for this command invocation; logs are
330
- stored in $HOME/.sfdx/sfdx.log
353
+ $ sfdx apex:run:test --tests MyClassTest.testCoolFeature --tests MyClassTest.testAwesomeFeature --tests \
354
+ AnotherClassTest --tests namespace.TheirClassTest.testThis --result-format human
331
355
 
332
- --verbose
333
- display Apex test processing details; if JSON is specified, processing details aren't
334
- displayed
356
+ Run all tests in the org with the specified username with the specified test level; save the output to the specified
357
+ directory:
335
358
 
336
- DESCRIPTION
337
- Specify which tests to run by using the --classnames, --suites, or --tests parameters.
338
- Alternatively, use the --testlevel parameter to run all the tests in your org, local
339
- tests, or specified tests.
340
- To see code coverage results, use the --codecoverage parameter with --resultformat. The
341
- output displays a high-level summary of the test run and the code coverage values for
342
- classes in your org. If you specify human-readable result format, use the
343
- --detailedcoverage parameter to see detailed coverage results for each test method run.
344
- If --codecoverage is not included, code coverage will be skipped during the test run.
345
-
346
- NOTE: The testRunCoverage value (JSON and JUnit result formats) is a percentage of the
347
- covered lines and total lines from all the Apex classes evaluated by the tests in this
348
- run.
359
+ $ sfdx apex:run:test --test-level RunLocalTests --output-dir <path to outputdir> --target-org me@my.org
349
360
 
350
- EXAMPLES
351
- $ sfdx force:apex:test:run
352
- $ sfdx force:apex:test:run -n "MyClassTest,MyOtherClassTest" -r human
353
- $ sfdx force:apex:test:run -s "MySuite,MyOtherSuite" -c -v --json
354
- $ sfdx force:apex:test:run -t
355
- "MyClassTest.testCoolFeature,MyClassTest.testAwesomeFeature,AnotherClassTest,namespace.TheirClassTest.testThis" -r human
356
- $ sfdx force:apex:test:run -l RunLocalTests -d <path to outputdir> -u me@my.org
357
- ```
361
+ FLAG DESCRIPTIONS
362
+ -l, --test-level=RunLocalTests|RunAllTestsInOrg|RunSpecifiedTests Level of tests to run; default is RunLocalTests.
358
363
 
359
- _See code: [force/apex/test/test.ts](https://github.com/salesforcecli/plugin-apex/blob/main/src/commands/force/apex/test/run.ts)_
360
- <br /><br />
364
+ Here's what the levels mean:
361
365
 
362
- ### `sfdx force:apex:test:report`
366
+ - RunSpecifiedTests — Only the tests that you specify are run.
367
+ - RunLocalTests — All tests in your org are run, except the ones that originate from installed managed packages.
368
+ - RunAllTestsInOrg — All tests are in your org and in installed managed packages are run
363
369
 
364
- display test results for a specific asynchronous test run
370
+ -n, --class-names=<value>... Apex test class names to run; default is all classes.
365
371
 
366
- ```
367
- USAGE
368
- $ sfdx force:apex:test:report -i <string> [-c] [-d <string>] [-r human|tap|junit|json] [-w <string>]
369
- [-u <string>] [--apiversion <string>] [--verbose] [--json] [--loglevel
370
- trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
372
+ If you select --class-names, you can't specify --suite-names or --tests.
373
+ For multiple classes, repeat the flag for each.
374
+ --class-names Class1 --class-names Class2
371
375
 
372
- OPTIONS
373
- -c, --codecoverage
374
- retrieves code coverage results
376
+ -s, --suite-names=<value>... Apex test suite names to run; default is all suites.
375
377
 
376
- -d, --outputdir=outputdir
377
- directory to store test result files
378
+ If you select --suite-names, you can't specify --class-names or --tests.
379
+ For multiple suites, repeat the flag for each.
380
+ --suite-names Suite1 --suite-names Suite2
378
381
 
379
- -i, --test-run-id=testrunid
380
- (required) the ID of the test run
382
+ -t, --tests=<value>... Apex test class names or IDs and, if applicable, test methods to run; default is all tests.
381
383
 
382
- -r, --resultformat=(human|tap|junit|json)
383
- Permissible values are: human, tap, junit, json
384
+ If you specify --tests, you can't specify --class-names or --suite-names
385
+ For multiple tests, repeat the flag for each.
386
+ --tests Test1 --tests Test2
387
+ ```
384
388
 
385
- -u, --targetusername=targetusername
386
- username or alias for the target org; overrides default target org
389
+ _See code: [src/commands/apex/run/test.ts](https://github.com/salesforcecli/plugin-apex/blob/2.3.16/src/commands/apex/run/test.ts)_
387
390
 
388
- -w, --wait=wait
389
- sets the streaming client socket timeout in minutes; specify a longer wait time if timeouts occur
390
- frequently
391
+ ## `sfdx apex:tail:log`
391
392
 
392
- --apiversion=apiversion
393
- override the api version used for api requests made by this command
393
+ Activate debug logging and display logs in the terminal.
394
394
 
395
- --json
396
- format output as JSON
395
+ ```
396
+ USAGE
397
+ $ sfdx apex:tail:log -o <value> [--json] [--api-version <value>] [-c] [-d <value> | -s]
397
398
 
398
- --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)
399
- [default: warn] [default: warn] logging level for this command invocation; logs are
400
- stored in $HOME/.sfdx/sfdx.log
399
+ FLAGS
400
+ -c, --color Apply default colors to noteworthy log lines.
401
+ -d, --debug-level=<value> Debug level to set on the DEVELOPER_LOG trace flag for your user.
402
+ -o, --target-org=<value> (required) Username or alias of the target org.
403
+ -s, --skip-trace-flag Skip trace flag setup. Assumes that a trace flag and debug level are fully set up.
404
+ --api-version=<value> Override the api version used for api requests made by this command
401
405
 
402
- --verbose
403
- display Apex test processing details; if JSON is specified, processing details aren't
404
- displayed
406
+ GLOBAL FLAGS
407
+ --json Format output as json.
405
408
 
406
409
  DESCRIPTION
407
- Provide a test run ID to display test results for an enqueued or completed asynchronous
408
- test run. The test run ID is displayed after running the "sfdx force:apex:test:run"
409
- command.
410
+ Activate debug logging and display logs in the terminal.
411
+
412
+ You can also pipe the logs to a file.
413
+
414
+ ALIASES
415
+ $ sfdx force:apex:log:tail
410
416
 
411
417
  EXAMPLES
412
- $ sfdx force:apex:test:report -i <test run id>
413
- $ sfdx force:apex:test:report -i <test run id> -r junit
414
- $ sfdx force:apex:test:report -i <test run id> -c --json
415
- $ sfdx force:apex:test:report -i <test run id> -c -d <path to outputdir> -u me@myorg
418
+ Activate debug logging:
419
+
420
+ $ sfdx apex:tail:log
421
+
422
+ Specify a debug level:
423
+
424
+ $ sfdx apex:tail:log --debug-level MyDebugLevel
425
+
426
+ Skip the trace flag setup and apply default colors:
427
+
428
+ $ sfdx apex:tail:log --color --skip-trace-flag
416
429
  ```
417
430
 
418
- _See code: [force/apex/test/test.ts](https://github.com/salesforcecli/plugin-apex/blob/main/src/commands/force/apex/test/report.ts)_
431
+ _See code: [src/commands/apex/tail/log.ts](https://github.com/salesforcecli/plugin-apex/blob/2.3.16/src/commands/apex/tail/log.ts)_
419
432
 
420
433
  <!-- commandsstop -->
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.3.14",
2
+ "version": "2.3.16",
3
3
  "commands": {
4
4
  "apex:run": {
5
5
  "id": "apex:run",
package/package.json CHANGED
@@ -1,45 +1,45 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-apex",
3
3
  "description": "Apex commands",
4
- "version": "2.3.14",
4
+ "version": "2.3.16",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "main": "lib/index.js",
8
8
  "dependencies": {
9
9
  "@oclif/core": "^2.15.0",
10
10
  "@salesforce/apex-node": "^2.1.0",
11
- "@salesforce/core": "^5.2.6",
11
+ "@salesforce/core": "^5.2.9",
12
12
  "@salesforce/sf-plugins-core": "^3.1.20",
13
13
  "chalk": "^4.1.0",
14
14
  "tslib": "^2"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@oclif/plugin-command-snapshot": "^4.0.14",
18
- "@salesforce/cli-plugins-testkit": "^4.3.1",
18
+ "@salesforce/cli-plugins-testkit": "^4.3.6",
19
19
  "@salesforce/dev-config": "^4.0.1",
20
20
  "@salesforce/dev-scripts": "^5.10.0",
21
- "@salesforce/plugin-command-reference": "^3.0.25",
22
- "@salesforce/plugin-deploy-retrieve": "^1.17.6",
21
+ "@salesforce/plugin-command-reference": "^3.0.34",
22
+ "@salesforce/plugin-deploy-retrieve": "^1.18.0",
23
23
  "@salesforce/prettier-config": "^0.0.3",
24
24
  "@salesforce/ts-sinon": "^1.4.15",
25
25
  "@salesforce/ts-types": "^2.0.7",
26
26
  "@swc/core": "1.3.30",
27
27
  "@typescript-eslint/eslint-plugin": "^5.62.0",
28
28
  "@typescript-eslint/parser": "^5.62.0",
29
- "chai": "^4.3.7",
30
- "eslint": "^8.47.0",
29
+ "chai": "^4.3.8",
30
+ "eslint": "^8.50.0",
31
31
  "eslint-config-prettier": "^8.10.0",
32
32
  "eslint-config-salesforce": "^2.0.2",
33
33
  "eslint-config-salesforce-license": "^0.2.0",
34
34
  "eslint-config-salesforce-typescript": "^1.1.2",
35
35
  "eslint-plugin-header": "^3.1.1",
36
- "eslint-plugin-import": "^2.28.0",
36
+ "eslint-plugin-import": "^2.28.1",
37
37
  "eslint-plugin-jsdoc": "^43.0.5",
38
- "eslint-plugin-sf-plugin": "^1.16.2",
38
+ "eslint-plugin-sf-plugin": "^1.16.5",
39
39
  "husky": "^7.0.4",
40
40
  "mocha": "^9.1.3",
41
41
  "nyc": "^15.1.0",
42
- "oclif": "^3.14.0",
42
+ "oclif": "^3.17.1",
43
43
  "prettier": "^2.8.8",
44
44
  "pretty-quick": "^3.1.0",
45
45
  "shx": "^0.3.4",
@@ -231,7 +231,7 @@
231
231
  }
232
232
  },
233
233
  "sfdx": {
234
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-apex/2.3.14.crt",
235
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-apex/2.3.14.sig"
234
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-apex/2.3.16.crt",
235
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-apex/2.3.16.sig"
236
236
  }
237
237
  }