@salesforce/plugin-apex 3.6.19 → 3.7.1
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.
- package/README.md +55 -6
- package/lib/commands/apex/get/test.js +10 -12
- package/lib/commands/apex/get/test.js.map +1 -1
- package/lib/commands/logic/get/test.d.ts +19 -0
- package/lib/commands/logic/get/test.js +62 -0
- package/lib/commands/logic/get/test.js.map +1 -0
- package/lib/reporters/jsonReporter.d.ts +1 -1
- package/lib/reporters/jsonReporter.js +2 -1
- package/lib/reporters/jsonReporter.js.map +1 -1
- package/lib/reporters/testReporter.d.ts +1 -0
- package/lib/reporters/testReporter.js +11 -11
- package/lib/reporters/testReporter.js.map +1 -1
- package/lib/shared/TestGetBase.d.ts +22 -0
- package/lib/shared/TestGetBase.js +31 -0
- package/lib/shared/TestGetBase.js.map +1 -0
- package/messages/logicgettest.md +39 -0
- package/oclif.manifest.json +501 -342
- package/package.json +15 -7
package/README.md
CHANGED
|
@@ -93,6 +93,7 @@ Happy debugging!
|
|
|
93
93
|
- [`sf apex run`](#sf-apex-run)
|
|
94
94
|
- [`sf apex run test`](#sf-apex-run-test)
|
|
95
95
|
- [`sf apex tail log`](#sf-apex-tail-log)
|
|
96
|
+
- [`sf logic get test`](#sf-logic-get-test)
|
|
96
97
|
|
|
97
98
|
## `sf apex get log`
|
|
98
99
|
|
|
@@ -148,7 +149,7 @@ FLAG DESCRIPTIONS
|
|
|
148
149
|
directory.
|
|
149
150
|
```
|
|
150
151
|
|
|
151
|
-
_See code: [src/commands/apex/get/log.ts](https://github.com/salesforcecli/plugin-apex/blob/3.
|
|
152
|
+
_See code: [src/commands/apex/get/log.ts](https://github.com/salesforcecli/plugin-apex/blob/3.7.1/src/commands/apex/get/log.ts)_
|
|
152
153
|
|
|
153
154
|
## `sf apex get test`
|
|
154
155
|
|
|
@@ -208,7 +209,7 @@ EXAMPLES
|
|
|
208
209
|
me@myorg'
|
|
209
210
|
```
|
|
210
211
|
|
|
211
|
-
_See code: [src/commands/apex/get/test.ts](https://github.com/salesforcecli/plugin-apex/blob/3.
|
|
212
|
+
_See code: [src/commands/apex/get/test.ts](https://github.com/salesforcecli/plugin-apex/blob/3.7.1/src/commands/apex/get/test.ts)_
|
|
212
213
|
|
|
213
214
|
## `sf apex list log`
|
|
214
215
|
|
|
@@ -248,7 +249,7 @@ EXAMPLES
|
|
|
248
249
|
$ sf apex list log --target-org me@my.org
|
|
249
250
|
```
|
|
250
251
|
|
|
251
|
-
_See code: [src/commands/apex/list/log.ts](https://github.com/salesforcecli/plugin-apex/blob/3.
|
|
252
|
+
_See code: [src/commands/apex/list/log.ts](https://github.com/salesforcecli/plugin-apex/blob/3.7.1/src/commands/apex/list/log.ts)_
|
|
252
253
|
|
|
253
254
|
## `sf apex run`
|
|
254
255
|
|
|
@@ -295,7 +296,7 @@ EXAMPLES
|
|
|
295
296
|
$ sf apex run
|
|
296
297
|
```
|
|
297
298
|
|
|
298
|
-
_See code: [src/commands/apex/run.ts](https://github.com/salesforcecli/plugin-apex/blob/3.
|
|
299
|
+
_See code: [src/commands/apex/run.ts](https://github.com/salesforcecli/plugin-apex/blob/3.7.1/src/commands/apex/run.ts)_
|
|
299
300
|
|
|
300
301
|
## `sf apex run test`
|
|
301
302
|
|
|
@@ -438,7 +439,7 @@ FLAG DESCRIPTIONS
|
|
|
438
439
|
--tests Test1 --tests Test2
|
|
439
440
|
```
|
|
440
441
|
|
|
441
|
-
_See code: [src/commands/apex/run/test.ts](https://github.com/salesforcecli/plugin-apex/blob/3.
|
|
442
|
+
_See code: [src/commands/apex/run/test.ts](https://github.com/salesforcecli/plugin-apex/blob/3.7.1/src/commands/apex/run/test.ts)_
|
|
442
443
|
|
|
443
444
|
## `sf apex tail log`
|
|
444
445
|
|
|
@@ -481,6 +482,54 @@ EXAMPLES
|
|
|
481
482
|
$ sf apex tail log --color --skip-trace-flag
|
|
482
483
|
```
|
|
483
484
|
|
|
484
|
-
_See code: [src/commands/apex/tail/log.ts](https://github.com/salesforcecli/plugin-apex/blob/3.
|
|
485
|
+
_See code: [src/commands/apex/tail/log.ts](https://github.com/salesforcecli/plugin-apex/blob/3.7.1/src/commands/apex/tail/log.ts)_
|
|
486
|
+
|
|
487
|
+
## `sf logic get test`
|
|
488
|
+
|
|
489
|
+
Get the results of a test run.
|
|
490
|
+
|
|
491
|
+
```
|
|
492
|
+
USAGE
|
|
493
|
+
$ sf logic get test -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>]
|
|
494
|
+
[--detailed-coverage -c] [-d <value>] [-r human|tap|junit|json] [--concise]
|
|
495
|
+
|
|
496
|
+
FLAGS
|
|
497
|
+
-c, --code-coverage Retrieve code coverage results.
|
|
498
|
+
-d, --output-dir=<value> Directory in which to store test result files.
|
|
499
|
+
-i, --test-run-id=<value> (required) ID of the test run.
|
|
500
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
501
|
+
configuration variable is already set.
|
|
502
|
+
-r, --result-format=<option> [default: human] Format of the test results.
|
|
503
|
+
<options: human|tap|junit|json>
|
|
504
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
505
|
+
--concise Display only failed test results; works with human-readable output only.
|
|
506
|
+
--detailed-coverage Display detailed code coverage per test.
|
|
507
|
+
|
|
508
|
+
GLOBAL FLAGS
|
|
509
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
510
|
+
--json Format output as json.
|
|
511
|
+
|
|
512
|
+
DESCRIPTION
|
|
513
|
+
Get the results of a test run.
|
|
514
|
+
|
|
515
|
+
When you run 'sf logic run test' to test Apex classes and Flows asynchronously, it returns a test run ID. Use that ID
|
|
516
|
+
with this command to see the results.
|
|
517
|
+
|
|
518
|
+
To see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level
|
|
519
|
+
summary of the test run and the code coverage values for classes in your org. If you specify human-readable result
|
|
520
|
+
format, use the --detailed-coverage flag to see detailed coverage results for each test method run.
|
|
521
|
+
|
|
522
|
+
EXAMPLES
|
|
523
|
+
Get the results for a specific test run ID in the default human-readable format; uses your default org:
|
|
524
|
+
|
|
525
|
+
$ sf logic get test --test-run-id <test run id>
|
|
526
|
+
|
|
527
|
+
Get the results for a specific test run ID, format them as JUnit, and save them to the "test-results/junit"
|
|
528
|
+
directory; uses the org with alias "my-scratch":
|
|
529
|
+
|
|
530
|
+
$ sf logic get test --test-run-id <test run id> --result-format junit --target-org my-scratch
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
_See code: [src/commands/logic/get/test.ts](https://github.com/salesforcecli/plugin-apex/blob/3.7.1/src/commands/logic/get/test.ts)_
|
|
485
534
|
|
|
486
535
|
<!-- commandsstop -->
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
* Licensed under the BSD 3-Clause license.
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, requiredOrgFlagWithDeprecations, SfCommand, Ux, } from '@salesforce/sf-plugins-core';
|
|
7
|
+
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, requiredOrgFlagWithDeprecations, SfCommand, } from '@salesforce/sf-plugins-core';
|
|
9
8
|
import { Messages } from '@salesforce/core';
|
|
10
|
-
import { TestReporter } from '../../../reporters/index.js';
|
|
11
9
|
import { codeCoverageFlag, resultFormatFlag } from '../../../flags.js';
|
|
10
|
+
import { TestGetBase } from '../../../shared/TestGetBase.js';
|
|
12
11
|
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
13
12
|
const messages = Messages.loadMessages('@salesforce/plugin-apex', 'gettest');
|
|
14
13
|
export default class Test extends SfCommand {
|
|
@@ -48,17 +47,16 @@ export default class Test extends SfCommand {
|
|
|
48
47
|
};
|
|
49
48
|
async run() {
|
|
50
49
|
const { flags } = await this.parse(Test);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
'result-format': flags['result-format'],
|
|
50
|
+
return TestGetBase.execute({
|
|
51
|
+
connection: flags['target-org'].getConnection(flags['api-version']),
|
|
52
|
+
testRunId: flags['test-run-id'],
|
|
53
|
+
codeCoverage: flags['code-coverage'],
|
|
54
|
+
outputDir: flags['output-dir'],
|
|
55
|
+
resultFormat: flags['result-format'],
|
|
58
56
|
json: flags.json,
|
|
59
|
-
|
|
60
|
-
'detailed-coverage': flags['detailed-coverage'],
|
|
57
|
+
detailedCoverage: flags['detailed-coverage'],
|
|
61
58
|
concise: flags.concise,
|
|
59
|
+
jsonEnabled: this.jsonEnabled(),
|
|
62
60
|
});
|
|
63
61
|
}
|
|
64
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../../src/commands/apex/get/test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../../src/commands/apex/get/test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,EACL,QAAQ,EACR,iCAAiC,EACjC,+BAA+B,EAC/B,SAAS,GACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;AAC7E,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAAoB;IAC7C,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,S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AAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEzC,OAAO,WAAW,CAAC,OAAO,CAAC;YACzB,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YACnE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC;YAC/B,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC;YACpC,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;YAC9B,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC;YACpC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,gBAAgB,EAAE,KAAK,CAAC,mBAAmB,CAAC;YAC5C,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;SAChC,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { RunResult } from '../../../reporters/index.js';
|
|
3
|
+
export default class TestLogic extends SfCommand<RunResult> {
|
|
4
|
+
static readonly summary: string;
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
loglevel: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'test-run-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'code-coverage': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'detailed-coverage': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'output-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'result-format': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
concise: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<RunResult>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { Flags, loglevel, orgApiVersionFlagWithDeprecations, requiredOrgFlagWithDeprecations, SfCommand, } from '@salesforce/sf-plugins-core';
|
|
8
|
+
import { Messages } from '@salesforce/core';
|
|
9
|
+
import { codeCoverageFlag, resultFormatFlag } from '../../../flags.js';
|
|
10
|
+
import { TestGetBase } from '../../../shared/TestGetBase.js';
|
|
11
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
12
|
+
const messages = Messages.loadMessages('@salesforce/plugin-apex', 'logicgettest');
|
|
13
|
+
export default class TestLogic extends SfCommand {
|
|
14
|
+
static summary = messages.getMessage('summary');
|
|
15
|
+
static description = messages.getMessage('description');
|
|
16
|
+
static examples = messages.getMessages('examples');
|
|
17
|
+
static flags = {
|
|
18
|
+
'target-org': requiredOrgFlagWithDeprecations,
|
|
19
|
+
'api-version': orgApiVersionFlagWithDeprecations,
|
|
20
|
+
loglevel,
|
|
21
|
+
'test-run-id': Flags.salesforceId({
|
|
22
|
+
deprecateAliases: true,
|
|
23
|
+
aliases: ['testrunid'],
|
|
24
|
+
char: 'i',
|
|
25
|
+
summary: messages.getMessage('flags.test-run-id.summary'),
|
|
26
|
+
required: true,
|
|
27
|
+
startsWith: '707',
|
|
28
|
+
length: 'both',
|
|
29
|
+
}),
|
|
30
|
+
'code-coverage': codeCoverageFlag,
|
|
31
|
+
'detailed-coverage': Flags.boolean({
|
|
32
|
+
summary: messages.getMessage('flags.detailed-coverage.summary'),
|
|
33
|
+
dependsOn: ['code-coverage'],
|
|
34
|
+
}),
|
|
35
|
+
'output-dir': Flags.directory({
|
|
36
|
+
aliases: ['outputdir', 'output-directory'],
|
|
37
|
+
deprecateAliases: true,
|
|
38
|
+
char: 'd',
|
|
39
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
|
40
|
+
}),
|
|
41
|
+
'result-format': resultFormatFlag,
|
|
42
|
+
concise: Flags.boolean({
|
|
43
|
+
summary: messages.getMessage('flags.concise.summary'),
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
async run() {
|
|
47
|
+
const { flags } = await this.parse(TestLogic);
|
|
48
|
+
return TestGetBase.execute({
|
|
49
|
+
connection: flags['target-org'].getConnection(flags['api-version']),
|
|
50
|
+
testRunId: flags['test-run-id'],
|
|
51
|
+
codeCoverage: flags['code-coverage'],
|
|
52
|
+
outputDir: flags['output-dir'],
|
|
53
|
+
resultFormat: flags['result-format'],
|
|
54
|
+
json: flags.json,
|
|
55
|
+
detailedCoverage: false,
|
|
56
|
+
concise: flags.concise,
|
|
57
|
+
jsonEnabled: this.jsonEnabled(),
|
|
58
|
+
isUnifiedLogic: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../../src/commands/logic/get/test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,EACL,QAAQ,EACR,iCAAiC,EACjC,+BAA+B,EAC/B,SAAS,GACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,gBA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AE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;SACzD,CAAC;QACF,eAAe,EAAE,gBAAgB;QACjC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;YACrB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;SACtD,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAE9C,OAAO,WAAW,CAAC,OAAO,CAAC;YACzB,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YACnE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC;YAC/B,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC;YACpC,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC;YAC9B,YAAY,EAAE,KAAK,CAAC,eAAe,CAAC;YACpC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,gBAAgB,EAAE,KAAK;YACvB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;YAC/B,cAAc,EAAE,IAAI;SACrB,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class JsonReporter {
|
|
2
|
-
format(result) {
|
|
2
|
+
format(result, includeCategory = false) {
|
|
3
3
|
const returnObject = {
|
|
4
4
|
summary: {
|
|
5
5
|
// result.summary contains more information than we want to return, so we'll specify each key we want to return instead of using ...
|
|
@@ -35,6 +35,7 @@ export class JsonReporter {
|
|
|
35
35
|
},
|
|
36
36
|
RunTime: test.runTime,
|
|
37
37
|
FullName: test.fullName,
|
|
38
|
+
...(includeCategory ? { Category: test.category } : {}),
|
|
38
39
|
})),
|
|
39
40
|
...(result.codecoverage
|
|
40
41
|
? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonReporter.js","sourceRoot":"","sources":["../../src/reporters/jsonReporter.ts"],"names":[],"mappings":"AAsFA,MAAM,OAAO,YAAY;IAChB,MAAM,CAAC,MAAkB;
|
|
1
|
+
{"version":3,"file":"jsonReporter.js","sourceRoot":"","sources":["../../src/reporters/jsonReporter.ts"],"names":[],"mappings":"AAsFA,MAAM,OAAO,YAAY;IAChB,MAAM,CAAC,MAAkB,EAAE,kBAA2B,KAAK;QAChE,MAAM,YAAY,GAAc;YAC9B,OAAO,EAAE;gBACP,oIAAoI;gBACpI,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;gBACjC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO;gBAC/B,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;gBACjC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK;gBAC3B,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAkC;gBAC1D,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;gBACjC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO;gBAC/B,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO;gBAC/B,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS;gBACnC,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa;gBAC3C,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;gBACjC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;gBAC7B,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ;gBACjC,WAAW,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,KAAK;gBACnD,iBAAiB,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,KAAK;gBAC/D,aAAa,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,KAAK;aACxD;YACD,KAAK,EAAE,MAAM,CAAC,KA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E;wBAC5C,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;4BACxB,aAAa,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;4BACzD,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;4BACnE,cAAc,EAAE,IAAI,CAAC,UAAU;4BAC/B,eAAe,EAAE,WAAW,CAAC,eAAe;4BAC5C,kBAAkB,EAAE;gCAClB,EAAE,EAAE,WAAW,CAAC,oBAAoB;gCACpC,IAAI,EAAE,WAAW,CAAC,sBAAsB;6BACzC;4BACD,iBAAiB,EAAE,WAAW,CAAC,iBAAiB;yBACjD,CAAC,CAAC;oBACL,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -25,8 +25,8 @@ export class TestReporter {
|
|
|
25
25
|
}
|
|
26
26
|
async report(result, options) {
|
|
27
27
|
if (options['output-dir']) {
|
|
28
|
-
const jsonOutput = this.formatResultInJson(result);
|
|
29
|
-
const outputDirConfig = this.buildOutputDirConfig(result, jsonOutput, options['output-dir'], options['result-format'], Boolean(options['detailed-coverage']), options.concise, options.synchronous);
|
|
28
|
+
const jsonOutput = this.formatResultInJson(result, options.isUnifiedLogic);
|
|
29
|
+
const outputDirConfig = this.buildOutputDirConfig(result, jsonOutput, options['output-dir'], options['result-format'], Boolean(options['detailed-coverage']), options.concise, options.synchronous, options.isUnifiedLogic);
|
|
30
30
|
const testService = new TestService(this.connection);
|
|
31
31
|
await testService.writeResultFiles(result, outputDirConfig, options['code-coverage']);
|
|
32
32
|
}
|
|
@@ -36,7 +36,7 @@ export class TestReporter {
|
|
|
36
36
|
}
|
|
37
37
|
switch (options['result-format']) {
|
|
38
38
|
case 'human':
|
|
39
|
-
this.logHuman(result, options['detailed-coverage'], options['concise'], options['output-dir']);
|
|
39
|
+
this.logHuman(result, options['detailed-coverage'], options['concise'], options['output-dir'], options.isUnifiedLogic);
|
|
40
40
|
break;
|
|
41
41
|
case 'tap':
|
|
42
42
|
this.logTap(result);
|
|
@@ -49,7 +49,7 @@ export class TestReporter {
|
|
|
49
49
|
if (!options.json) {
|
|
50
50
|
this.ux.styledJSON({
|
|
51
51
|
status: process.exitCode,
|
|
52
|
-
result: this.formatResultInJson(result),
|
|
52
|
+
result: this.formatResultInJson(result, options.isUnifiedLogic),
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
break;
|
|
@@ -61,7 +61,7 @@ export class TestReporter {
|
|
|
61
61
|
this.ux.styledJSON(result);
|
|
62
62
|
throw messages.createError('testResultProcessErr', [e.message]);
|
|
63
63
|
}
|
|
64
|
-
return this.formatResultInJson(result);
|
|
64
|
+
return this.formatResultInJson(result, options.isUnifiedLogic);
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Builds output directory configuration with CLI format result files
|
|
@@ -75,7 +75,7 @@ export class TestReporter {
|
|
|
75
75
|
* @returns Output directory configuration
|
|
76
76
|
*/
|
|
77
77
|
// eslint-disable-next-line class-methods-use-this
|
|
78
|
-
buildOutputDirConfig(result, jsonOutput, outputDir, resultFormat, detailedCoverage, concise, synchronous = false) {
|
|
78
|
+
buildOutputDirConfig(result, jsonOutput, outputDir, resultFormat, detailedCoverage, concise, synchronous = false, isUnifiedLogic) {
|
|
79
79
|
const outputDirConfig = {
|
|
80
80
|
dirPath: outputDir,
|
|
81
81
|
};
|
|
@@ -118,7 +118,7 @@ export class TestReporter {
|
|
|
118
118
|
case ResultFormat.human:
|
|
119
119
|
outputDirConfig.fileInfos?.push({
|
|
120
120
|
filename: 'test-result.txt',
|
|
121
|
-
content: new HumanReporter().format(result, detailedCoverage, concise),
|
|
121
|
+
content: new HumanReporter().format(result, detailedCoverage, concise, isUnifiedLogic),
|
|
122
122
|
});
|
|
123
123
|
break;
|
|
124
124
|
default:
|
|
@@ -127,22 +127,22 @@ export class TestReporter {
|
|
|
127
127
|
}
|
|
128
128
|
return outputDirConfig;
|
|
129
129
|
}
|
|
130
|
-
formatResultInJson(result) {
|
|
130
|
+
formatResultInJson(result, isUnifiedLogic) {
|
|
131
131
|
try {
|
|
132
132
|
const reporter = new JsonReporter();
|
|
133
|
-
return reporter.format(result);
|
|
133
|
+
return reporter.format(result, isUnifiedLogic);
|
|
134
134
|
}
|
|
135
135
|
catch (e) {
|
|
136
136
|
this.ux.styledJSON(result);
|
|
137
137
|
throw messages.createError('testResultProcessErr', [e.message]);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
logHuman(result, detailedCoverage, concise, outputDir) {
|
|
140
|
+
logHuman(result, detailedCoverage, concise, outputDir, isUnifiedLogic) {
|
|
141
141
|
if (outputDir) {
|
|
142
142
|
this.ux.log(messages.getMessage('outputDirHint', [outputDir]));
|
|
143
143
|
}
|
|
144
144
|
const humanReporter = new HumanReporter();
|
|
145
|
-
const output = humanReporter.format(result, detailedCoverage, concise);
|
|
145
|
+
const output = humanReporter.format(result, detailedCoverage, concise, isUnifiedLogic);
|
|
146
146
|
this.ux.log(output);
|
|
147
147
|
}
|
|
148
148
|
logTap(result) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testReporter.js","sourceRoot":"","sources":["../../src/reporters/testReporter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EAEb,YAAY,EACZ,WAAW,EAGX,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAc,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAa,MAAM,mBAAmB,CAAC;AAE5D,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAA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QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,CAAC;QAChD,IAAI,QAAQ,EAAE,CAAC;YACb,UAAU,IAAI,OAAO,QAAQ,EAAE,CAAC;QAClC,CAAC;QACD,OAAO,QAAQ,CAAC,UAAU,CAAC,0BAA0B,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Connection } from '@salesforce/core';
|
|
2
|
+
import { RunResult } from '../reporters/index.js';
|
|
3
|
+
export type TestGetBaseOptions = {
|
|
4
|
+
connection: Connection;
|
|
5
|
+
testRunId: string;
|
|
6
|
+
codeCoverage?: boolean;
|
|
7
|
+
outputDir?: string;
|
|
8
|
+
resultFormat?: string;
|
|
9
|
+
json?: boolean;
|
|
10
|
+
detailedCoverage?: boolean;
|
|
11
|
+
concise?: boolean;
|
|
12
|
+
isUnifiedLogic?: boolean;
|
|
13
|
+
testCategory?: string;
|
|
14
|
+
jsonEnabled: boolean;
|
|
15
|
+
additionalReportOptions?: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Common logic for getting test results.
|
|
19
|
+
*/
|
|
20
|
+
export declare class TestGetBase {
|
|
21
|
+
static execute(options: TestGetBaseOptions): Promise<RunResult>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { TestService } from '@salesforce/apex-node';
|
|
8
|
+
import { Ux } from '@salesforce/sf-plugins-core';
|
|
9
|
+
import { TestReporter } from '../reporters/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Common logic for getting test results.
|
|
12
|
+
*/
|
|
13
|
+
export class TestGetBase {
|
|
14
|
+
static async execute(options) {
|
|
15
|
+
const { connection, testRunId, codeCoverage, outputDir, resultFormat, json, detailedCoverage, concise, jsonEnabled, isUnifiedLogic } = options;
|
|
16
|
+
const testService = new TestService(connection);
|
|
17
|
+
const result = await testService.reportAsyncResults(testRunId, codeCoverage);
|
|
18
|
+
const testReporter = new TestReporter(new Ux({ jsonEnabled }), connection);
|
|
19
|
+
const reportOptions = {
|
|
20
|
+
'output-dir': outputDir,
|
|
21
|
+
'result-format': resultFormat,
|
|
22
|
+
json,
|
|
23
|
+
'code-coverage': codeCoverage,
|
|
24
|
+
'detailed-coverage': detailedCoverage,
|
|
25
|
+
concise: concise ?? false,
|
|
26
|
+
isUnifiedLogic
|
|
27
|
+
};
|
|
28
|
+
return testReporter.report(result, reportOptions);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=TestGetBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestGetBase.js","sourceRoot":"","sources":["../../src/shared/TestGetBase.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AACjD,OAAO,EAAa,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAiBhE;;GAEG;AACH,MAAM,OAAO,WAAW;IACf,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAA2B;QACrD,MAAM,EACJ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,cAAc,EACf,GAAG,OAAO,CAAC;QAEZ,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,kBAAkB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAE7E,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;QAE3E,MAAM,aAAa,GAAG;YACpB,YAAY,EAAE,SAAS;YACvB,eAAe,EAAE,YAAY;YAC7B,IAAI;YACJ,eAAe,EAAE,YAAY;YAC7B,mBAAmB,EAAE,gBAAgB;YACrC,OAAO,EAAE,OAAO,IAAI,KAAK;YACzB,cAAc;SACf,CAAC;QAEF,OAAO,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Get the results of a test run.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
When you run 'sf logic run test' to test Apex classes and Flows asynchronously, it returns a test run ID. Use that ID with this command to see the results.
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
# examples
|
|
12
|
+
|
|
13
|
+
- Get the results for a specific test run ID in the default human-readable format; uses your default org:
|
|
14
|
+
|
|
15
|
+
<%= config.bin %> <%= command.id %> --test-run-id <test run id>
|
|
16
|
+
|
|
17
|
+
- Get the results for a specific test run ID, format them as JUnit, and save them to the "test-results/junit" directory; uses the org with alias "my-scratch":
|
|
18
|
+
|
|
19
|
+
<%= config.bin %> <%= command.id %> --test-run-id <test run id> --result-format junit --target-org my-scratch
|
|
20
|
+
|
|
21
|
+
# flags.test-run-id.summary
|
|
22
|
+
|
|
23
|
+
ID of the test run.
|
|
24
|
+
|
|
25
|
+
# flags.output-dir.summary
|
|
26
|
+
|
|
27
|
+
Directory in which to store test result files.
|
|
28
|
+
|
|
29
|
+
# flags.concise.summary
|
|
30
|
+
|
|
31
|
+
Display only failed test results; works with human-readable output only.
|
|
32
|
+
|
|
33
|
+
# apexLibErr
|
|
34
|
+
|
|
35
|
+
Unknown error in Apex Library: %s
|
|
36
|
+
|
|
37
|
+
# flags.detailed-coverage.summary
|
|
38
|
+
|
|
39
|
+
Display detailed code coverage per test.
|