-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kbn-test] convert kibana-install-dir flag to installDir option #21317
Conversation
userOptions.installDir = userOptions['kibana-install-dir']; | ||
delete userOptions['kibana-install-dir']; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines need to be added to https://github.com/elastic/kibana/blob/master/packages/kbn-test/src/functional_tests/cli/start_servers/args.js#L82
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment
💔 Build Failed |
retest |
ec533f5
to
37983ba
Compare
37983ba
to
ac0749b
Compare
…eded Adding a `webpack.DefinePlugin` slows down the optimizer a small amount, so only apply it when it is necessary, and skip it if it is going to be defined as "false".
💔 Build Failed |
💚 Build Succeeded |
@archanid this is ready for another look if you have a chance |
💚 Build Succeeded |
gives me |
How to test, to save people time:
|
@@ -76,7 +76,7 @@ export async function startServers(options) { | |||
config, | |||
options: { | |||
...opts, | |||
extraKbnOpts: [...options.extraKbnOpts, '--dev'], | |||
extraKbnOpts: [...options.extraKbnOpts, ...(options.installDir ? [] : ['--dev'])], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an explanation for this? I'm curious...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The distributable doesn't support the --dev
flag, it's only available when running from source.
@@ -18,7 +18,7 @@ | |||
*/ | |||
|
|||
require('../src/setup_node_env'); | |||
require('../packages/kbn-test').runTestsCli([ | |||
require('@kbn/test').runTestsCli([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
@@ -30,7 +30,7 @@ export class KibanaServerVersion { | |||
|
|||
const status = await this.kibanaStatus.get(); | |||
if (status && status.version && status.version.number) { | |||
this._cachedVersionNumber = status.version.number; | |||
this._cachedVersionNumber = status.version.number + (status.version.build_snapshot ? '-SNAPSHOT' : ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for this change, also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this change just fixes the kibanaServer.version.get()
method to properly mirror the version information used in the Kibana server by relying on the build_snapshot
property in the API response.
This was necessary because the RBAC tests are the only thing relying on this method right now, and they were added while we weren't testing against the distributable, so they started failing when we fixed the --kibana-install-dir
flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine. Just some questions about two things in the code changes.
…tic#21317) * [kbn-test] convert kibana-install-dir flag to installDir option * [kbn-test] replicate kibana-install-dir handling to startServers * [ftr] try running functional tests in production in CI * Revert "[ftr] try running functional tests in production in CI" This reverts commit e5b94aa. * [core/public/legacyPlatform] exclude ui/test_harness from the distributable * [optimizer] fix `process.env.IS_KIBANA_DISTRIBUTABLE` definition * [optimizer] only define `process.env.IS_KIBANA_DISTRIBUTABLE` when needed Adding a `webpack.DefinePlugin` slows down the optimizer a small amount, so only apply it when it is necessary, and skip it if it is going to be defined as "false". * [kbn-test/startServer] don't run in --dev mode if running from dist * [ftr/kibanaServer/version] attach `-SNAPSHOT` suffix to version if running build_snapshot
…tic#21317) * [kbn-test] convert kibana-install-dir flag to installDir option * [kbn-test] replicate kibana-install-dir handling to startServers * [ftr] try running functional tests in production in CI * Revert "[ftr] try running functional tests in production in CI" This reverts commit e5b94aa. * [core/public/legacyPlatform] exclude ui/test_harness from the distributable * [optimizer] fix `process.env.IS_KIBANA_DISTRIBUTABLE` definition * [optimizer] only define `process.env.IS_KIBANA_DISTRIBUTABLE` when needed Adding a `webpack.DefinePlugin` slows down the optimizer a small amount, so only apply it when it is necessary, and skip it if it is going to be defined as "false". * [kbn-test/startServer] don't run in --dev mode if running from dist * [ftr/kibanaServer/version] attach `-SNAPSHOT` suffix to version if running build_snapshot
…) (#21626) * [kbn-test] convert kibana-install-dir flag to installDir option * [kbn-test] replicate kibana-install-dir handling to startServers * [ftr] try running functional tests in production in CI * Revert "[ftr] try running functional tests in production in CI" This reverts commit e5b94aa. * [core/public/legacyPlatform] exclude ui/test_harness from the distributable * [optimizer] fix `process.env.IS_KIBANA_DISTRIBUTABLE` definition * [optimizer] only define `process.env.IS_KIBANA_DISTRIBUTABLE` when needed Adding a `webpack.DefinePlugin` slows down the optimizer a small amount, so only apply it when it is necessary, and skip it if it is going to be defined as "false". * [kbn-test/startServer] don't run in --dev mode if running from dist * [ftr/kibanaServer/version] attach `-SNAPSHOT` suffix to version if running build_snapshot
Fixes #20922
Based on the variable that's extracted from the options object in https://github.com/elastic/kibana/blob/master/packages/kbn-test/src/functional_tests/lib/run_kibana_server.js#L24 the
--kibana-install-dir
flag is expected to be theinstallDir
option, but it's not being transformed as such by thecli/run_tests/args
module. This updated theprocessOptions()
function to convert thekibana-install-dir
option toinstallDir
, which should get the functional tests running against the build output again.