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:
Patryk Kopyciński 2023-11-01 15:28:56 +00:00 committed by GitHub
parent 87ad907be6
commit 858e33fec6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -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') || [];

View file

@ -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();