Skip to content

Commit

Permalink
fix(NA): creation of multiple processes on production by splitting no…
Browse files Browse the repository at this point in the history
…_transpilation when setting up node env (elastic#114940)

* fix(NA): adds no_transpilation_dist to avoid preserve_symlinks on dist

* chore(NA): setup node env correctly on functional tests

* chore(NA): try to fix tests

* chore(NA): correctly separate split

* chore(NA): check ensure preserve symlinks need

* chore(NA): investigate path resolve result

* chore(NA): investigate path resolve result #2

* chore(NA): comment out preserve symlinks

* chore(NA): apply fs.realpathSync into the calculated REPO_ROOT paths on babel_register_for_test_plugins

* chore(NA): removes debug code

* chore(NA): move array definition

* chore(NA): correctly import fs

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
mistic and kibanamachine authored Oct 15, 2021
1 parent 871abc6 commit 5fcc118
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

const Fs = require('fs');
const Path = require('path');

const { REPO_ROOT } = require('@kbn/dev-utils');
Expand All @@ -22,7 +23,7 @@ require('@babel/register')({
// TODO: should should probably remove this link back to the source
Path.resolve(REPO_ROOT, 'x-pack/plugins/task_manager/server/config.ts'),
Path.resolve(REPO_ROOT, 'src/core/utils/default_app_categories.ts'),
],
].map((path) => Fs.realpathSync(path)),
babelrc: false,
presets: [require.resolve('@kbn/babel-preset/node_preset')],
extensions: ['.js', '.ts', '.tsx'],
Expand Down
2 changes: 1 addition & 1 deletion src/setup_node_env/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
* Side Public License, v 1.
*/

require('./no_transpilation');
require('./no_transpilation_dist');
require('./polyfill');
10 changes: 1 addition & 9 deletions src/setup_node_env/no_transpilation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,4 @@
*/

require('./ensure_node_preserve_symlinks');

// The following require statements MUST be executed before any others - BEGIN
require('./exit_on_warning');
require('./harden');
// The following require statements MUST be executed before any others - END

require('symbol-observable');
require('source-map-support/register');
require('./node_version_validator');
require('./no_transpilation_dist');
16 changes: 16 additions & 0 deletions src/setup_node_env/no_transpilation_dist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

// The following require statements MUST be executed before any others - BEGIN
require('./exit_on_warning');
require('./harden');
// The following require statements MUST be executed before any others - END

require('symbol-observable');
require('source-map-support/register');
require('./node_version_validator');

0 comments on commit 5fcc118

Please sign in to comment.