datagrok-tools 4.14.68 → 4.14.69

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.
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.stressTests = stressTests;
8
8
  var _fs = _interopRequireDefault(require("fs"));
9
+ var _child_process = require("child_process");
9
10
  var _path = _interopRequireDefault(require("path"));
10
11
  var utils = _interopRequireWildcard(require("../utils/utils"));
11
12
  var _testUtils = _interopRequireWildcard(require("../utils/test-utils"));
@@ -30,13 +31,36 @@ async function stressTests(args) {
30
31
  process.exit(1);
31
32
  }
32
33
  const config = (0, _testUtils.getDevKey)(args.host);
33
- await testUtils.loadPackage('', 'ApiTests', args.host, args['skip-publish'], args['skip-build']);
34
+ await testUtils.loadPackage('', 'ApiTests', args.host, args['skip-publish'], args['skip-build'], false, true);
35
+ process.stdout.write(`Building node...`);
34
36
  await utils.runScript(`npm run build-node`, '');
37
+ process.stdout.write(` success!\n`);
35
38
  try {
36
- await utils.runScript(`node -r ./tsconfig-paths-bootstrap.js dist-node/package-test-node.js --apiUrl=${config.url} --devKey=${config.key} --concurrentRuns=${args["concurrent-runs"] ?? 1}${args.loop ? ' --loop' : ''}`, '');
39
+ await run(config, args);
37
40
  return true;
38
41
  } catch (e) {
39
42
  console.error(`❌ Error: Something went wrong: ${e}`);
40
43
  return false;
41
44
  }
45
+ }
46
+ async function run(config, args) {
47
+ const processArgs = [];
48
+ processArgs.push('-r');
49
+ processArgs.push('./tsconfig-paths-bootstrap.js');
50
+ processArgs.push('dist-node/package-test-node.js');
51
+ processArgs.push(`--apiUrl=${config.url}`);
52
+ processArgs.push(`--devKey=${config.key}`);
53
+ if (args["concurrent-runs"]) processArgs.push(`--concurrentRuns=${args["concurrent-runs"]}`);
54
+ if (args['loop']) processArgs.push(`--loop`);
55
+ if (args['concurrency-range']) processArgs.push(`--concurrencyRange=${args["concurrency-range"]}`);
56
+ if (args['step']) processArgs.push(`--step=${args["step"]}`);
57
+ const child = (0, _child_process.spawn)('node', processArgs, {
58
+ cwd: '',
59
+ stdio: ['inherit', 'inherit', 'inherit']
60
+ });
61
+ return new Promise((resolve, reject) => {
62
+ child.on('exit', code => {
63
+ if (code === 0) resolve(code);else reject(new Error(`Stress tests exited with code ${code}`));
64
+ });
65
+ });
42
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "4.14.68",
3
+ "version": "4.14.69",
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": {