[Functional Tests] Use @kbn/test on Kibana CI#18967
[Functional Tests] Use @kbn/test on Kibana CI#18967rhoboat merged 22 commits intoelastic:masterfrom rhoboat:archanid-18593
Conversation
tasks/config/run.js
Outdated
There was a problem hiding this comment.
- Remove
test:apirelated code. - Replace it with a call to
@kbn/testcode, scoped to just run api tests. - Run api_integration_tests using the
scripts/functional_tests(which uses@kbn/test- Pass in just the config for api_integration tests
jenkins_config.jsis built on the original with just a change to run ES fromsource
Alternative way to do this:
- Call
runTestsdirectly from@kbn/test, though I'm not sure how to do this. If it needs to be done in a command-line way, then we already have it inscripts/functional_tests. - Allow
test/api_integration/config.jsto take in afrom. - Or allow
scripts/functional_teststo take in a--from.- This approach seems worth trying, for comparison.
|
@tylersmalley @azasypkin @spalger @epixa What do you think so far? I.e. Which of the 3 alternatives would you prefer? |
💔 Build Failed |
|
jenkins test this |
💔 Build Failed |
|
What about a fourth option, the esTestCluster: {
license: 'oss',
- from: 'snapshot',
+ from: process.env.CI ? 'source' : 'snapshot',
serverArgs: [
],
}, |
|
Actually, relying on the I'm personally a fan of the I just ran the |
|
I am also +1 for the command line argument. Running from source is not something that we just want to do for Jenkins, it's also if you are working off an ES feature branch. |
💔 Build Failed |
💔 Build Failed |
|
jenkins test this |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
There was a problem hiding this comment.
These changes seems really redundant.
There was a problem hiding this comment.
Why not just use options['es-from'] || 'snapshot'? This ternary will allow passing --es-from=foo and interpret it as --es-from=snapshot because any none "source" value is ignored.
💔 Build Failed |
💔 Build Failed |
|
jenkins, test this |
💔 Build Failed |
|
hmm. this keeps failing 23:50:16 │ proc [ftr] └- ✖ fail: "management test large number of fields test_huge data should have expected number of fields" |
|
jenkins test this |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
|
@kobelb @azasypkin I've made the default log level |
💚 Build Succeeded |
|
@azasypkin yes, indeed, was waiting for that dev.mode flag removal. 🎉 |
💔 Build Failed |
|
@kobelb I took care of your comments, i think you're out on vacation... |
|
jenkins test this |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
💔 Build Failed |
|
jenkins, test this |
💚 Build Succeeded |
azasypkin
left a comment
There was a problem hiding this comment.
LGTM, looks great! I've run all possible functional/integration tests I could think of in Kibana and x-pack, everything worked flawlessly.
| --help Display this menu and exit. | ||
| --config <file> Pass in a config. Can pass in multiple configs. | ||
| --esFrom <snapshot|source> Build Elasticsearch from source or run from snapshot. Default: snapshot | ||
| --kibana-install-dir <dir> Run Kibana from existing install directory instead of from source. |
There was a problem hiding this comment.
nit: it's the only parameter that uses dashes now, maybe we can make it --kibanaInsallDir just for consistency?
kobelb
left a comment
There was a problem hiding this comment.
LGTM - the improved test coverage is great!
* Replace test:api with @kbn/test runTests * Improve CLI help menu 🆘 * Use --es-from * Replace jenkins:selenium with kbn-test * Validate cli args, fixing test in the process * Clean up some stuff * Code review fixes * Explanation for collectCliArgs * Remove exit codes, they're useless anyway. * Make markdown vis test pass with dev_mode setting * Tests * Remove unneeded export * Code review: move console logging up to cli.js * Code review: refactor startServers and runTests to take single options collection * Code review: Remove all things I am sure we do not use * Improve tests * Code review fixes * Pass created log to runFtr, runElasticsearch, runKibanaServer * Update --es-from option to --esFrom
* [Functional Tests] Use @kbn/test on Kibana CI (#18967) * Replace test:api with @kbn/test runTests * Improve CLI help menu 🆘 * Use --es-from * Replace jenkins:selenium with kbn-test * Validate cli args, fixing test in the process * Clean up some stuff * Code review fixes * Explanation for collectCliArgs * Remove exit codes, they're useless anyway. * Make markdown vis test pass with dev_mode setting * Tests * Remove unneeded export * Code review: move console logging up to cli.js * Code review: refactor startServers and runTests to take single options collection * Code review: Remove all things I am sure we do not use * Improve tests * Code review fixes * Pass created log to runFtr, runElasticsearch, runKibanaServer * Update --es-from option to --esFrom * Let dev server run from snapshot by default
* [Functional Tests] Use @kbn/test on Kibana CI (#18967) * Replace test:api with @kbn/test runTests * Improve CLI help menu 🆘 * Use --es-from * Replace jenkins:selenium with kbn-test * Validate cli args, fixing test in the process * Clean up some stuff * Code review fixes * Explanation for collectCliArgs * Remove exit codes, they're useless anyway. * Make markdown vis test pass with dev_mode setting * Tests * Remove unneeded export * Code review: move console logging up to cli.js * Code review: refactor startServers and runTests to take single options collection * Code review: Remove all things I am sure we do not use * Improve tests * Code review fixes * Pass created log to runFtr, runElasticsearch, runKibanaServer * Update --es-from option to --esFrom * Still need dev_mode setting in 6.3
Addresses #18593
Background
We currently use the
@kbn/testpackage on CI in one place: running X-Pack Functional, API, and SAML API tests. These run in succession with a single script (node scripts/functional_testsfromx-pack/).We'd like to use the package to run OSS Kibana tests on CI as well. Currently we run API tests in the
test:apigrunt task, and Selenium (functional) tests in thejenkins:seleniumgrunt task. We can unify these or keep them separate. (See #18593 for high-level details.)Running from source/snapshot
One of the key requirements:
Now pass in
--esFrom=<source|snapshot>default: snapshotHow to test:
Unit tests
There are Jest tests.
Integration tests
Look at the test run outputs in Jenkins.
Running "run:functional_tests" (run) taskin multijob-selenium taskRunning "run:api_integration_tests" (run) taskin multijob-intake taskThen in the console output, just take a look at how Elasticsearch is started up (from source on CI), how Kibana is run with cli args, and how functional test runner runs.
Manual testing in development