Skip to content

Commit 71576db

Browse files
committed
feat: adds --poll-interval flag to test command @W-20268166@
1 parent 98f56e5 commit 71576db

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
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.

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);

0 commit comments

Comments
 (0)