datagrok-tools 4.12.19 → 4.12.21
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/README.md +4 -2
- package/bin/commands/help.js +1 -1
- package/bin/commands/test.js +18 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -129,8 +129,10 @@ Read more about package development in [Datagrok's documentation](https://datagr
|
|
|
129
129
|
| host | Specify server alias |
|
|
130
130
|
| record | Records the test execution process in mp4 format |
|
|
131
131
|
| report | Sends a report on test results |
|
|
132
|
-
| skip-build | Skips package build step
|
|
133
|
-
| skip-publish | Skips package publish step
|
|
132
|
+
| skip-build | Skips package build step |
|
|
133
|
+
| skip-publish | Skips package publish step |
|
|
134
134
|
| verbose | Prints detailed information about passed and skipped tests in the console |
|
|
135
|
+
| platform | Runs only platform tests (applicable for ApiTests package only) |
|
|
136
|
+
| core | Runs package & core tests (applicable for DevTools package only) |
|
|
135
137
|
|
|
136
138
|
- `link` command is used for public plugins development to link `datagrok-api` and libraries.
|
package/bin/commands/help.js
CHANGED
|
@@ -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 for ApiTests package only)\n--core Runs package & core tests (applicable for DevTools package only)\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 = `
|
package/bin/commands/test.js
CHANGED
|
@@ -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', 'core', '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,14 @@ 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
|
+
}
|
|
72
|
+
if (args.core && process.env.TARGET_PACKAGE !== 'DevTools') {
|
|
73
|
+
color.error('--core flag can only be used in the DevTools package');
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
68
76
|
if (args['skip-build']) {
|
|
69
77
|
if (args['skip-publish']) test();else publish(test);
|
|
70
78
|
} else build(args['skip-publish'] ? test : function () {
|
|
@@ -160,10 +168,12 @@ function test(args) {
|
|
|
160
168
|
return page.evaluate(function (targetPackage, options, testContext) {
|
|
161
169
|
if (options.benchmark) window.DG.Test.isInBenchmark = true;
|
|
162
170
|
return new Promise(function (resolve, reject) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
171
|
+
var params = {
|
|
172
|
+
category: options.category,
|
|
173
|
+
testContext: testContext
|
|
174
|
+
};
|
|
175
|
+
if (targetPackage === 'DevTools') params.skipCore = options.core ? false : true;
|
|
176
|
+
window.grok.functions.call("".concat(targetPackage, ":").concat(options.platform ? 'testPlatform' : 'test'), params).then(function (df) {
|
|
167
177
|
var failed = false;
|
|
168
178
|
var skipReport = '';
|
|
169
179
|
var passReport = '';
|
|
@@ -273,10 +283,12 @@ function test(args) {
|
|
|
273
283
|
return runTest(7200000, {
|
|
274
284
|
category: args.category,
|
|
275
285
|
verbose: args.verbose,
|
|
286
|
+
platform: args.platform,
|
|
276
287
|
catchUnhandled: args.catchUnhandled,
|
|
277
288
|
report: args.report,
|
|
278
289
|
record: args.record,
|
|
279
|
-
benchmark: args.benchmark
|
|
290
|
+
benchmark: args.benchmark,
|
|
291
|
+
core: args.core
|
|
280
292
|
});
|
|
281
293
|
case 12:
|
|
282
294
|
r = _context3.sent;
|
package/package.json
CHANGED