datagrok-tools 4.13.44 → 4.13.46

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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Datagrok-tools changelog
2
2
 
3
+ ## 4.13.46 (2024-12-23)
4
+
5
+ ### Features
6
+
7
+ * Improved error handling:
8
+ - Different exit codes for package errors / grok script errors
9
+ - Graceful error handling when testing non-existing packages
10
+
11
+ ## 4.13.45 (2024-12-12)
12
+
13
+ ### Features
14
+
15
+ * Test all workers count variable fixes
3
16
 
4
17
  ## 4.13.44 (2024-12-06)
5
18
 
@@ -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] [--workersCount]\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--workersCount 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";
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 = `
@@ -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.workersCount, args.testRepeat);
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
- case 5:
301
- if (!(_i < _workersCommands.length)) {
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
- workerCommands = _workersCommands[_i];
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 15:
305
+ case 7:
317
306
  resultObjects = _context5.sent;
318
307
  return _context5.abrupt("return", resultObjects);
319
- case 17:
308
+ case 9:
320
309
  case "end":
321
310
  return _context5.stop();
322
311
  }
@@ -102,6 +102,21 @@ function _runTesting() {
102
102
  testsObj = _context3.sent;
103
103
  console.log(testsObj);
104
104
  parsed = (0, _orderFunctions.setAlphabeticalOrder)(testsObj, 1, 1);
105
+ if (!(parsed.length == 0)) {
106
+ _context3.next = 8;
107
+ break;
108
+ }
109
+ return _context3.abrupt("return", {
110
+ failed: true,
111
+ verbosePassed: 'Package not found',
112
+ verboseSkipped: 'Package not found',
113
+ verboseFailed: 'Package not found',
114
+ passedAmount: 0,
115
+ skippedAmount: 0,
116
+ failedAmount: 0,
117
+ csv: ''
118
+ });
119
+ case 8:
105
120
  organized = parsed[0].map(function (testObj) {
106
121
  return {
107
122
  "package": testObj.packageName,
@@ -135,7 +150,7 @@ function _runTesting() {
135
150
  color.info('Starting tests...');
136
151
  testsResults = [];
137
152
  workerId = 1;
138
- _context3.next = 14;
153
+ _context3.next = 16;
139
154
  return (0, _testUtils.timeout)( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
140
155
  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
156
  return _regenerator["default"].wrap(function _callee2$(_context2) {
@@ -225,12 +240,12 @@ function _runTesting() {
225
240
  }
226
241
  }, _callee2, null, [[12, 25, 28, 31]]);
227
242
  })), testInvocationTimeout);
228
- case 14:
229
- _context3.next = 16;
230
- return (0, _testUtils.mergeWorkersResults)(testsResults);
231
243
  case 16:
244
+ _context3.next = 18;
245
+ return (0, _testUtils.mergeWorkersResults)(testsResults);
246
+ case 18:
232
247
  return _context3.abrupt("return", _context3.sent);
233
- case 17:
248
+ case 19:
234
249
  case "end":
235
250
  return _context3.stop();
236
251
  }
package/bin/grok.js CHANGED
@@ -31,7 +31,7 @@ if (command in commands) {
31
31
  } catch (err) {
32
32
  console.error(err);
33
33
  console.log(help[command]);
34
- exitWithCode(1);
34
+ exitWithCode(255);
35
35
  }
36
36
  } else
37
37
  console.log(help.help);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.13.44",
3
+ "version": "4.13.46",
4
4
  "description": "Utility to upload and publish packages to Datagrok",
5
5
  "homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
6
6
  "dependencies": {