datagrok-tools 4.12.20 → 4.12.22
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 +22 -8
- 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] [--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
|
|
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', 'platform', 'report', 'skip-build', 'skip-publish', '
|
|
27
|
+
var commandOptions = ['host', 'csv', 'gui', 'catchUnhandled', 'platform', 'core', 'report', 'skip-build', 'skip-publish', 'path', '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');
|
|
@@ -69,6 +69,10 @@ function test(args) {
|
|
|
69
69
|
color.error('--platform flag can only be used in the ApiTests package');
|
|
70
70
|
return false;
|
|
71
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
|
+
}
|
|
72
76
|
if (args['skip-build']) {
|
|
73
77
|
if (args['skip-publish']) test();else publish(test);
|
|
74
78
|
} else build(args['skip-publish'] ? test : function () {
|
|
@@ -164,10 +168,19 @@ function test(args) {
|
|
|
164
168
|
return page.evaluate(function (targetPackage, options, testContext) {
|
|
165
169
|
if (options.benchmark) window.DG.Test.isInBenchmark = true;
|
|
166
170
|
return new Promise(function (resolve, reject) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
+
var params = {
|
|
172
|
+
testContext: testContext
|
|
173
|
+
};
|
|
174
|
+
if (options.path) {
|
|
175
|
+
var split = options.path.split(' -- ');
|
|
176
|
+
params.category = split[0];
|
|
177
|
+
params.test = split[1];
|
|
178
|
+
}
|
|
179
|
+
if (targetPackage === 'DevTools') {
|
|
180
|
+
params.skipCore = options.core ? false : true;
|
|
181
|
+
params.verbose = options.verbose === true;
|
|
182
|
+
}
|
|
183
|
+
window.grok.functions.call("".concat(targetPackage, ":").concat(options.platform ? 'testPlatform' : 'test'), params).then(function (df) {
|
|
171
184
|
var failed = false;
|
|
172
185
|
var skipReport = '';
|
|
173
186
|
var passReport = '';
|
|
@@ -178,7 +191,7 @@ function test(args) {
|
|
|
178
191
|
};
|
|
179
192
|
if (df == null) {
|
|
180
193
|
failed = true;
|
|
181
|
-
failReport = "Fail reason: No package tests found".concat(options.
|
|
194
|
+
failReport = "Fail reason: No package tests found".concat(options.path ? " for path \"".concat(options.path, "\"") : '');
|
|
182
195
|
resolve({
|
|
183
196
|
failReport: failReport,
|
|
184
197
|
skipReport: skipReport,
|
|
@@ -275,13 +288,14 @@ function test(args) {
|
|
|
275
288
|
case 10:
|
|
276
289
|
_context3.next = 12;
|
|
277
290
|
return runTest(7200000, {
|
|
278
|
-
|
|
291
|
+
path: args.path,
|
|
279
292
|
verbose: args.verbose,
|
|
280
293
|
platform: args.platform,
|
|
281
294
|
catchUnhandled: args.catchUnhandled,
|
|
282
295
|
report: args.report,
|
|
283
296
|
record: args.record,
|
|
284
|
-
benchmark: args.benchmark
|
|
297
|
+
benchmark: args.benchmark,
|
|
298
|
+
core: args.core
|
|
285
299
|
});
|
|
286
300
|
case 12:
|
|
287
301
|
r = _context3.sent;
|
package/package.json
CHANGED