mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Add support for --inspect in the Kibana server (#169848)
## Summary Adds support for `--inspect` flag in Cypress tests that allows to start Kibana with Node.js Inspector enabled https://nodejs.org/en/docs/guides/debugging-getting-started#enable-inspector --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
87ad907be6
commit
858e33fec6
2 changed files with 8 additions and 1 deletions
|
@ -24,6 +24,7 @@ export async function runKibanaServer(options: {
|
|||
extraKbnOpts?: string[];
|
||||
logsDir?: string;
|
||||
onEarlyExit?: (msg: string) => void;
|
||||
inspect?: boolean;
|
||||
}) {
|
||||
const { config, procs } = options;
|
||||
const runOptions = options.config.get('kbnTestServer.runOptions');
|
||||
|
@ -51,6 +52,10 @@ export async function runKibanaServer(options: {
|
|||
? [Path.relative(procRunnerOpts.cwd, Path.resolve(REPO_ROOT, 'scripts/kibana'))]
|
||||
: [];
|
||||
|
||||
if (options.inspect) {
|
||||
prefixArgs.unshift('--inspect');
|
||||
}
|
||||
|
||||
const buildArgs: string[] = config.get('kbnTestServer.buildArgs') || [];
|
||||
const sourceArgs: string[] = config.get('kbnTestServer.sourceArgs') || [];
|
||||
const serverArgs: string[] = config.get('kbnTestServer.serverArgs') || [];
|
||||
|
|
|
@ -81,7 +81,8 @@ export const cli = () => {
|
|||
}
|
||||
return acc;
|
||||
}, {} as Record<string, string | number>)
|
||||
);
|
||||
)
|
||||
.boolean('inspect');
|
||||
|
||||
log.info(`
|
||||
----------------------------------------------
|
||||
|
@ -319,6 +320,7 @@ ${JSON.stringify(
|
|||
? []
|
||||
: ['--dev', '--no-dev-config', '--no-dev-credentials'],
|
||||
onEarlyExit,
|
||||
inspect: argv.inspect,
|
||||
});
|
||||
|
||||
await providers.loadAll();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue