@testim/testim-cli 3.279.0 → 3.281.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/commons/testimServicesApi.js +2 -2
- package/errors.js +8 -0
- package/npm-shrinkwrap.json +2 -15
- package/package.json +1 -2
- package/services/gridService.js +2 -2
- package/workers/BaseWorker.js +7 -2
- package/workers/WorkerAppium.js +2 -2
|
@@ -562,11 +562,11 @@ function updateRemoteRunFailure(body) {
|
|
|
562
562
|
* @return {Promise<Array[import('../../../services/src/grid/mobileGridService').MobileDevice] | null>}
|
|
563
563
|
*/
|
|
564
564
|
|
|
565
|
-
async function getMobileDevicesFromGrid({ projectType, gridId, companyId, selectors }) {
|
|
565
|
+
async function getMobileDevicesFromGrid({ projectId, projectType, gridId, companyId, selectors }) {
|
|
566
566
|
let url = `${GRID_PATH}/mobileDevices/${gridId}/${companyId}?projectType=${projectType}`;
|
|
567
567
|
url = selectors ? `${url}&selectors=${encodeURIComponent(selectors)}` : url;
|
|
568
568
|
try {
|
|
569
|
-
return pRetry(() => getWithAuth({
|
|
569
|
+
return pRetry(() => getWithAuth(url, { projectId }), { retries: DEFAULT_REQUEST_RETRY });
|
|
570
570
|
} catch (err) {
|
|
571
571
|
logger.warn('could\'nt get devices from headspin grid.', { err });
|
|
572
572
|
return null;
|
package/errors.js
CHANGED
|
@@ -75,6 +75,13 @@ class GridError extends Error {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
class GridConcurrencyError extends GridError {
|
|
79
|
+
constructor(message) {
|
|
80
|
+
super(message);
|
|
81
|
+
this.name = 'GridConcurrencyError';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
78
85
|
/**
|
|
79
86
|
* NpmPackageError
|
|
80
87
|
*
|
|
@@ -141,6 +148,7 @@ module.exports = {
|
|
|
141
148
|
GetBrowserError,
|
|
142
149
|
PageNotAvailableError,
|
|
143
150
|
GridError,
|
|
151
|
+
GridConcurrencyError,
|
|
144
152
|
QuotaDepletedError,
|
|
145
153
|
NpmPackageError,
|
|
146
154
|
NpmPermissionsError,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testim/testim-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.281.0",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@testim/testim-cli",
|
|
9
|
-
"version": "3.
|
|
9
|
+
"version": "3.281.0",
|
|
10
10
|
"license": "Proprietary",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@applitools/eyes-sdk-core": "13.11.21",
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
"gulp-preprocess": "3.0.3",
|
|
87
87
|
"merge-stream": "2.0.0",
|
|
88
88
|
"proxyquire": "2.1.3",
|
|
89
|
-
"request-micro": "2.0.1",
|
|
90
89
|
"sinon": "9.0.2",
|
|
91
90
|
"sinon-chai": "3.7.0",
|
|
92
91
|
"ts-node": "9.1.1",
|
|
@@ -12843,12 +12842,6 @@
|
|
|
12843
12842
|
"node": ">= 6"
|
|
12844
12843
|
}
|
|
12845
12844
|
},
|
|
12846
|
-
"node_modules/request-micro": {
|
|
12847
|
-
"version": "2.0.1",
|
|
12848
|
-
"resolved": "https://registry.npmjs.org/request-micro/-/request-micro-2.0.1.tgz",
|
|
12849
|
-
"integrity": "sha512-4K8hyAbUW9tK+j6E8ITnPG2GM9KEjrMO1wYQx6gq/1x0H53Id3gGdPCMFjtDy42I7/cn9nxe8J1jaFWCENdAXg==",
|
|
12850
|
-
"dev": true
|
|
12851
|
-
},
|
|
12852
12845
|
"node_modules/request-promise-core": {
|
|
12853
12846
|
"version": "1.1.4",
|
|
12854
12847
|
"resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz",
|
|
@@ -25700,12 +25693,6 @@
|
|
|
25700
25693
|
}
|
|
25701
25694
|
}
|
|
25702
25695
|
},
|
|
25703
|
-
"request-micro": {
|
|
25704
|
-
"version": "2.0.1",
|
|
25705
|
-
"resolved": "https://registry.npmjs.org/request-micro/-/request-micro-2.0.1.tgz",
|
|
25706
|
-
"integrity": "sha512-4K8hyAbUW9tK+j6E8ITnPG2GM9KEjrMO1wYQx6gq/1x0H53Id3gGdPCMFjtDy42I7/cn9nxe8J1jaFWCENdAXg==",
|
|
25707
|
-
"dev": true
|
|
25708
|
-
},
|
|
25709
25696
|
"request-promise-core": {
|
|
25710
25697
|
"version": "1.1.4",
|
|
25711
25698
|
"resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testim/testim-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.281.0",
|
|
4
4
|
"description": "Command line interface for running Testing on your CI",
|
|
5
5
|
"author": "Oren Rubin",
|
|
6
6
|
"contributors": [{
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"gulp-preprocess": "3.0.3",
|
|
23
23
|
"merge-stream": "2.0.0",
|
|
24
24
|
"proxyquire": "2.1.3",
|
|
25
|
-
"request-micro": "2.0.1",
|
|
26
25
|
"sinon": "9.0.2",
|
|
27
26
|
"sinon-chai": "3.7.0",
|
|
28
27
|
"ts-node": "9.1.1",
|
package/services/gridService.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
const _ = require('lodash');
|
|
6
6
|
|
|
7
|
-
const { GridError, ArgError } = require('../errors');
|
|
7
|
+
const { GridError, ArgError, GridConcurrencyError } = require('../errors');
|
|
8
8
|
const { hasTestPlanFlag, promiseMap } = require('../utils');
|
|
9
9
|
const { gridMessages, gridTypes } = require('../commons/constants');
|
|
10
10
|
const logger = require('../commons/logger').getLogger('grid-service');
|
|
@@ -97,7 +97,7 @@ async function handleGetGridResponse(projectId, companyId, workerId, browser, ge
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
if (isError() && res.code === 'no-available-slot') {
|
|
100
|
-
throw new
|
|
100
|
+
throw new GridConcurrencyError(`Failed to run test on ${browser} - concurrency limit reached`);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
logger.error('invalid code error response - get grid', { res });
|
package/workers/BaseWorker.js
CHANGED
|
@@ -18,7 +18,7 @@ const { releasePlayer } = require('./workerUtils');
|
|
|
18
18
|
const featureFlags = require('../commons/featureFlags');
|
|
19
19
|
const perf = require('../commons/performance-logger');
|
|
20
20
|
const {
|
|
21
|
-
SeleniumError, StopRunOnError, GridError, GetBrowserError, NotImplementedError, PageNotAvailableError,
|
|
21
|
+
SeleniumError, StopRunOnError, GridError, GetBrowserError, NotImplementedError, PageNotAvailableError, GridConcurrencyError,
|
|
22
22
|
} = require('../errors');
|
|
23
23
|
|
|
24
24
|
const { GET_BROWSER_TIMEOUT_MSG, TEST_START_TIMEOUT_MSG, TEST_COMPLETE_TIMEOUT_MSG } = timeoutMessages;
|
|
@@ -166,7 +166,12 @@ class BaseWorker {
|
|
|
166
166
|
try {
|
|
167
167
|
return await utils.promiseTimeout(this.getSlotOnce(testRunHandler), this.options.getBrowserTimeout, timeoutMessages.GET_BROWSER_TIMEOUT_MSG);
|
|
168
168
|
} catch (error) {
|
|
169
|
-
|
|
169
|
+
const logDetails = { testId: this.testId, testResultId: this.testResultId, executionId: this.executionId };
|
|
170
|
+
if (error instanceof GridConcurrencyError) {
|
|
171
|
+
logger.info('could not get grid slot due to concurrency issue', logDetails);
|
|
172
|
+
} else {
|
|
173
|
+
logger.error('error getting grid slot', { error, ...logDetails });
|
|
174
|
+
}
|
|
170
175
|
failedGetSlotAttempts++;
|
|
171
176
|
await utils.delay(this.options.getBrowserTimeout - (Date.now() - startTime));
|
|
172
177
|
throw error;
|
package/workers/WorkerAppium.js
CHANGED
|
@@ -76,9 +76,9 @@ class WorkerAppium extends BaseWorker {
|
|
|
76
76
|
_executionId, _testId, _testResultId,
|
|
77
77
|
_options: { project: projectId },
|
|
78
78
|
} = testRunHandler;
|
|
79
|
-
const { projectData: { type: projectType }, company: { companyId }, gridId } = this.options;
|
|
79
|
+
const { projectData: { type: projectType }, company: { companyId }, gridData: { gridId } } = this.options;
|
|
80
80
|
|
|
81
|
-
const selectedDeviceArr = await testimServicesApi.getMobileDevicesFromGrid({ projectType, companyId, gridId, selectors: `device_id:${activeSession.capabilities.udid}` });
|
|
81
|
+
const selectedDeviceArr = await testimServicesApi.getMobileDevicesFromGrid({ projectId, projectType, companyId, gridId, selectors: `device_id:${activeSession.capabilities.udid}` });
|
|
82
82
|
const deviceName = selectedDeviceArr[0]?.name;
|
|
83
83
|
|
|
84
84
|
const device = {
|