datagrok-tools 4.12.19 → 4.12.20

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.
@@ -12,7 +12,7 @@ var HELP_CONFIG = "\nUsage: grok config\n\nCreate or update a configuration file
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
13
  var HELP_PUBLISH = "\nUsage: grok publish [host]\n\nUpload a package\n\nOptions:\n[--build|--rebuild] [--debug|--release] [-k | --key] [--suffix]\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
- var HELP_TEST = "\nUsage: grok test\n\nOptions:\n[--category] [--host] [--csv] [--gui] [--skip-build] [--skip-publish] [--catchUnhandled] [--report] [--record] [--verbose]\n\n--category Specify a category name 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 package author (default=false)\n--skip-build Skip the package build step\n--skip-publish Skip the package publication step\n--record Records the test execution process in mp4 format\n--verbose Prints detailed information about passed and skipped tests in the console\n\nRun package tests\n\nSee instructions:\nhttps://datagrok.ai/help/develop/how-to/test-packages#local-testing\n";
15
+ var HELP_TEST = "\nUsage: grok test\n\nOptions:\n[--category] [--host] [--csv] [--gui] [--skip-build] [--skip-publish] [--catchUnhandled] [--report] [--record] [--verbose] [--platform]\n\n--category Specify a category name 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 package author (default=false)\n--skip-build Skip the package build step\n--skip-publish Skip the package publication step\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 only for ApiTests package)\n\nRun package tests\n\nSee instructions:\nhttps://datagrok.ai/help/develop/how-to/test-packages#local-testing\n";
16
16
  var HELP_LINK = "\nUsage: grok link\n\nLink `datagrok-api` and libraries for local development\n\nOptions:\n[--local | --npm]\n\n--local Default. Links libraries and updates package scripts (\"link-all\", \"build-all\")\n--npm Unlinks local packages and runs `npm i`\n";
17
17
 
18
18
  // const HELP_MIGRATE = `
@@ -24,7 +24,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
24
24
 
25
25
  function test(args) {
26
26
  var options = Object.keys(args).slice(1);
27
- var commandOptions = ['host', 'csv', 'gui', 'catchUnhandled', 'report', 'skip-build', 'skip-publish', 'category', 'record', 'verbose', 'benchmark'];
27
+ var commandOptions = ['host', 'csv', 'gui', 'catchUnhandled', 'platform', 'report', 'skip-build', 'skip-publish', 'category', 'record', 'verbose', 'benchmark'];
28
28
  var nArgs = args['_'].length;
29
29
  var curDir = process.cwd();
30
30
  var grokDir = _path["default"].join(_os["default"].homedir(), '.grok');
@@ -65,6 +65,10 @@ function test(args) {
65
65
  color.error('Invalid package name. Set the `name` field in `package.json`');
66
66
  return false;
67
67
  }
68
+ if (args.platform && process.env.TARGET_PACKAGE !== 'ApiTests') {
69
+ color.error('--platform flag can only be used in the ApiTests package');
70
+ return false;
71
+ }
68
72
  if (args['skip-build']) {
69
73
  if (args['skip-publish']) test();else publish(test);
70
74
  } else build(args['skip-publish'] ? test : function () {
@@ -160,7 +164,7 @@ function test(args) {
160
164
  return page.evaluate(function (targetPackage, options, testContext) {
161
165
  if (options.benchmark) window.DG.Test.isInBenchmark = true;
162
166
  return new Promise(function (resolve, reject) {
163
- window.grok.functions.call("".concat(targetPackage, ":test"), {
167
+ window.grok.functions.call("".concat(targetPackage, ":").concat(options.platform ? 'testPlatform' : 'test'), {
164
168
  'category': options.category,
165
169
  'testContext': testContext
166
170
  }).then(function (df) {
@@ -273,6 +277,7 @@ function test(args) {
273
277
  return runTest(7200000, {
274
278
  category: args.category,
275
279
  verbose: args.verbose,
280
+ platform: args.platform,
276
281
  catchUnhandled: args.catchUnhandled,
277
282
  report: args.report,
278
283
  record: args.record,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.12.19",
3
+ "version": "4.12.20",
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": {