@testim/testim-cli 3.289.0 → 3.290.0
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/cli.js +22390 -122
- package/cli.js.map +1 -0
- package/npm-shrinkwrap.json +1951 -203
- package/package.json +9 -5
- package/OverrideTestDataBuilder.js +0 -117
- package/agent/routers/cliJsCode/index.js +0 -13
- package/agent/routers/cliJsCode/router.js +0 -63
- package/agent/routers/cliJsCode/service.js +0 -705
- package/agent/routers/codim/router.js +0 -69
- package/agent/routers/codim/router.test.js +0 -60
- package/agent/routers/codim/service.js +0 -193
- package/agent/routers/general/index.js +0 -36
- package/agent/routers/hybrid/registerRoutes.js +0 -81
- package/agent/routers/index.js +0 -56
- package/agent/routers/playground/router.js +0 -77
- package/agent/routers/playground/service.js +0 -96
- package/agent/routers/standalone-browser/registerRoutes.js +0 -47
- package/agent/server.js +0 -150
- package/cdpTestRunner.js +0 -86
- package/chromiumInstaller.js +0 -91
- package/cli/isCiRun.js +0 -10
- package/cli/onExit.js +0 -65
- package/cli/writeStackTrace.js +0 -27
- package/cliAgentMode.js +0 -384
- package/codim/codim-cli.js +0 -91
- package/codim/codim-npm-package/index.ts +0 -427
- package/codim/codim-npm-package/package-lock.json +0 -14
- package/codim/codim-npm-package/package.json +0 -14
- package/codim/hybrid-utils.js +0 -28
- package/codim/measure-perf.js +0 -41
- package/codim/template.js/.idea/workspace.xml +0 -57
- package/codim/template.js/.vscode/launch.json +0 -53
- package/codim/template.ts/.idea/workspace.xml +0 -57
- package/codim/template.ts/.vscode/launch.json +0 -55
- package/commons/AbortError.js +0 -12
- package/commons/SeleniumPerfStats.js +0 -58
- package/commons/chrome-launcher.js +0 -15
- package/commons/chromedriverWrapper.js +0 -70
- package/commons/config.js +0 -39
- package/commons/constants.js +0 -67
- package/commons/detectDebugger.js +0 -19
- package/commons/featureAvailabilityService.js +0 -26
- package/commons/featureFlags.js +0 -132
- package/commons/getSessionPlayerRequire.js +0 -28
- package/commons/httpRequest.js +0 -261
- package/commons/httpRequestCounters.js +0 -98
- package/commons/httpRequestCounters.test.js +0 -38
- package/commons/initializeUserWithAuth.js +0 -55
- package/commons/lazyRequire.js +0 -105
- package/commons/logUtils.js +0 -15
- package/commons/logUtils.test.js +0 -21
- package/commons/logger.js +0 -178
- package/commons/mockNetworkRuleFileSchema.json +0 -140
- package/commons/npmWrapper.js +0 -174
- package/commons/npmWrapper.test.js +0 -374
- package/commons/performance-logger.js +0 -71
- package/commons/preloadTests.js +0 -29
- package/commons/prepareRunner.js +0 -85
- package/commons/prepareRunner.test.js +0 -144
- package/commons/prepareRunnerAndTestimStartUtils.js +0 -198
- package/commons/prepareRunnerAndTestimStartUtils.test.js +0 -73
- package/commons/requireWithFallback.js +0 -25
- package/commons/runnerFileCache.js +0 -204
- package/commons/socket/baseSocketServiceSocketIO.js +0 -197
- package/commons/socket/realDataService.js +0 -59
- package/commons/socket/realDataServiceSocketIO.js +0 -33
- package/commons/socket/remoteStepService.js +0 -55
- package/commons/socket/remoteStepServiceSocketIO.js +0 -61
- package/commons/socket/socketService.js +0 -175
- package/commons/socket/testResultService.js +0 -62
- package/commons/socket/testResultServiceSocketIO.js +0 -64
- package/commons/testimAnalytics.js +0 -40
- package/commons/testimCloudflare.js +0 -83
- package/commons/testimCloudflare.test.js +0 -185
- package/commons/testimCustomToken.js +0 -124
- package/commons/testimDesiredCapabilitiesBuilder.js +0 -647
- package/commons/testimNgrok.js +0 -90
- package/commons/testimNgrok.test.js +0 -140
- package/commons/testimServicesApi.js +0 -631
- package/commons/testimTunnel.js +0 -73
- package/commons/testimTunnel.test.js +0 -172
- package/commons/xhr2.js +0 -897
- package/coverage/SummaryToObjectReport.js +0 -19
- package/coverage/jsCoverage.js +0 -252
- package/credentialsManager.js +0 -142
- package/errors.js +0 -161
- package/executionQueue.js +0 -37
- package/fixLocalBuild.js +0 -24
- package/inputFileUtils.js +0 -103
- package/lib/coralogix-winston.transport.js +0 -99
- package/player/SeleniumProtocolError.js +0 -100
- package/player/WebDriverHttpRequest.js +0 -177
- package/player/WebdriverioWebDriverApi.js +0 -671
- package/player/appiumTestPlayer.js +0 -90
- package/player/chromeLauncherTestPlayer.js +0 -67
- package/player/constants.js +0 -332
- package/player/extensionTestPlayer.js +0 -32
- package/player/findElementStrategy.js +0 -154
- package/player/scripts/isElementDisplayed.js +0 -252
- package/player/seleniumTestPlayer.js +0 -140
- package/player/services/frameLocator.js +0 -170
- package/player/services/mobileFrameLocatorMock.js +0 -32
- package/player/services/playbackTimeoutCalculator.js +0 -175
- package/player/services/portSelector.js +0 -19
- package/player/services/tabService.js +0 -551
- package/player/services/tabServiceMock.js +0 -167
- package/player/services/windowCreationListener.js +0 -8
- package/player/stepActions/RefreshStepAction.js +0 -16
- package/player/stepActions/apiStepAction.js +0 -89
- package/player/stepActions/baseCliJsStepAction.js +0 -51
- package/player/stepActions/baseJsStepAction.js +0 -277
- package/player/stepActions/cliConditionStepAction.js +0 -11
- package/player/stepActions/cliJsStepAction.js +0 -11
- package/player/stepActions/dropFileStepAction.js +0 -34
- package/player/stepActions/evaluateExpressionStepAction.js +0 -52
- package/player/stepActions/extensionOnlyStepAction.js +0 -12
- package/player/stepActions/extractTextStepAction.js +0 -19
- package/player/stepActions/hoverStepAction.js +0 -55
- package/player/stepActions/inputFileStepAction.js +0 -199
- package/player/stepActions/jsCodeStepAction.js +0 -11
- package/player/stepActions/jsConditionStepAction.js +0 -11
- package/player/stepActions/locateStepAction.js +0 -159
- package/player/stepActions/mouseStepAction.js +0 -370
- package/player/stepActions/navigationStepAction.js +0 -29
- package/player/stepActions/nodePackageStepAction.js +0 -47
- package/player/stepActions/pixelValidationStepAction.js +0 -39
- package/player/stepActions/scripts/dispatchEvents.js +0 -282
- package/player/stepActions/scripts/doClick.js +0 -221
- package/player/stepActions/scripts/doDragPath.js +0 -225
- package/player/stepActions/scripts/doubleClick.js +0 -119
- package/player/stepActions/scripts/dropEvent.js +0 -63
- package/player/stepActions/scripts/focusElement.js +0 -46
- package/player/stepActions/scripts/html5dragAction.js +0 -56
- package/player/stepActions/scripts/html5dragActionV2.js +0 -312
- package/player/stepActions/scripts/runCode.js +0 -147
- package/player/stepActions/scripts/scroll.js +0 -90
- package/player/stepActions/scripts/selectOption.js +0 -51
- package/player/stepActions/scripts/setText.js +0 -415
- package/player/stepActions/scripts/wheel.js +0 -61
- package/player/stepActions/scrollStepAction.js +0 -96
- package/player/stepActions/selectOptionStepAction.js +0 -49
- package/player/stepActions/sfdcRecordedStepAction.js +0 -24
- package/player/stepActions/sfdcStepAction.js +0 -28
- package/player/stepActions/sleepStepAction.js +0 -12
- package/player/stepActions/specialKeyStepAction.js +0 -52
- package/player/stepActions/stepAction.js +0 -73
- package/player/stepActions/stepActionRegistrar.js +0 -111
- package/player/stepActions/submitStepAction.js +0 -12
- package/player/stepActions/tdkHybridStepAction.js +0 -18
- package/player/stepActions/textStepAction.js +0 -110
- package/player/stepActions/textValidationStepAction.js +0 -64
- package/player/stepActions/wheelStepAction.js +0 -41
- package/player/utils/cookieUtils.js +0 -39
- package/player/utils/eyeSdkService.js +0 -250
- package/player/utils/imageCaptureUtils.js +0 -267
- package/player/utils/screenshotUtils.js +0 -68
- package/player/utils/stepActionUtils.js +0 -90
- package/player/utils/windowUtils.js +0 -195
- package/player/webDriverUtils.js +0 -40
- package/player/webDriverUtils.test.js +0 -116
- package/player/webdriver.js +0 -976
- package/polyfills/Array.prototype.at.js +0 -13
- package/polyfills/index.js +0 -13
- package/processHandler.js +0 -79
- package/processHandler.test.js +0 -55
- package/reports/chromeReporter.js +0 -17
- package/reports/consoleReporter.js +0 -190
- package/reports/debugReporter.js +0 -82
- package/reports/jsonReporter.js +0 -55
- package/reports/junitReporter.js +0 -183
- package/reports/reporter.js +0 -166
- package/reports/reporterUtils.js +0 -54
- package/reports/teamCityReporter.js +0 -73
- package/runOptions.d.ts +0 -305
- package/runOptions.js +0 -1288
- package/runOptionsAgentFlow.js +0 -87
- package/runOptionsUtils.js +0 -60
- package/runner.js +0 -355
- package/runners/ParallelWorkerManager.js +0 -284
- package/runners/TestPlanRunner.js +0 -419
- package/runners/buildCodeTests.js +0 -159
- package/runners/runnerUtils.js +0 -81
- package/services/analyticsService.js +0 -96
- package/services/branchService.js +0 -29
- package/services/gridService.js +0 -357
- package/services/gridService.test.js +0 -357
- package/services/labFeaturesService.js +0 -64
- package/services/lambdatestService.js +0 -227
- package/services/lambdatestService.test.js +0 -353
- package/services/localRCASaver.js +0 -124
- package/stepPlayers/cliJsStepPlayback.js +0 -40
- package/stepPlayers/hybridStepPlayback.js +0 -140
- package/stepPlayers/nodePackageStepPlayback.js +0 -28
- package/stepPlayers/playwrightHybridStepPlayback.js +0 -61
- package/stepPlayers/puppeteerHybridStepPlayback.js +0 -76
- package/stepPlayers/remoteStepPlayback.js +0 -80
- package/stepPlayers/seleniumHybridStepPlayback.js +0 -84
- package/stepPlayers/tdkHybridStepPlayback.js +0 -112
- package/testRunHandler.js +0 -603
- package/testRunStatus.js +0 -567
- package/testimNpmDriver.js +0 -52
- package/utils/argsUtils.js +0 -91
- package/utils/argsUtils.test.js +0 -32
- package/utils/fsUtils.js +0 -174
- package/utils/index.js +0 -197
- package/utils/promiseUtils.js +0 -85
- package/utils/stringUtils.js +0 -98
- package/utils/stringUtils.test.js +0 -22
- package/utils/timeUtils.js +0 -25
- package/utils/utils.test.js +0 -27
- package/workers/BaseWorker.js +0 -498
- package/workers/BaseWorker.test.js +0 -186
- package/workers/WorkerAppium.js +0 -180
- package/workers/WorkerExtension.js +0 -192
- package/workers/WorkerExtensionSingleBrowser.js +0 -77
- package/workers/WorkerSelenium.js +0 -253
- package/workers/workerUtils.js +0 -20
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const utils = require('../utils');
|
|
4
|
-
const logger = require('../commons/logger').getLogger('parallel-worker-manager');
|
|
5
|
-
const { CLI_MODE } = require('../commons/constants');
|
|
6
|
-
const analyticsService = require('../services/analyticsService');
|
|
7
|
-
const config = require('../commons/config');
|
|
8
|
-
const ExecutionQueue = require('../executionQueue');
|
|
9
|
-
|
|
10
|
-
const testimCustomToken = require('../commons/testimCustomToken');
|
|
11
|
-
const labFeaturesService = require('../services/labFeaturesService');
|
|
12
|
-
const perf = require('../commons/performance-logger');
|
|
13
|
-
const { StopRunOnError } = require('../errors');
|
|
14
|
-
|
|
15
|
-
require('../player/webdriver'); // preload
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @template {unknown[]} T
|
|
19
|
-
* @typedef {T extends [infer H, ...infer R] ? R : T} RemoveFirst
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
class ParallelWorkerManager {
|
|
23
|
-
/** @param {string=} customExtensionLocalLocation */
|
|
24
|
-
constructor(customExtensionLocalLocation) {
|
|
25
|
-
this.customExtensionLocalLocation = customExtensionLocalLocation;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** @param {typeof CLI_MODE[keyof typeof CLI_MODE]} mode */
|
|
29
|
-
getWorkerType(mode) {
|
|
30
|
-
switch (mode) {
|
|
31
|
-
case CLI_MODE.SELENIUM:
|
|
32
|
-
return require('../workers/WorkerSelenium');
|
|
33
|
-
case CLI_MODE.APPIUM:
|
|
34
|
-
return require('../workers/WorkerAppium');
|
|
35
|
-
default:
|
|
36
|
-
if (labFeaturesService.isFeatureAvailableForProject('useSameBrowserForMultiTests')) {
|
|
37
|
-
return require('../workers/WorkerExtensionSingleBrowser');
|
|
38
|
-
}
|
|
39
|
-
return require('../workers/WorkerExtension');
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @param {number} count
|
|
45
|
-
* @param {ExecutionQueue} queue
|
|
46
|
-
* @param {typeof CLI_MODE[keyof typeof CLI_MODE]} mode
|
|
47
|
-
* @param {...RemoveFirst<ConstructorParameters<typeof import('../workers/BaseWorker')>>} args
|
|
48
|
-
*/
|
|
49
|
-
createWorkers(count, queue, mode, ...args) {
|
|
50
|
-
const Worker = this.getWorkerType(mode);
|
|
51
|
-
const createWorker = () => {
|
|
52
|
-
try {
|
|
53
|
-
perf.log('before new Worker', mode);
|
|
54
|
-
return new Worker(queue, ...args);
|
|
55
|
-
} finally {
|
|
56
|
-
perf.log('after new Worker', mode);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return Array.from(new Array(count), createWorker);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* @param {import('./TestPlanRunner').ExecutionList} testList
|
|
65
|
-
* @param {import('../testRunStatus')} testStatus
|
|
66
|
-
* @param {string} executionId
|
|
67
|
-
* @param {string} executionName
|
|
68
|
-
* @param {import('../runOptions').RunnerOptions} options
|
|
69
|
-
* @param {string} branchToUse
|
|
70
|
-
* @param {ReturnType<typeof testimCustomToken['getTokenV3UserData']>} authData
|
|
71
|
-
* @param {number} workerCount
|
|
72
|
-
* @param {boolean} stopOnError
|
|
73
|
-
*/
|
|
74
|
-
async runTests(testList, testStatus, executionId, executionName, options, branchToUse, authData, workerCount, stopOnError) {
|
|
75
|
-
if (testList && testList.length === 0) {
|
|
76
|
-
return undefined;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
let stoppedOnError = false;
|
|
80
|
-
let runningTests = 0;
|
|
81
|
-
const runAndWaitToComplete = token => new Promise((resolve) => {
|
|
82
|
-
const projectId = options.project;
|
|
83
|
-
const executionQueue = new ExecutionQueue(executionId, executionName, testList, options, branchToUse, testStatus);
|
|
84
|
-
|
|
85
|
-
/** @type {{ [testResultId: string]: any; }} */
|
|
86
|
-
const combinedTestResults = {};
|
|
87
|
-
const testCount = testList.length;
|
|
88
|
-
|
|
89
|
-
const companyId = options.company?.companyId;
|
|
90
|
-
const companyName = options.company?.name;
|
|
91
|
-
const source = options.source || 'cli';
|
|
92
|
-
const user = options.user;
|
|
93
|
-
const companyPlan = options.company?.planType;
|
|
94
|
-
const isStartUp = options.company?.isStartUp;
|
|
95
|
-
const projectName = options.projectData?.name;
|
|
96
|
-
const projectType = options.projectData?.type;
|
|
97
|
-
const lightweightMode = options.lightweightMode;
|
|
98
|
-
const sessionType = utils.getSessionType(options);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @param {number} wid
|
|
103
|
-
* @param {string} testId
|
|
104
|
-
* @param {string} resultId
|
|
105
|
-
* @param {boolean | undefined} isRerun
|
|
106
|
-
* @param {`${number}:${number}`} testRetryKey
|
|
107
|
-
*/
|
|
108
|
-
const onTestStarted = (wid, testId, resultId, isRerun, testRetryKey) => {
|
|
109
|
-
runningTests++;
|
|
110
|
-
analyticsService.analyticsTestStart({
|
|
111
|
-
authData,
|
|
112
|
-
executionId,
|
|
113
|
-
projectId,
|
|
114
|
-
testId,
|
|
115
|
-
resultId,
|
|
116
|
-
companyId,
|
|
117
|
-
companyName,
|
|
118
|
-
projectName,
|
|
119
|
-
companyPlan,
|
|
120
|
-
sessionType,
|
|
121
|
-
source,
|
|
122
|
-
user,
|
|
123
|
-
lightweightMode,
|
|
124
|
-
isStartUp,
|
|
125
|
-
projectType,
|
|
126
|
-
});
|
|
127
|
-
return testStatus.testStartAndReport(wid, executionId, resultId, isRerun, testRetryKey);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* @param {number} wid
|
|
132
|
-
* @param {string} testId
|
|
133
|
-
* @param {*} testResult
|
|
134
|
-
* @param {string} sessionId
|
|
135
|
-
* @param {boolean | undefined} isRerun
|
|
136
|
-
*/
|
|
137
|
-
const onTestCompleted = async (wid, testId, testResult, sessionId, isRerun) => {
|
|
138
|
-
runningTests--;
|
|
139
|
-
const update = {};
|
|
140
|
-
if (lightweightMode?.onlyTestIdsNoSuite) {
|
|
141
|
-
update.show = true;
|
|
142
|
-
}
|
|
143
|
-
if (testResult.seleniumStats) {
|
|
144
|
-
update.seleniumStats = testResult.seleniumStats;
|
|
145
|
-
}
|
|
146
|
-
if (testResult.seleniumPerfMarks) {
|
|
147
|
-
testStatus.concatSeleniumPerfMarks(testResult.seleniumPerfMarks);
|
|
148
|
-
delete testResult.seleniumPerfMarks;
|
|
149
|
-
}
|
|
150
|
-
if (testResult.gridIssues) {
|
|
151
|
-
update.gridIssues = testResult.gridIssues;
|
|
152
|
-
}
|
|
153
|
-
if (testResult.keepAliveIssue) {
|
|
154
|
-
update.keepAliveIssue = testResult.keepAliveIssue;
|
|
155
|
-
}
|
|
156
|
-
if (options.host) {
|
|
157
|
-
update.gridHost = options.host;
|
|
158
|
-
}
|
|
159
|
-
if (options.grid || options.gridId) {
|
|
160
|
-
update.gridName = options.grid || options.gridData?.name;
|
|
161
|
-
update.gridType = options.gridData?.type;
|
|
162
|
-
update.gridProvider = options.gridData?.provider;
|
|
163
|
-
} else if (options.useLocalChromeDriver) {
|
|
164
|
-
update.gridName = 'local-chrome-driver-from-options';
|
|
165
|
-
update.gridType = 'local-chrome';
|
|
166
|
-
} else if (options.useChromeLauncher) {
|
|
167
|
-
update.gridName = 'chrome-launcher-from-options';
|
|
168
|
-
update.gridType = 'local-chrome';
|
|
169
|
-
} else if (options.browserstack) {
|
|
170
|
-
update.gridName = 'browserstack-from-options';
|
|
171
|
-
} else if (options.saucelabs) {
|
|
172
|
-
update.gridName = 'saucelabs-from-options';
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
await testStatus.testEndAndReport(wid, testResult, executionId, sessionId, isRerun, update)
|
|
176
|
-
.catch(err => logger.error('testEndAndReport threw an error', { err }));
|
|
177
|
-
|
|
178
|
-
if (isRerun) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
combinedTestResults[testResult.resultId] = testResult;
|
|
182
|
-
analyticsService.analyticsTestEnd({
|
|
183
|
-
authData,
|
|
184
|
-
executionId,
|
|
185
|
-
projectId,
|
|
186
|
-
testId,
|
|
187
|
-
resultId: testResult.resultId,
|
|
188
|
-
result: testResult,
|
|
189
|
-
companyId,
|
|
190
|
-
companyName,
|
|
191
|
-
projectName,
|
|
192
|
-
companyPlan,
|
|
193
|
-
sessionType,
|
|
194
|
-
source,
|
|
195
|
-
user,
|
|
196
|
-
lightweightMode,
|
|
197
|
-
logger,
|
|
198
|
-
isStartUp,
|
|
199
|
-
projectType,
|
|
200
|
-
});
|
|
201
|
-
if (stopOnError && !testResult.success) {
|
|
202
|
-
executionQueue.stop();
|
|
203
|
-
stoppedOnError = true;
|
|
204
|
-
}
|
|
205
|
-
const completedTests = Object.keys(combinedTestResults).length;
|
|
206
|
-
if (completedTests === testCount || (stoppedOnError && runningTests === 0)) {
|
|
207
|
-
resolve(combinedTestResults);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* @param {number} wid
|
|
213
|
-
* @param {{ name: string; testId: string; resultId: string; runnerStatus: 'SKIPPED'; testStatus: 'quarantine' }} testResult
|
|
214
|
-
*/
|
|
215
|
-
const onTestIgnored = (wid, testResult) => {
|
|
216
|
-
combinedTestResults[testResult.resultId] = testResult;
|
|
217
|
-
testStatus.onTestIgnored(wid, testResult.resultId);
|
|
218
|
-
runningTests--;
|
|
219
|
-
const completedTests = Object.keys(combinedTestResults).length;
|
|
220
|
-
if (completedTests === testCount || (stoppedOnError && runningTests === 0)) {
|
|
221
|
-
resolve(combinedTestResults);
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
const onGridSlot = (resultId, gridInfo) => testStatus.onGridSlot(resultId, gridInfo);
|
|
226
|
-
|
|
227
|
-
options.userData = {
|
|
228
|
-
loginData: Object.assign({}, testimCustomToken.getTokenV3UserData(), {
|
|
229
|
-
refreshToken: testimCustomToken.getRefreshToken(),
|
|
230
|
-
authData: testimCustomToken.getTokenV3UserData(),
|
|
231
|
-
token,
|
|
232
|
-
}),
|
|
233
|
-
projectId: options.project,
|
|
234
|
-
company: options.company,
|
|
235
|
-
servicesUrl: config.SERVICES_HOST,
|
|
236
|
-
};
|
|
237
|
-
perf.log('in localStrategy before createWorker');
|
|
238
|
-
this.createWorkers(
|
|
239
|
-
workerCount,
|
|
240
|
-
executionQueue,
|
|
241
|
-
options.mode,
|
|
242
|
-
options,
|
|
243
|
-
this.customExtensionLocalLocation,
|
|
244
|
-
executionId,
|
|
245
|
-
onTestStarted,
|
|
246
|
-
onTestCompleted,
|
|
247
|
-
onGridSlot,
|
|
248
|
-
onTestIgnored,
|
|
249
|
-
).forEach((worker, index) => {
|
|
250
|
-
perf.log('before schedule worker.run after createWorkers');
|
|
251
|
-
schedule(() => {
|
|
252
|
-
perf.log('right before worker.run');
|
|
253
|
-
worker.run();
|
|
254
|
-
}, index);
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
try {
|
|
259
|
-
const token = await testimCustomToken.getCustomTokenV3();
|
|
260
|
-
const result = await runAndWaitToComplete(token);
|
|
261
|
-
if (stoppedOnError) {
|
|
262
|
-
throw new StopRunOnError();
|
|
263
|
-
}
|
|
264
|
-
return result;
|
|
265
|
-
} catch (err) {
|
|
266
|
-
logger.error('failed running parallel workers', { executionId, err });
|
|
267
|
-
throw err;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* @param {Function} fn
|
|
274
|
-
* @param {number} index
|
|
275
|
-
*/
|
|
276
|
-
function schedule(fn, index) {
|
|
277
|
-
if (index === 0) {
|
|
278
|
-
fn();
|
|
279
|
-
} else {
|
|
280
|
-
setTimeout(fn, index * config.START_WORKER_DELAY_MS);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
module.exports = ParallelWorkerManager;
|