datagrok-tools 4.13.43 → 4.13.45
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/CHANGELOG.md +12 -0
- package/bin/commands/help.js +1 -1
- package/bin/commands/test-all.js +7 -18
- package/bin/commands/test.js +7 -5
- package/bin/utils/test-utils.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Datagrok-tools changelog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## 4.13.45 (2024-12-12)
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* Test all workers count variable fixes
|
|
9
|
+
|
|
10
|
+
## 4.13.44 (2024-12-06)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* Test fixed infinite testing
|
|
15
|
+
|
|
4
16
|
## 4.13.43 (2024-12-02)
|
|
5
17
|
|
|
6
18
|
### Features
|
package/bin/commands/help.js
CHANGED
|
@@ -13,7 +13,7 @@ var HELP_CREATE = "\nUsage: grok create [name]\n\nCreate a package:\n\ngrok crea
|
|
|
13
13
|
var HELP_PUBLISH = "\nUsage: grok publish [host]\n\nUpload a package\n\nOptions:\n[--build|--rebuild] [--debug|--release] [-k | --key] [--suffix] [--all] [--refresh] [--link]\n\n--all Publish all available packages \n--refresh Publish all available already loaded packages \n--link \t Link the package to local utils\n\nRunning `grok publish` is the same as running `grok publish defaultHost --build --debug`\n";
|
|
14
14
|
var HELP_CHECK = "\nUsage: grok check\n\nOptions:\n[-r | --recursive]\n\n--recursive Check all packages in the current directory\n\nCheck package content (function signatures, import statements of external modules, etc.)\n";
|
|
15
15
|
var HELP_TEST = "\nUsage: grok test\n\nOptions:\n[--package] [--category] [--test] [--host] [--csv] [--gui] [--skip-build] [--skip-publish] [--link] [--catchUnhandled] [--report] [--record] [--verbose] [--platform] [--benchmark] [--stress-test]\n\n--package Specify a package name to run tests for\n--category Specify a category name to run tests for\n--test Specify a test name to run \n--host Host alias as in the config file\n--csv Save the test report in a CSV file\n--gui Launch graphical interface (non-headless mode)\n--catchUnhandled Catch unhandled exceptions during test execution (default=true)\n--report Report failed tests to audit, notifies package author (default=false)\n--skip-build Skip the package build step\n--skip-publish Skip the package publication step\n--link \t Link the package to local utils\n--record Records the test execution process in mp4 format\n--verbose Prints detailed information about passed and skipped tests in the console\n--platform Runs only platform tests (applicable for ApiTests package only)\n--core Runs package & auto tests & core tests (core tests run only from DevTools package)\n--benchmark \t Runs tests in benchmark mode\n--stress-test Runs shuffled stress-test only\n \nRun package tests\n\nSee instructions:\nhttps://datagrok.ai/help/develop/how-to/test-packages#local-testing\n";
|
|
16
|
-
var HELP_TESTALL = "\nUsage: grok testall\n\nOptions:\n[--packages] [--host] [--csv] [--gui] [--skip-build] [--skip-publish] [--link-package] [--catchUnhandled] [--report] [--record] [--verbose] [--benchmark] [--stress-test] [--order] [--tags] [--testRepeat] [--
|
|
16
|
+
var HELP_TESTALL = "\nUsage: grok testall\n\nOptions:\n[--packages] [--host] [--csv] [--gui] [--skip-build] [--skip-publish] [--link-package] [--catchUnhandled] [--report] [--record] [--verbose] [--benchmark] [--stress-test] [--order] [--tags] [--testRepeat] [--workers-count]\n\n--packages Specify a packages names to run tests for\n--host Host alias as in the config file\n--csv Save the test report in a CSV file\n--gui Launch graphical interface (non-headless mode)\n--catchUnhandled Catch unhandled exceptions during test execution (default=true)\n--report Report failed tests to audit, notifies packages author (default=false)\n--skip-build Skip the packages build step\n--skip-publish Skip the packages publication step\n--link-package \t Link the packages to local utils\n--record Records the test execution process in mp4 format\n--verbose Prints detailed information about passed and skipped tests in the console\n--core Runs packages & core tests (applicable for DevTools packages only)\n--benchmark \t Runs tests in benchmark mode\n--stress-test Runs shuffled stress-test only\n--order Specify order for tests invocation\n--tags Filter tests by tag name for run\n--testRepeat Set amount of tests repeats\n--workers-count Set amount of workers for tests run\n\nRun tests of all or specified packages \n\nSee instructions:\nhttps://datagrok.ai/help/develop/how-to/test-packages#local-testing\n";
|
|
17
17
|
var HELP_LINK = "\nUsage: grok link\n\nLink `datagrok-api` and libraries for local development\n";
|
|
18
18
|
|
|
19
19
|
// const HELP_MIGRATE = `
|
package/bin/commands/test-all.js
CHANGED
|
@@ -83,7 +83,7 @@ function _testAll() {
|
|
|
83
83
|
case 10:
|
|
84
84
|
filteredTests = _context.sent;
|
|
85
85
|
_context.next = 13;
|
|
86
|
-
return setWorkersOrder(filteredTests, getEnumOrder((_args$order = args.order) !== null && _args$order !== void 0 ? _args$order : ''), args
|
|
86
|
+
return setWorkersOrder(filteredTests, getEnumOrder((_args$order = args.order) !== null && _args$order !== void 0 ? _args$order : ''), args['workers-count'], args.testRepeat);
|
|
87
87
|
case 13:
|
|
88
88
|
workersOrder = _context.sent;
|
|
89
89
|
_context.next = 16;
|
|
@@ -296,27 +296,16 @@ function _runTests() {
|
|
|
296
296
|
_iterator3.f();
|
|
297
297
|
}
|
|
298
298
|
workersPromises = [];
|
|
299
|
-
_i = 0, _workersCommands = workersCommands;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
_context5.next = 13;
|
|
303
|
-
break;
|
|
299
|
+
for (_i = 0, _workersCommands = workersCommands; _i < _workersCommands.length; _i++) {
|
|
300
|
+
workerCommands = _workersCommands[_i];
|
|
301
|
+
workersPromises.push((0, _testUtils.runWorker)(workerCommands, workerOptions, workersStarted++, testInvocationTimeout));
|
|
304
302
|
}
|
|
305
|
-
|
|
306
|
-
workersPromises.push((0, _testUtils.runWorker)(workerCommands, workerOptions, workersStarted++, testInvocationTimeout));
|
|
307
|
-
_context5.next = 10;
|
|
308
|
-
return workersPromises[workersPromises.length];
|
|
309
|
-
case 10:
|
|
310
|
-
_i++;
|
|
311
|
-
_context5.next = 5;
|
|
312
|
-
break;
|
|
313
|
-
case 13:
|
|
314
|
-
_context5.next = 15;
|
|
303
|
+
_context5.next = 7;
|
|
315
304
|
return Promise.all(workersPromises);
|
|
316
|
-
case
|
|
305
|
+
case 7:
|
|
317
306
|
resultObjects = _context5.sent;
|
|
318
307
|
return _context5.abrupt("return", resultObjects);
|
|
319
|
-
case
|
|
308
|
+
case 9:
|
|
320
309
|
case "end":
|
|
321
310
|
return _context5.stop();
|
|
322
311
|
}
|
package/bin/commands/test.js
CHANGED
|
@@ -24,7 +24,7 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
|
|
|
24
24
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
25
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /* eslint-disable max-len */
|
|
26
26
|
var testInvocationTimeout = 3600000;
|
|
27
|
-
var availableCommandOptions = ['host', 'package', 'csv', 'gui', 'catchUnhandled', 'platform', 'core', 'report', 'skip-build', 'skip-publish', 'path', 'record', 'verbose', 'benchmark', 'category', 'test', 'stress-test', 'link', 'tag'];
|
|
27
|
+
var availableCommandOptions = ['host', 'package', 'csv', 'gui', 'catchUnhandled', 'platform', 'core', 'report', 'skip-build', 'skip-publish', 'path', 'record', 'verbose', 'benchmark', 'category', 'test', 'stress-test', 'link', 'tag', 'ci-cd'];
|
|
28
28
|
var curDir = process.cwd();
|
|
29
29
|
var grokDir = _path["default"].join(_os["default"].homedir(), '.grok');
|
|
30
30
|
var confPath = _path["default"].join(grokDir, 'config.yaml');
|
|
@@ -137,7 +137,7 @@ function _runTesting() {
|
|
|
137
137
|
workerId = 1;
|
|
138
138
|
_context3.next = 14;
|
|
139
139
|
return (0, _testUtils.timeout)( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
140
|
-
var _args$benchmark, _args$catchUnhandled, _args$gui, _args$record, _args$report, _args$verbose, testsLeft, testsToReproduce, _iterator2, _step2, testData, reproduced, _iterator3, _step3, _test2, _reproducedTest2;
|
|
140
|
+
var _args$benchmark, _args$catchUnhandled, _args$gui, _args$record, _args$report, _args$verbose, _args$ciCd, testsLeft, testsToReproduce, _iterator2, _step2, testData, reproduced, _iterator3, _step3, _test2, _reproducedTest2;
|
|
141
141
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
142
142
|
while (1) switch (_context2.prev = _context2.next) {
|
|
143
143
|
case 0:
|
|
@@ -149,6 +149,7 @@ function _runTesting() {
|
|
|
149
149
|
record: (_args$record = args.record) !== null && _args$record !== void 0 ? _args$record : false,
|
|
150
150
|
report: (_args$report = args.report) !== null && _args$report !== void 0 ? _args$report : false,
|
|
151
151
|
verbose: (_args$verbose = args.verbose) !== null && _args$verbose !== void 0 ? _args$verbose : false,
|
|
152
|
+
ciCd: (_args$ciCd = args['ci-cd']) !== null && _args$ciCd !== void 0 ? _args$ciCd : false,
|
|
152
153
|
stopOnTimeout: true
|
|
153
154
|
}, workerId, testInvocationTimeout);
|
|
154
155
|
case 2:
|
|
@@ -159,7 +160,7 @@ function _runTesting() {
|
|
|
159
160
|
try {
|
|
160
161
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
161
162
|
testData = _step2.value;
|
|
162
|
-
if (!r.
|
|
163
|
+
if (!r.verbosePassed.includes("".concat(testData.params.category, ": ").concat(testData.params.test)) && !r.verboseSkipped.includes("".concat(testData.params.category, ": ").concat(testData.params.test)) && !r.verboseFailed.includes("".concat(testData.params.category, ": ").concat(testData.params.test)) && !new RegExp("".concat(testData.params.category.trim(), "[^\\n]*: (before|after)")).test(r.verboseFailed)) testsLeft.push(testData);
|
|
163
164
|
if (r.verboseFailed.includes("".concat(testData.params.category, ": ").concat(testData.params.test, " : Error:"))) {
|
|
164
165
|
testsToReproduce.push(testData);
|
|
165
166
|
}
|
|
@@ -242,7 +243,7 @@ function reproducedTest(_x3, _x4) {
|
|
|
242
243
|
}
|
|
243
244
|
function _reproducedTest() {
|
|
244
245
|
_reproducedTest = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(args, testsToReproduce) {
|
|
245
|
-
var res, _iterator4, _step4, _args$benchmark2, _test3, r;
|
|
246
|
+
var res, _iterator4, _step4, _args$benchmark2, _args$ciCd2, _test3, r;
|
|
246
247
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
247
248
|
while (1) switch (_context4.prev = _context4.next) {
|
|
248
249
|
case 0:
|
|
@@ -265,7 +266,8 @@ function _reproducedTest() {
|
|
|
265
266
|
report: false,
|
|
266
267
|
verbose: false,
|
|
267
268
|
stopOnTimeout: true,
|
|
268
|
-
reproduce: true
|
|
269
|
+
reproduce: true,
|
|
270
|
+
ciCd: (_args$ciCd2 = args['ci-cd']) !== null && _args$ciCd2 !== void 0 ? _args$ciCd2 : false
|
|
269
271
|
}, 0, testInvocationTimeout);
|
|
270
272
|
case 8:
|
|
271
273
|
r = _context4.sent;
|
package/bin/utils/test-utils.js
CHANGED
|
@@ -664,6 +664,7 @@ function _runWorker() {
|
|
|
664
664
|
return page.evaluate(function (testData, options) {
|
|
665
665
|
if (options.benchmark) window.DG.Test.isInBenchmark = true;
|
|
666
666
|
if (options.reproduce) window.DG.Test.isReproducing = true;
|
|
667
|
+
if (options.ciCd) window.DG.Test.isCiCd = true;
|
|
667
668
|
return new Promise(function (resolve, reject) {
|
|
668
669
|
window.DG.Utils.executeTests(testData, options.stopOnTimeout).then(function (results) {
|
|
669
670
|
resolve(results);
|
package/package.json
CHANGED