From 71576db2e9354e0ddcb2e9f660b1ec1641916053 Mon Sep 17 00:00:00 2001 From: Joshua Feingold Date: Fri, 21 Nov 2025 11:13:59 -0600 Subject: [PATCH 1/2] feat: adds --poll-interval flag to test command @W-20268166@ --- command-snapshot.json | 3 ++- messages/runtest.md | 4 ++++ src/commands/apex/run/test.ts | 6 ++++++ src/shared/TestRunService.ts | 4 +++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/command-snapshot.json b/command-snapshot.json index 4fce687e..8ac0d7a2 100644 --- a/command-snapshot.json +++ b/command-snapshot.json @@ -68,7 +68,7 @@ "testlevel", "u" ], - "flagChars": ["c", "d", "l", "n", "o", "r", "s", "t", "v", "w", "y"], + "flagChars": ["c", "d", "i", "l", "n", "o", "r", "s", "t", "v", "w", "y"], "flags": [ "api-version", "class-names", @@ -78,6 +78,7 @@ "flags-dir", "json", "loglevel", + "poll-interval", "output-dir", "result-format", "suite-names", diff --git a/messages/runtest.md b/messages/runtest.md index 7cf94e00..aae954df 100644 --- a/messages/runtest.md +++ b/messages/runtest.md @@ -127,3 +127,7 @@ Display detailed code coverage per test. # flags.concise.summary Display only failed test results; works with human-readable output only. + +# flags.poll-interval.summary + +Number of seconds to wait between retries. diff --git a/src/commands/apex/run/test.ts b/src/commands/apex/run/test.ts index 39d99ff6..9f066142 100644 --- a/src/commands/apex/run/test.ts +++ b/src/commands/apex/run/test.ts @@ -80,6 +80,12 @@ export default class Test extends SfCommand { description: messages.getMessage('flags.tests.description'), exclusive: exclusiveTestSpecifiers.filter((specifier) => specifier !== 'tests'), }), + 'poll-interval': Flags.duration({ + unit: 'seconds', + char: 'i', + summary: messages.getMessage('flags.poll-interval.summary'), + min: 1, + }), // we want to pass `undefined` to the API // eslint-disable-next-line sf-plugin/flag-min-max-default wait: Flags.duration({ diff --git a/src/shared/TestRunService.ts b/src/shared/TestRunService.ts index ad0b1a15..3e035af7 100644 --- a/src/shared/TestRunService.ts +++ b/src/shared/TestRunService.ts @@ -40,6 +40,7 @@ export type TestRunFlags = { 'result-format'?: string; json?: boolean; 'test-category'?: string[]; + 'poll-interval'?: Duration; }; export type TestRunConfig = { @@ -169,7 +170,8 @@ export class TestRunService { flags.wait && flags.wait.minutes > 0 ? false : !(flags.synchronous && !flags.json), undefined, cancellationToken.token, - flags.wait + flags.wait, + flags['poll-interval'] )) as TestRunIdResult; } catch (e) { throw TestRunService.handleTestingServerError(SfError.wrap(e), flags, testLevel, config); From 26cd5c2d6c53e17be819756201f0cc0c6bb60a3a Mon Sep 17 00:00:00 2001 From: soridalac Date: Wed, 3 Dec 2025 14:13:37 -0800 Subject: [PATCH 2/2] chore: update apex lib --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 17898de7..4306c899 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "author": "Salesforce", "bugs": "https://github.com/forcedotcom/cli/issues", "dependencies": { - "@salesforce/apex-node": "^8.3.7", + "@salesforce/apex-node": "^8.4.0", "@salesforce/core": "^8.23.4", "@salesforce/kit": "^3.2.3", "@salesforce/sf-plugins-core": "^12.2.5", diff --git a/yarn.lock b/yarn.lock index 6880fe30..8cb9fbda 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1493,10 +1493,10 @@ resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== -"@salesforce/apex-node@^8.3.7": - version "8.3.7" - resolved "https://registry.yarnpkg.com/@salesforce/apex-node/-/apex-node-8.3.7.tgz#dadd3efccf86546ee91ae00f62e9885119193ff2" - integrity sha512-Nwyza/zw8JOeCE+nC07zpKQT5Z1hLxVxsVlT4Xd6uq7Oj3GnhTDCXy201vxjRATPySulPyj/KpCQxYliO+H3fw== +"@salesforce/apex-node@^8.4.0": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@salesforce/apex-node/-/apex-node-8.4.0.tgz#20faa5e7f606f7c0ccb5bd9108415691072f7f84" + integrity sha512-zmXfNodRaE8R3tvjSf93db4V2nz7fXD+G9xEaAjLTR+LajNS84SG0bgdKOmD3PT7DHQdyn4r3OaNObTPg6kBEA== dependencies: "@salesforce/core" "^8.23.4" "@salesforce/kit" "^3.2.4"