Skip to content

Commit e10f85d

Browse files
authored
Merge pull request #832 from salesforcecli/jf/W-20268166
feat: adds --poll-interval flag to test command @W-20268166@
2 parents 0eeab36 + 2bf6660 commit e10f85d

File tree

6 files changed

+20
-7
lines changed

6 files changed

+20
-7
lines changed

command-snapshot.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"testlevel",
6969
"u"
7070
],
71-
"flagChars": ["c", "d", "l", "n", "o", "r", "s", "t", "v", "w", "y"],
71+
"flagChars": ["c", "d", "i", "l", "n", "o", "r", "s", "t", "v", "w", "y"],
7272
"flags": [
7373
"api-version",
7474
"class-names",
@@ -78,6 +78,7 @@
7878
"flags-dir",
7979
"json",
8080
"loglevel",
81+
"poll-interval",
8182
"output-dir",
8283
"result-format",
8384
"suite-names",

messages/runtest.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,7 @@ 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+
# flags.poll-interval.summary
132+
133+
Number of seconds to wait between retries.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {
8-
"@salesforce/apex-node": "^8.3.8",
8+
"@salesforce/apex-node": "^8.4.0",
99
"@salesforce/core": "^8.23.4",
1010
"@salesforce/kit": "^3.2.3",
1111
"@salesforce/sf-plugins-core": "^12.2.5",

src/commands/apex/run/test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ export default class Test extends SfCommand<RunCommandResult> {
8080
description: messages.getMessage('flags.tests.description'),
8181
exclusive: exclusiveTestSpecifiers.filter((specifier) => specifier !== 'tests'),
8282
}),
83+
'poll-interval': Flags.duration({
84+
unit: 'seconds',
85+
char: 'i',
86+
summary: messages.getMessage('flags.poll-interval.summary'),
87+
min: 1,
88+
}),
8389
// we want to pass `undefined` to the API
8490
// eslint-disable-next-line sf-plugin/flag-min-max-default
8591
wait: Flags.duration({

src/shared/TestRunService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export type TestRunFlags = {
4040
'result-format'?: string;
4141
json?: boolean;
4242
'test-category'?: string[];
43+
'poll-interval'?: Duration;
4344
};
4445

4546
export type TestRunConfig = {
@@ -169,7 +170,8 @@ export class TestRunService {
169170
flags.wait && flags.wait.minutes > 0 ? false : !(flags.synchronous && !flags.json),
170171
undefined,
171172
cancellationToken.token,
172-
flags.wait
173+
flags.wait,
174+
flags['poll-interval']
173175
)) as TestRunIdResult;
174176
} catch (e) {
175177
throw TestRunService.handleTestingServerError(SfError.wrap(e), flags, testLevel, config);

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,10 +1508,10 @@
15081508
resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8"
15091509
integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==
15101510

1511-
"@salesforce/apex-node@^8.3.8":
1512-
version "8.3.8"
1513-
resolved "https://registry.yarnpkg.com/@salesforce/apex-node/-/apex-node-8.3.8.tgz#fceda4ebb7cb70813bc377ac2ce1682b288e6567"
1514-
integrity sha512-dscXGEMc2+/oh1I8nQRn89wUnzGuyph2cyY1Lu3pNu/wh4ivrwzEm0fNJ3YHylVcOqDtujc8fKIKU0wZlJBddg==
1511+
"@salesforce/apex-node@^8.4.0":
1512+
version "8.4.0"
1513+
resolved "https://registry.yarnpkg.com/@salesforce/apex-node/-/apex-node-8.4.0.tgz#20faa5e7f606f7c0ccb5bd9108415691072f7f84"
1514+
integrity sha512-zmXfNodRaE8R3tvjSf93db4V2nz7fXD+G9xEaAjLTR+LajNS84SG0bgdKOmD3PT7DHQdyn4r3OaNObTPg6kBEA==
15151515
dependencies:
15161516
"@salesforce/core" "^8.23.4"
15171517
"@salesforce/kit" "^3.2.4"

0 commit comments

Comments
 (0)