@testim/testim-cli 3.287.0 → 3.289.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 +5 -0
- package/commons/lazyRequire.js +7 -5
- package/npm-shrinkwrap.json +22 -22
- package/package.json +1 -1
- package/polyfills/index.js +4 -0
- package/runOptions.d.ts +5 -0
- package/runOptions.js +12 -1
- package/utils/argsUtils.js +5 -0
package/cli.js
CHANGED
|
@@ -70,6 +70,11 @@ async function main() {
|
|
|
70
70
|
require('./commons/logger').setProjectId(processedOptions.project);
|
|
71
71
|
require('./commons/runnerFileCache').setEncryptKey(typeof processedOptions.token === 'string' ? processedOptions.token : 'anonymous_encrypt_key');
|
|
72
72
|
|
|
73
|
+
if (utils.isInstallLazyDepsMode(processedOptions)) {
|
|
74
|
+
console.log('Lazy dependency installation started');
|
|
75
|
+
const { installAllLazyDependencies } = require('./commons/lazyRequire');
|
|
76
|
+
return await installAllLazyDependencies();
|
|
77
|
+
}
|
|
73
78
|
if (utils.isInitCodimMode(processedOptions)) {
|
|
74
79
|
const codimCli = require('./codim/codim-cli');
|
|
75
80
|
return codimCli.init(processedOptions.initTestProject);
|
package/commons/lazyRequire.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const npmWrapper = require('./npmWrapper');
|
|
4
3
|
const ora = require('ora');
|
|
5
4
|
const path = require('path');
|
|
6
|
-
const
|
|
5
|
+
const npmWrapper = require('./npmWrapper');
|
|
6
|
+
const { getLogger } = require('./logger');
|
|
7
7
|
const { getCliLocation } = require('../utils');
|
|
8
8
|
const { requireWithFallback } = require('./requireWithFallback');
|
|
9
9
|
|
|
10
|
+
const logger = getLogger('lazy-require');
|
|
10
11
|
// eslint-disable-next-line import/no-dynamic-require
|
|
11
12
|
const packageJson = require(path.resolve(getCliLocation(), 'package.json'));
|
|
12
13
|
const ongoingCalls = new Map();
|
|
@@ -75,16 +76,17 @@ async function lazyRequireImpl(dependency) {
|
|
|
75
76
|
return requireWithFallback(dependency);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
async function installAllLazyDependencies() {
|
|
79
|
+
module.exports.installAllLazyDependencies = async function installAllLazyDependencies() {
|
|
79
80
|
const allLazyDependencies = Object.keys(packageJson.lazyDependencies);
|
|
80
81
|
|
|
81
82
|
for (const dep of allLazyDependencies) {
|
|
82
83
|
await lazyRequireImpl(dep);
|
|
83
84
|
}
|
|
84
|
-
}
|
|
85
|
+
};
|
|
85
86
|
|
|
87
|
+
// TODO: remove this once docker-build-tool is not using it
|
|
86
88
|
if (require.main === module) {
|
|
87
|
-
installAllLazyDependencies();
|
|
89
|
+
module.exports.installAllLazyDependencies();
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
/**
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testim/testim-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.289.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.289.0",
|
|
10
10
|
"license": "Proprietary",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@applitools/eyes-sdk-core": "13.11.29",
|
|
@@ -4306,9 +4306,9 @@
|
|
|
4306
4306
|
}
|
|
4307
4307
|
},
|
|
4308
4308
|
"node_modules/define-properties": {
|
|
4309
|
-
"version": "1.
|
|
4310
|
-
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.
|
|
4311
|
-
"integrity": "sha512-
|
|
4309
|
+
"version": "1.2.0",
|
|
4310
|
+
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz",
|
|
4311
|
+
"integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==",
|
|
4312
4312
|
"dependencies": {
|
|
4313
4313
|
"has-property-descriptors": "^1.0.0",
|
|
4314
4314
|
"object-keys": "^1.1.1"
|
|
@@ -7096,11 +7096,11 @@
|
|
|
7096
7096
|
}
|
|
7097
7097
|
},
|
|
7098
7098
|
"node_modules/internal-slot": {
|
|
7099
|
-
"version": "1.0.
|
|
7100
|
-
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.
|
|
7101
|
-
"integrity": "sha512-
|
|
7099
|
+
"version": "1.0.5",
|
|
7100
|
+
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz",
|
|
7101
|
+
"integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==",
|
|
7102
7102
|
"dependencies": {
|
|
7103
|
-
"get-intrinsic": "^1.
|
|
7103
|
+
"get-intrinsic": "^1.2.0",
|
|
7104
7104
|
"has": "^1.0.3",
|
|
7105
7105
|
"side-channel": "^1.0.4"
|
|
7106
7106
|
},
|
|
@@ -8845,9 +8845,9 @@
|
|
|
8845
8845
|
}
|
|
8846
8846
|
},
|
|
8847
8847
|
"node_modules/minimist": {
|
|
8848
|
-
"version": "1.2.
|
|
8849
|
-
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.
|
|
8850
|
-
"integrity": "sha512-
|
|
8848
|
+
"version": "1.2.8",
|
|
8849
|
+
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
|
8850
|
+
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
|
8851
8851
|
"funding": {
|
|
8852
8852
|
"url": "https://github.com/sponsors/ljharb"
|
|
8853
8853
|
}
|
|
@@ -19839,9 +19839,9 @@
|
|
|
19839
19839
|
"integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg=="
|
|
19840
19840
|
},
|
|
19841
19841
|
"define-properties": {
|
|
19842
|
-
"version": "1.
|
|
19843
|
-
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.
|
|
19844
|
-
"integrity": "sha512-
|
|
19842
|
+
"version": "1.2.0",
|
|
19843
|
+
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz",
|
|
19844
|
+
"integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==",
|
|
19845
19845
|
"requires": {
|
|
19846
19846
|
"has-property-descriptors": "^1.0.0",
|
|
19847
19847
|
"object-keys": "^1.1.1"
|
|
@@ -22085,11 +22085,11 @@
|
|
|
22085
22085
|
}
|
|
22086
22086
|
},
|
|
22087
22087
|
"internal-slot": {
|
|
22088
|
-
"version": "1.0.
|
|
22089
|
-
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.
|
|
22090
|
-
"integrity": "sha512-
|
|
22088
|
+
"version": "1.0.5",
|
|
22089
|
+
"resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz",
|
|
22090
|
+
"integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==",
|
|
22091
22091
|
"requires": {
|
|
22092
|
-
"get-intrinsic": "^1.
|
|
22092
|
+
"get-intrinsic": "^1.2.0",
|
|
22093
22093
|
"has": "^1.0.3",
|
|
22094
22094
|
"side-channel": "^1.0.4"
|
|
22095
22095
|
}
|
|
@@ -23459,9 +23459,9 @@
|
|
|
23459
23459
|
}
|
|
23460
23460
|
},
|
|
23461
23461
|
"minimist": {
|
|
23462
|
-
"version": "1.2.
|
|
23463
|
-
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.
|
|
23464
|
-
"integrity": "sha512-
|
|
23462
|
+
"version": "1.2.8",
|
|
23463
|
+
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
|
23464
|
+
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="
|
|
23465
23465
|
},
|
|
23466
23466
|
"mixin-deep": {
|
|
23467
23467
|
"version": "1.3.2",
|
package/package.json
CHANGED
package/polyfills/index.js
CHANGED
package/runOptions.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
interface InstallLazyDepsOptions {
|
|
2
|
+
installLazyDepsMode: true;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
interface LoginModeOptions {
|
|
2
6
|
loginMode: true;
|
|
3
7
|
}
|
|
@@ -291,6 +295,7 @@ interface RunnerOptions extends Partial<Omit<TunnelOptions, 'tunnelOnlyMode' | '
|
|
|
291
295
|
}
|
|
292
296
|
|
|
293
297
|
type Options = |
|
|
298
|
+
InstallLazyDepsOptions |
|
|
294
299
|
LoginModeOptions |
|
|
295
300
|
InitModeOptions |
|
|
296
301
|
AgentModeOptions |
|
package/runOptions.js
CHANGED
|
@@ -120,6 +120,10 @@ const printUsage = () => {
|
|
|
120
120
|
return line.includes('--test-start-timeout');
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
function isInstallLazyDeps(line) {
|
|
124
|
+
return line.includes('--install-lazy-deps');
|
|
125
|
+
}
|
|
126
|
+
|
|
123
127
|
program.help((txt) => {
|
|
124
128
|
const lines = txt.split('\n');
|
|
125
129
|
return lines
|
|
@@ -137,7 +141,8 @@ const printUsage = () => {
|
|
|
137
141
|
!isExitCodeIgnoreFailingTests(ln) &&
|
|
138
142
|
!isDeprecatedHighSpeed(ln) &&
|
|
139
143
|
!isUrls(ln) &&
|
|
140
|
-
!isTestStartTimeout(ln)
|
|
144
|
+
!isTestStartTimeout(ln) &&
|
|
145
|
+
!isInstallLazyDeps(ln),
|
|
141
146
|
)
|
|
142
147
|
.join('\n');
|
|
143
148
|
});
|
|
@@ -370,6 +375,8 @@ program
|
|
|
370
375
|
.option('--intersect-with-label [label]', 'Out of the execution\'s test list, run only those tests that have the specified label', collect, [])
|
|
371
376
|
.option('--intersect-with-suite [suiteName]', 'Out of the execution\'s test list, run only those tests that are included in the specified suite (by suite name)', collect, [])
|
|
372
377
|
.option('--intersect-with-suite-id [suiteId]', 'Out of the execution\'s test list, run only those tests that are included in the specified suite (by suite ID)', collect, [])
|
|
378
|
+
|
|
379
|
+
.option('--install-lazy-deps [install-lazy-deps]', 'Install all lazy dependencies from package.json', false)
|
|
373
380
|
.parse(process.argv);
|
|
374
381
|
|
|
375
382
|
|
|
@@ -439,6 +446,10 @@ module.exports = {
|
|
|
439
446
|
process.exit(0);
|
|
440
447
|
}
|
|
441
448
|
|
|
449
|
+
if (program.installLazyDeps) {
|
|
450
|
+
return { installLazyDepsMode: true };
|
|
451
|
+
}
|
|
452
|
+
|
|
442
453
|
if (program.disableFileCache) {
|
|
443
454
|
localRunnerCache.disable();
|
|
444
455
|
}
|
package/utils/argsUtils.js
CHANGED
|
@@ -13,6 +13,7 @@ const { sessionType, testStatus: testStatusConst } = require('../commons/constan
|
|
|
13
13
|
* @typedef {import('../runOptions').NgrokTunnelOptions} NgrokTunnelOptions
|
|
14
14
|
* @typedef {import('../runOptions').TunnelDaemonOptions} TunnelDaemonOptions
|
|
15
15
|
* @typedef {import('../runOptions').RunnerOptions} RunnerOptions
|
|
16
|
+
* @typedef {import('../runOptions').InstallLazyDepsOptions} InstallLazyDepsOptions
|
|
16
17
|
*/
|
|
17
18
|
|
|
18
19
|
/** @param {RunnerOptions} options */
|
|
@@ -71,6 +72,9 @@ const isTunnelOnlyMode = (options) => Boolean(options.tunnelOnlyMode);
|
|
|
71
72
|
/** @type {(options: Options) => options is RunnerOptions & { createPrefechedData: true; }} options */
|
|
72
73
|
// @ts-ignore should be `as any` etc
|
|
73
74
|
const isCreatePrefetchedDataMode = (options) => Boolean(options.createPrefechedData);
|
|
75
|
+
/** @type {(options: Options) => options is InstallLazyDepsOptions} options */
|
|
76
|
+
// @ts-ignore should be `as any` etc
|
|
77
|
+
const isInstallLazyDepsMode = (options) => Boolean(options.installLazyDepsMode);
|
|
74
78
|
|
|
75
79
|
module.exports = {
|
|
76
80
|
getSessionType,
|
|
@@ -83,4 +87,5 @@ module.exports = {
|
|
|
83
87
|
isLoginMode,
|
|
84
88
|
isTunnelOnlyMode,
|
|
85
89
|
isCreatePrefetchedDataMode,
|
|
90
|
+
isInstallLazyDepsMode,
|
|
86
91
|
};
|