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/package.json b/package.json index 640c5c75..ce18047e 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.8", + "@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/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); diff --git a/yarn.lock b/yarn.lock index ffcd2d9e..5899a9ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1508,10 +1508,10 @@ resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== -"@salesforce/apex-node@^8.3.8": - version "8.3.8" - resolved "https://registry.yarnpkg.com/@salesforce/apex-node/-/apex-node-8.3.8.tgz#fceda4ebb7cb70813bc377ac2ce1682b288e6567" - integrity sha512-dscXGEMc2+/oh1I8nQRn89wUnzGuyph2cyY1Lu3pNu/wh4ivrwzEm0fNJ3YHylVcOqDtujc8fKIKU0wZlJBddg== +"@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"