datagrok-tools 4.13.38 → 4.13.39

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,6 +1,13 @@
1
1
  # Datagrok-tools changelog
2
2
 
3
3
 
4
+ ## 4.13.39 (2024-11-26)
5
+
6
+ ### Features
7
+
8
+ * Grok publish added ability to link packages
9
+ * Grok test log for multiple workers fix
10
+
4
11
  ## 4.13.38 (2024-11-15)
5
12
 
6
13
  ### Features
@@ -10,7 +10,7 @@ var HELP_INIT = "\nUsage: grok init\n\nModify a package template by adding confi
10
10
  var HELP_API = "\nUsage: grok api\n\nCreate wrapper functions for package scripts and queries\n";
11
11
  var HELP_CONFIG = "\nUsage: grok config\n\nCreate or update a configuration file\n\nOptions:\n[--reset] [--server] [--alias] [-k | --key]\n\n--reset Restore the default config file template\n--server Use to add a server to the config (`grok config add --alias alias --server url --key key`)\n--alias Use in conjunction with the `server` option to set the server name\n--key Use in conjunction with the `server` option to set the developer key\n--default Use in conjunction with the `server` option to set the added server as default\n";
12
12
  var HELP_CREATE = "\nUsage: grok create [name]\n\nCreate a package:\n\ngrok create Create a package in the current working directory\ngrok create <name> Create a package in a folder with the specified name\n\nPlease note that the package name may only include letters, numbers, underscores, or hyphens\n\nOptions:\n[--eslint] [--ide] [--js | --ts] [--test]\n\n--eslint Add a configuration for eslint\n--ide Add an IDE-specific configuration for debugging (vscode)\n--js Create a JavaScript package\n--ts Create a TypeScript package (default)\n--test Add tests support (TypeScript packages only)\n";
13
- var HELP_PUBLISH = "\nUsage: grok publish [host]\n\nUpload a package\n\nOptions:\n[--build|--rebuild] [--debug|--release] [-k | --key] [--suffix] [--all] [--refresh]\n\n--all Publish all available packages \n--refresh Publish all available already loaded packages \n\nRunning `grok publish` is the same as running `grok publish defaultHost --build --debug`\n";
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 & core tests (applicable for DevTools package only)\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
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";
@@ -52,73 +52,72 @@ function _processPackage() {
52
52
  timestamps = {};
53
53
  url = "".concat(host, "/packages/dev/").concat(devKey, "/").concat(packageName);
54
54
  if (!debug) {
55
- _context2.next = 19;
55
+ _context2.next = 18;
56
56
  break;
57
57
  }
58
58
  _context2.prev = 3;
59
- console.log(url);
60
- _context2.next = 7;
59
+ _context2.next = 6;
61
60
  return (0, _nodeFetch["default"])(url + '/timestamps');
62
- case 7:
63
- _context2.next = 9;
61
+ case 6:
62
+ _context2.next = 8;
64
63
  return _context2.sent.json();
65
- case 9:
64
+ case 8:
66
65
  timestamps = _context2.sent;
67
66
  if (!(timestamps['#type'] === 'ApiError')) {
68
- _context2.next = 13;
67
+ _context2.next = 12;
69
68
  break;
70
69
  }
71
70
  color.error(timestamps.message);
72
71
  return _context2.abrupt("return", 1);
73
- case 13:
74
- _context2.next = 19;
72
+ case 12:
73
+ _context2.next = 18;
75
74
  break;
76
- case 15:
77
- _context2.prev = 15;
75
+ case 14:
76
+ _context2.prev = 14;
78
77
  _context2.t0 = _context2["catch"](3);
79
78
  console.error(_context2.t0);
80
79
  return _context2.abrupt("return", 1);
81
- case 19:
80
+ case 18:
82
81
  zip = (0, _archiverPromise["default"])('zip', {
83
82
  store: false
84
83
  }); // Gather the files
85
84
  localTimestamps = {};
86
- _context2.next = 23;
85
+ _context2.next = 22;
87
86
  return (0, _ignoreWalk["default"])({
88
87
  path: '.',
89
88
  ignoreFiles: ['.npmignore', '.gitignore', '.grokignore'],
90
89
  includeEmpty: false,
91
90
  follow: true
92
91
  });
93
- case 23:
92
+ case 22:
94
93
  files = _context2.sent;
95
94
  isWebpack = _fs["default"].existsSync('webpack.config.js');
96
95
  if (!(!rebuild && isWebpack)) {
97
- _context2.next = 35;
96
+ _context2.next = 34;
98
97
  break;
99
98
  }
100
99
  if (!_fs["default"].existsSync('dist/package.js')) {
101
- _context2.next = 33;
100
+ _context2.next = 32;
102
101
  break;
103
102
  }
104
- _context2.next = 29;
103
+ _context2.next = 28;
105
104
  return (0, _ignoreWalk["default"])({
106
105
  path: './dist',
107
106
  ignoreFiles: [],
108
107
  includeEmpty: false,
109
108
  follow: true
110
109
  });
111
- case 29:
110
+ case 28:
112
111
  distFiles = _context2.sent;
113
112
  distFiles.forEach(function (df) {
114
113
  files.push("dist/".concat(df));
115
114
  });
116
- _context2.next = 35;
115
+ _context2.next = 34;
117
116
  break;
118
- case 33:
117
+ case 32:
119
118
  color.warn('File `dist/package.js` not found. Building the package on the server side...\n' + 'Next time, please build your package locally with Webpack beforehand\n' + 'or run `grok publish` with the `--rebuild` option');
120
119
  rebuild = true;
121
- case 35:
120
+ case 34:
122
121
  contentValidationLog = '';
123
122
  console.log('Starting package checks...');
124
123
  checkStart = Date.now();
@@ -208,14 +207,14 @@ function _processPackage() {
208
207
  console.log("Adding ".concat(canonicalRelativePath, "..."));
209
208
  });
210
209
  if (!errs.length) {
211
- _context2.next = 56;
210
+ _context2.next = 55;
212
211
  break;
213
212
  }
214
213
  errs.forEach(function (e) {
215
214
  return color.error(e);
216
215
  });
217
216
  return _context2.abrupt("return", 1);
218
- case 56:
217
+ case 55:
219
218
  zip.append(JSON.stringify(localTimestamps), {
220
219
  name: 'timestamps.json'
221
220
  });
@@ -260,41 +259,41 @@ function _processPackage() {
260
259
  })["catch"](function (error) {
261
260
  console.error(error);
262
261
  });
263
- _context2.next = 62;
262
+ _context2.next = 61;
264
263
  return zip.finalize();
265
- case 62:
266
- _context2.prev = 62;
267
- _context2.next = 65;
264
+ case 61:
265
+ _context2.prev = 61;
266
+ _context2.next = 64;
268
267
  return uploadPromise;
269
- case 65:
268
+ case 64:
270
269
  log = _context2.sent;
271
270
  _fs["default"].unlinkSync('zip');
272
271
  if (!(log['#type'] === 'ApiError')) {
273
- _context2.next = 74;
272
+ _context2.next = 73;
274
273
  break;
275
274
  }
276
275
  color.error(log['message']);
277
276
  console.error(log['innerMessage']);
278
277
  console.log(log);
279
278
  return _context2.abrupt("return", 1);
280
- case 74:
279
+ case 73:
281
280
  console.log(log);
282
281
  color.warn(contentValidationLog);
283
- case 76:
284
- _context2.next = 82;
282
+ case 75:
283
+ _context2.next = 81;
285
284
  break;
286
- case 78:
287
- _context2.prev = 78;
288
- _context2.t1 = _context2["catch"](62);
285
+ case 77:
286
+ _context2.prev = 77;
287
+ _context2.t1 = _context2["catch"](61);
289
288
  console.error(_context2.t1);
290
289
  return _context2.abrupt("return", 1);
291
- case 82:
290
+ case 81:
292
291
  return _context2.abrupt("return", 0);
293
- case 83:
292
+ case 82:
294
293
  case "end":
295
294
  return _context2.stop();
296
295
  }
297
- }, _callee2, null, [[3, 15], [62, 78]]);
296
+ }, _callee2, null, [[3, 14], [61, 77]]);
298
297
  }));
299
298
  return _processPackage.apply(this, arguments);
300
299
  }
@@ -338,14 +337,27 @@ function _publish() {
338
337
  case 18:
339
338
  console.log('Loading packages:');
340
339
  _context3.next = 21;
341
- return (0, _testUtils.loadPackages)(curDir, packagesToLoad.join(' '), host, false, false, false, args.release);
340
+ return (0, _testUtils.loadPackages)(curDir, packagesToLoad.join(' '), host, false, false, args.link, args.release);
342
341
  case 21:
343
- _context3.next = 25;
342
+ _context3.next = 32;
344
343
  break;
345
344
  case 23:
346
- _context3.next = 25;
345
+ if (!args.link) {
346
+ _context3.next = 30;
347
+ break;
348
+ }
349
+ _context3.next = 26;
350
+ return utils.runScript("npm install", curDir);
351
+ case 26:
352
+ _context3.next = 28;
353
+ return utils.runScript("grok link", curDir);
354
+ case 28:
355
+ _context3.next = 30;
356
+ return utils.runScript("npm run build", curDir);
357
+ case 30:
358
+ _context3.next = 32;
347
359
  return publishPackage(args);
348
- case 25:
360
+ case 32:
349
361
  case "end":
350
362
  return _context3.stop();
351
363
  }
@@ -88,17 +88,18 @@ function runTesting(_x2) {
88
88
  return _runTesting.apply(this, arguments);
89
89
  }
90
90
  function _runTesting() {
91
- _runTesting = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(args) {
91
+ _runTesting = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(args) {
92
92
  var _process$env$TARGET_P;
93
- var testsObj, parsed, organized, filtered, _iterator, _step, element, testsResults, r, _args$benchmark, _args$catchUnhandled, _args$gui, _args$record, _args$report, _args$verbose, testsLeft, testsToReproduce, _iterator2, _step2, testData, reproduced, _iterator3, _step3, _test2, _reproducedTest2;
94
- return _regenerator["default"].wrap(function _callee2$(_context2) {
95
- while (1) switch (_context2.prev = _context2.next) {
93
+ var testsObj, parsed, organized, filtered, _iterator, _step, element, testsResults, r, workerId;
94
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
95
+ while (1) switch (_context3.prev = _context3.next) {
96
96
  case 0:
97
97
  color.info('Loading tests...');
98
- _context2.next = 3;
98
+ _context3.next = 3;
99
99
  return (0, _testUtils.loadTestsList)([(_process$env$TARGET_P = process.env.TARGET_PACKAGE) !== null && _process$env$TARGET_P !== void 0 ? _process$env$TARGET_P : ''], args.core);
100
100
  case 3:
101
- testsObj = _context2.sent;
101
+ testsObj = _context3.sent;
102
+ console.log(testsObj);
102
103
  parsed = (0, _orderFunctions.setAlphabeticalOrder)(testsObj, 1, 1);
103
104
  organized = parsed[0].map(function (testObj) {
104
105
  return {
@@ -132,93 +133,106 @@ function _runTesting() {
132
133
  }
133
134
  color.info('Starting tests...');
134
135
  testsResults = [];
135
- case 10:
136
- _context2.next = 12;
137
- return (0, _testUtils.runWorker)(organized, {
138
- benchmark: (_args$benchmark = args.benchmark) !== null && _args$benchmark !== void 0 ? _args$benchmark : false,
139
- catchUnhandled: (_args$catchUnhandled = args.catchUnhandled) !== null && _args$catchUnhandled !== void 0 ? _args$catchUnhandled : false,
140
- gui: (_args$gui = args.gui) !== null && _args$gui !== void 0 ? _args$gui : false,
141
- record: (_args$record = args.record) !== null && _args$record !== void 0 ? _args$record : false,
142
- report: (_args$report = args.report) !== null && _args$report !== void 0 ? _args$report : false,
143
- verbose: (_args$verbose = args.verbose) !== null && _args$verbose !== void 0 ? _args$verbose : false,
144
- stopOnTimeout: true
145
- }, 1, testInvocationTimeout);
146
- case 12:
147
- r = _context2.sent;
148
- testsLeft = [];
149
- testsToReproduce = [];
150
- _iterator2 = _createForOfIteratorHelper(organized);
151
- try {
152
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
153
- testData = _step2.value;
154
- if (!r.csv.includes("".concat(testData.params.category, ",").concat(testData.params.test))) testsLeft.push(testData);
155
- if (r.verboseFailed.includes("".concat(testData.params.category, ": ").concat(testData.params.test, " : Error:"))) {
156
- testsToReproduce.push(testData);
136
+ workerId = 1;
137
+ _context3.next = 14;
138
+ return (0, _testUtils.timeout)( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
139
+ var _args$benchmark, _args$catchUnhandled, _args$gui, _args$record, _args$report, _args$verbose, testsLeft, testsToReproduce, _iterator2, _step2, testData, reproduced, _iterator3, _step3, _test2, _reproducedTest2;
140
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
141
+ while (1) switch (_context2.prev = _context2.next) {
142
+ case 0:
143
+ _context2.next = 2;
144
+ return (0, _testUtils.runWorker)(organized, {
145
+ benchmark: (_args$benchmark = args.benchmark) !== null && _args$benchmark !== void 0 ? _args$benchmark : false,
146
+ catchUnhandled: (_args$catchUnhandled = args.catchUnhandled) !== null && _args$catchUnhandled !== void 0 ? _args$catchUnhandled : false,
147
+ gui: (_args$gui = args.gui) !== null && _args$gui !== void 0 ? _args$gui : false,
148
+ record: (_args$record = args.record) !== null && _args$record !== void 0 ? _args$record : false,
149
+ report: (_args$report = args.report) !== null && _args$report !== void 0 ? _args$report : false,
150
+ verbose: (_args$verbose = args.verbose) !== null && _args$verbose !== void 0 ? _args$verbose : false,
151
+ stopOnTimeout: true
152
+ }, workerId, testInvocationTimeout);
153
+ case 2:
154
+ r = _context2.sent;
155
+ testsLeft = [];
156
+ testsToReproduce = [];
157
+ _iterator2 = _createForOfIteratorHelper(organized);
158
+ try {
159
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
160
+ testData = _step2.value;
161
+ if (!r.csv.includes("".concat(testData.params.category, ",").concat(testData.params.test))) testsLeft.push(testData);
162
+ if (r.verboseFailed.includes("".concat(testData.params.category, ": ").concat(testData.params.test, " : Error:"))) {
163
+ testsToReproduce.push(testData);
164
+ }
165
+ }
166
+ } catch (err) {
167
+ _iterator2.e(err);
168
+ } finally {
169
+ _iterator2.f();
170
+ }
171
+ if (!(testsToReproduce.length > 0)) {
172
+ _context2.next = 31;
173
+ break;
174
+ }
175
+ _context2.next = 10;
176
+ return reproducedTest(args, testsToReproduce);
177
+ case 10:
178
+ reproduced = _context2.sent;
179
+ _iterator3 = _createForOfIteratorHelper(testsToReproduce);
180
+ _context2.prev = 12;
181
+ _iterator3.s();
182
+ case 14:
183
+ if ((_step3 = _iterator3.n()).done) {
184
+ _context2.next = 23;
185
+ break;
186
+ }
187
+ _test2 = _step3.value;
188
+ _reproducedTest2 = reproduced.get(_test2);
189
+ if (!(_reproducedTest2 && !_reproducedTest2.failed)) {
190
+ _context2.next = 21;
191
+ break;
192
+ }
193
+ _context2.next = 20;
194
+ return updateResultsByReproduced(r, _reproducedTest2, _test2);
195
+ case 20:
196
+ r = _context2.sent;
197
+ case 21:
198
+ _context2.next = 14;
199
+ break;
200
+ case 23:
201
+ _context2.next = 28;
202
+ break;
203
+ case 25:
204
+ _context2.prev = 25;
205
+ _context2.t0 = _context2["catch"](12);
206
+ _iterator3.e(_context2.t0);
207
+ case 28:
208
+ _context2.prev = 28;
209
+ _iterator3.f();
210
+ return _context2.finish(28);
211
+ case 31:
212
+ testsResults.push(r);
213
+ organized = testsLeft;
214
+ workerId++;
215
+ case 34:
216
+ if (r.failed) {
217
+ _context2.next = 0;
218
+ break;
219
+ }
220
+ case 35:
221
+ case "end":
222
+ return _context2.stop();
157
223
  }
158
- }
159
- } catch (err) {
160
- _iterator2.e(err);
161
- } finally {
162
- _iterator2.f();
163
- }
164
- if (!(testsToReproduce.length > 0)) {
165
- _context2.next = 41;
166
- break;
167
- }
168
- _context2.next = 20;
169
- return reproducedTest(args, testsToReproduce);
170
- case 20:
171
- reproduced = _context2.sent;
172
- _iterator3 = _createForOfIteratorHelper(testsToReproduce);
173
- _context2.prev = 22;
174
- _iterator3.s();
175
- case 24:
176
- if ((_step3 = _iterator3.n()).done) {
177
- _context2.next = 33;
178
- break;
179
- }
180
- _test2 = _step3.value;
181
- _reproducedTest2 = reproduced.get(_test2);
182
- if (!(_reproducedTest2 && !_reproducedTest2.failed)) {
183
- _context2.next = 31;
184
- break;
185
- }
186
- _context2.next = 30;
187
- return updateResultsByReproduced(r, _reproducedTest2, _test2);
188
- case 30:
189
- r = _context2.sent;
190
- case 31:
191
- _context2.next = 24;
192
- break;
193
- case 33:
194
- _context2.next = 38;
195
- break;
196
- case 35:
197
- _context2.prev = 35;
198
- _context2.t0 = _context2["catch"](22);
199
- _iterator3.e(_context2.t0);
200
- case 38:
201
- _context2.prev = 38;
202
- _iterator3.f();
203
- return _context2.finish(38);
204
- case 41:
205
- testsResults.push(r);
206
- organized = testsLeft;
207
- case 43:
208
- if (r.failed) {
209
- _context2.next = 10;
210
- break;
211
- }
212
- case 44:
213
- _context2.next = 46;
224
+ }, _callee2, null, [[12, 25, 28, 31]]);
225
+ })), testInvocationTimeout);
226
+ case 14:
227
+ _context3.next = 16;
214
228
  return (0, _testUtils.mergeWorkersResults)(testsResults);
215
- case 46:
216
- return _context2.abrupt("return", _context2.sent);
217
- case 47:
229
+ case 16:
230
+ return _context3.abrupt("return", _context3.sent);
231
+ case 17:
218
232
  case "end":
219
- return _context2.stop();
233
+ return _context3.stop();
220
234
  }
221
- }, _callee2, null, [[22, 35, 38, 41]]);
235
+ }, _callee3);
222
236
  }));
223
237
  return _runTesting.apply(this, arguments);
224
238
  }
@@ -226,22 +240,22 @@ function reproducedTest(_x3, _x4) {
226
240
  return _reproducedTest.apply(this, arguments);
227
241
  }
228
242
  function _reproducedTest() {
229
- _reproducedTest = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(args, testsToReproduce) {
243
+ _reproducedTest = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(args, testsToReproduce) {
230
244
  var res, _iterator4, _step4, _args$benchmark2, _test3, r;
231
- return _regenerator["default"].wrap(function _callee3$(_context3) {
232
- while (1) switch (_context3.prev = _context3.next) {
245
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
246
+ while (1) switch (_context4.prev = _context4.next) {
233
247
  case 0:
234
248
  res = new Map();
235
249
  _iterator4 = _createForOfIteratorHelper(testsToReproduce);
236
- _context3.prev = 2;
250
+ _context4.prev = 2;
237
251
  _iterator4.s();
238
252
  case 4:
239
253
  if ((_step4 = _iterator4.n()).done) {
240
- _context3.next = 12;
254
+ _context4.next = 12;
241
255
  break;
242
256
  }
243
257
  _test3 = _step4.value;
244
- _context3.next = 8;
258
+ _context4.next = 8;
245
259
  return (0, _testUtils.runWorker)([_test3], {
246
260
  benchmark: (_args$benchmark2 = args.benchmark) !== null && _args$benchmark2 !== void 0 ? _args$benchmark2 : false,
247
261
  catchUnhandled: false,
@@ -251,31 +265,31 @@ function _reproducedTest() {
251
265
  verbose: false,
252
266
  stopOnTimeout: true,
253
267
  reproduce: true
254
- }, 1, testInvocationTimeout);
268
+ }, 0, testInvocationTimeout);
255
269
  case 8:
256
- r = _context3.sent;
270
+ r = _context4.sent;
257
271
  if (_test3.params.category && _test3.params.test) res.set(_test3, r);
258
272
  case 10:
259
- _context3.next = 4;
273
+ _context4.next = 4;
260
274
  break;
261
275
  case 12:
262
- _context3.next = 17;
276
+ _context4.next = 17;
263
277
  break;
264
278
  case 14:
265
- _context3.prev = 14;
266
- _context3.t0 = _context3["catch"](2);
267
- _iterator4.e(_context3.t0);
279
+ _context4.prev = 14;
280
+ _context4.t0 = _context4["catch"](2);
281
+ _iterator4.e(_context4.t0);
268
282
  case 17:
269
- _context3.prev = 17;
283
+ _context4.prev = 17;
270
284
  _iterator4.f();
271
- return _context3.finish(17);
285
+ return _context4.finish(17);
272
286
  case 20:
273
- return _context3.abrupt("return", res);
287
+ return _context4.abrupt("return", res);
274
288
  case 21:
275
289
  case "end":
276
- return _context3.stop();
290
+ return _context4.stop();
277
291
  }
278
- }, _callee3, null, [[2, 14, 17, 20]]);
292
+ }, _callee4, null, [[2, 14, 17, 20]]);
279
293
  }));
280
294
  return _reproducedTest.apply(this, arguments);
281
295
  }
@@ -283,10 +297,10 @@ function updateResultsByReproduced(_x5, _x6, _x7) {
283
297
  return _updateResultsByReproduced.apply(this, arguments);
284
298
  }
285
299
  function _updateResultsByReproduced() {
286
- _updateResultsByReproduced = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(curentResult, reproducedResult, testsParams) {
300
+ _updateResultsByReproduced = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(curentResult, reproducedResult, testsParams) {
287
301
  var table2Dict, table1, table2, flakingMap;
288
- return _regenerator["default"].wrap(function _callee4$(_context4) {
289
- while (1) switch (_context4.prev = _context4.next) {
302
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
303
+ while (1) switch (_context5.prev = _context5.next) {
290
304
  case 0:
291
305
  table2Dict = {};
292
306
  table1 = readCSVResultData(curentResult.csv);
@@ -307,12 +321,12 @@ function _updateResultsByReproduced() {
307
321
  });
308
322
  ;
309
323
  curentResult.verboseFailed = curentResult.verboseFailed.replaceAll("".concat(testsParams.params.category, ": ").concat(testsParams.params.test, " : Error:"), "".concat(testsParams.params.category, ": ").concat(testsParams.params.test, " : Flaking Error:"));
310
- return _context4.abrupt("return", curentResult);
324
+ return _context5.abrupt("return", curentResult);
311
325
  case 10:
312
326
  case "end":
313
- return _context4.stop();
327
+ return _context5.stop();
314
328
  }
315
- }, _callee4);
329
+ }, _callee5);
316
330
  }));
317
331
  return _updateResultsByReproduced.apply(this, arguments);
318
332
  }
@@ -349,13 +349,13 @@ function _loadPackages() {
349
349
  _iterator2.s();
350
350
  case 6:
351
351
  if ((_step2 = _iterator2.n()).done) {
352
- _context6.next = 40;
352
+ _context6.next = 41;
353
353
  break;
354
354
  }
355
355
  dirName = _step2.value;
356
356
  packageDir = _path["default"].join(packagesDir, dirName);
357
357
  if (_fs["default"].lstatSync(packageDir).isFile()) {
358
- _context6.next = 38;
358
+ _context6.next = 39;
359
359
  break;
360
360
  }
361
361
  _context6.prev = 10;
@@ -364,64 +364,65 @@ function _loadPackages() {
364
364
  }));
365
365
  packageFriendlyName = packagesToRun.get((_spaceToCamelCase$toL = (0, _utils.spaceToCamelCase)((_ref6 = (_ref7 = (_packageJsonData$frie = packageJsonData["friendlyName"]) !== null && _packageJsonData$frie !== void 0 ? _packageJsonData$frie : packageJsonData["name"].split("/")[1]) !== null && _ref7 !== void 0 ? _ref7 : packageJsonData["name"]) !== null && _ref6 !== void 0 ? _ref6 : '').toLocaleLowerCase()) !== null && _spaceToCamelCase$toL !== void 0 ? _spaceToCamelCase$toL : "");
366
366
  if (!(utils.isPackageDir(packageDir) && (packageFriendlyName !== undefined || packagesToLoad === "all"))) {
367
- _context6.next = 33;
367
+ _context6.next = 34;
368
368
  break;
369
369
  }
370
370
  _context6.prev = 14;
371
+ console.log("Loading package ".concat(dirName));
371
372
  if (!(skipPublish != true)) {
372
- _context6.next = 26;
373
+ _context6.next = 27;
373
374
  break;
374
375
  }
375
- _context6.next = 18;
376
+ _context6.next = 19;
376
377
  return utils.runScript("npm install", packageDir);
377
- case 18:
378
+ case 19:
378
379
  if (!linkPackage) {
379
- _context6.next = 21;
380
+ _context6.next = 22;
380
381
  break;
381
382
  }
382
- _context6.next = 21;
383
+ _context6.next = 22;
383
384
  return utils.runScript("grok link", packageDir);
384
- case 21:
385
+ case 22:
385
386
  if (!(skipBuild != true)) {
386
- _context6.next = 24;
387
+ _context6.next = 25;
387
388
  break;
388
389
  }
389
- _context6.next = 24;
390
+ _context6.next = 25;
390
391
  return utils.runScript("npm run build", packageDir);
391
- case 24:
392
- _context6.next = 26;
392
+ case 25:
393
+ _context6.next = 27;
393
394
  return utils.runScript("grok publish ".concat(hostString).concat(release ? ' --release' : ''), packageDir);
394
- case 26:
395
+ case 27:
395
396
  packagesToRun.set(dirName, true);
396
397
  console.log("Package published ".concat(dirName));
397
- _context6.next = 33;
398
+ _context6.next = 34;
398
399
  break;
399
- case 30:
400
- _context6.prev = 30;
400
+ case 31:
401
+ _context6.prev = 31;
401
402
  _context6.t0 = _context6["catch"](14);
402
403
  console.log("Package wasn't published ".concat(dirName));
403
- case 33:
404
- _context6.next = 38;
404
+ case 34:
405
+ _context6.next = 39;
405
406
  break;
406
- case 35:
407
- _context6.prev = 35;
407
+ case 36:
408
+ _context6.prev = 36;
408
409
  _context6.t1 = _context6["catch"](10);
409
410
  if (utils.isPackageDir(packageDir) && (packagesToRun.get((0, _utils.spaceToCamelCase)(dirName).toLocaleLowerCase()) !== undefined || packagesToLoad === "all")) console.log("Couldn't read package.json ".concat(dirName));
410
- case 38:
411
+ case 39:
411
412
  _context6.next = 6;
412
413
  break;
413
- case 40:
414
- _context6.next = 45;
414
+ case 41:
415
+ _context6.next = 46;
415
416
  break;
416
- case 42:
417
- _context6.prev = 42;
417
+ case 43:
418
+ _context6.prev = 43;
418
419
  _context6.t2 = _context6["catch"](4);
419
420
  _iterator2.e(_context6.t2);
420
- case 45:
421
- _context6.prev = 45;
421
+ case 46:
422
+ _context6.prev = 46;
422
423
  _iterator2.f();
423
- return _context6.finish(45);
424
- case 48:
424
+ return _context6.finish(46);
425
+ case 49:
425
426
  console.log();
426
427
  return _context6.abrupt("return", Array.from(packagesToRun).filter(function (_ref2) {
427
428
  var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
@@ -433,11 +434,11 @@ function _loadPackages() {
433
434
  key = _ref5[0];
434
435
  return key;
435
436
  }));
436
- case 51:
437
+ case 52:
437
438
  case "end":
438
439
  return _context6.stop();
439
440
  }
440
- }, _callee6, null, [[4, 42, 45, 48], [10, 35], [14, 30]]);
441
+ }, _callee6, null, [[4, 43, 46, 49], [10, 36], [14, 31]]);
441
442
  }));
442
443
  return _loadPackages.apply(this, arguments);
443
444
  }
@@ -1,5 +1,5 @@
1
1
  import { runTests, tests, TestContext , initAutoTests as initTests } from '@datagrok-libraries/utils/src/test';
2
- import { DataFrame } from 'datagrok-api/dg';
2
+ import * as DG from 'datagrok-api/dg';
3
3
 
4
4
  export let _package = new DG.Package();
5
5
  export { tests };
@@ -9,7 +9,7 @@ export { tests };
9
9
  //input: string test {optional: true}
10
10
  //input: object testContext {optional: true}
11
11
  //output: dataframe result
12
- export async function test(category: string, test: string, testContext: TestContext): Promise<DataFrame> {
12
+ export async function test(category: string, test: string, testContext: TestContext): Promise<DG.DataFrame> {
13
13
  const data = await runTests({ category, test, testContext });
14
14
  return DG.DataFrame.fromObjects(data)!;
15
15
  }
@@ -1,3 +1,7 @@
1
+ /* Do not change these import lines to match external modules in webpack configuration */
2
+ import * as grok from 'datagrok-api/grok';
3
+ import * as ui from 'datagrok-api/ui';
4
+ import * as DG from 'datagrok-api/dg';
1
5
 
2
6
  export const _package = new DG.Package();
3
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.13.38",
3
+ "version": "4.13.39",
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": {
@@ -1,13 +0,0 @@
1
- import * as grokNamespace from 'datagrok-api/grok';
2
- import * as uiNamespace from 'datagrok-api/ui';
3
- import * as DGNamespace from 'datagrok-api/dg';
4
- import * as rxjsNamespace from 'rxjs';
5
- import $Namespace from 'cash-dom';
6
-
7
- declare global {
8
- const grok: typeof grokNamespace;
9
- const ui: typeof uiNamespace;
10
- const DG: typeof DGNamespace;
11
- const rjxs: typeof rxjsNamespace;
12
- const $: typeof $Namespace;
13
- }