Commit graph

163 commits

Author SHA1 Message Date
Aleh Zasypkin 1a103c02e4
[@kbn/es] Add a predefined list of Elasticsearch secure settings to be added into keystore. Re-enable OIDC tests. (#42239) 2019-08-01 09:14:51 +02:00
Spencer a95ae8c037
[prettier] upgrade to 1.18.2 (#40229)
* [prettier] upgrade to 1.18.2

* autofix prettier violations
2019-07-03 12:36:44 -07:00
Mikhail Shustov a75d777bea
New Platform and Legacy platform servers integration (#39047)
* New and Legacy platforms share http server instance.

Required to use a common security interceptor for incoming http requests

* generate docs

* remove excessive contract method

* add test for New platform compatibility

* address comments part #1

* log server running only for http server

* fix test. mutate hapi request headers for BWC with legacy

* return 503 on start

* address @eli comments

* address @joshdover comments
2019-06-19 16:32:37 +02:00
liza-mae 0003a32f56
[WIP] FTR Percy changes (#36897)
* [ftr/percy] integrate percy with functional test runner

* execute ftr within `percy exec`

* share PERCY_BIN and GRUNT_BIN vars in setup

* [license] whitelist `(Unlicense OR Apache-2.0)`

* [percy] include pr/parallel info in env

* echo the actual variable value

* destructure required modules

* [ci] calculate percy env in a script

* remove outdated eslint overrides

* oops, nonce should be the same for each build

* take snapshots in context tests

* add percy snapshots to some dashboard tests

* account for extra execution of PERCY_BIN

* remove usage of percy service

* rename service to `visualTesting`

* write a simple test

* switch left-over percy test to visualTesting

* set log level for percy agent

* trigger ci

* try using the system chrome install instead of downloading one

* fix export definition

* Don't skip chromium download

* Add Spencer's fix to point to chrome installation

* Attempting to split tests into own ci job and test files

* Renumber job

* Add tag to decorations file

* Try new files with existing CI job

* Try again to create a new CI job

* Fix eslint problem with space

* eslint updates

* fix console test

* make test names unique

* Update ci group names

* Try old name again

* save

* add separate visual_regression ci job

* add visual regression ci job

* add new job to jobs.yml

* update path to take_percy_snapshot script

* use fixed percy job total

* fix common services import

* move visual_create_and_add_embeddables to visual_regression project

* finish moving create_and_add_embeddables

* add x-pack visual regression job

* migrate dashboard_snapshots tests to visual_regression

* remove references to removed test files

* restore some unnecessary changes

* reimplement the login page tests

* yarn.lock update

* fix test

* remove old CI_GROUP 100 block

* update failed_tests trap

* reduce yarn.lock changes

* disable debug logging

* disable visual-regression tests for now, we can enable them in specific prs
2019-06-14 10:35:23 -06:00
renovate[bot] 4b3915ea74 Update dependency tmp to v0.1.0 (#38590) 2019-06-10 15:59:18 -07:00
Dmitry Lemeshko f82e92a077 FTR: add support for Firefox browser (#32509)
* skip and adjust functional tests for Firefox

* downgrade geckodriver to 0.22.0

* [ftr] add firefox specific config file

* remove hard coded firefox adjustments

* remove firefox specific screenshot directory

* run functional tests in firefox in x-pack

* pass the logger to readConfigFile()

* rename local var

* skip xpack firefox config

* run xpack firefox functional tests in separate command

* update report name for XPack firefox results

* adjust viz shared item test

* skip shared item test

* [test/feature_controls] increase timeout to 20 sec & use forceLogout

* FF timeout on TSVB, refresh page on failure for url navigation

* [feature_controls/visualize_security] increase timeout to 20 sec

* skip dev_tools_spaces tests on FF

* run all groups 3 times

* skip more func tests

* skip more tests

* skip all feature controls tests for Firefox

* revert back changes in feature controls tests

* rename xpack report for chrome

* skip tile map for FF, wait for render before saving

* Revert "run all groups 3 times"

This reverts commit 12b4f69627.

* revert refresh on login

* apply feedback
2019-05-31 15:49:18 -07:00
renovate[bot] c60e3491a2 chore(deps): update dependency del to v4 (#37466)
* chore(deps): update dependency del to v4

* remove @types/del since they ship with the package now
2019-05-30 13:40:35 -07:00
renovate[bot] 830bd1f0ca Update babel related packages (#37464) 2019-05-30 13:40:23 -07:00
renovate[bot] 9256c74fdf Pin dependencies (#37406)
* Pin dependencies

* include core-js in babel packages

* specify core-js version when using `useBuiltIns`

* dedupe @babel/types to avoid "range of null" problem
2019-05-30 00:31:01 -07:00
Aleh Zasypkin 580edcd1c1
Introduce Kerberos authentication provider. (#36112) 2019-05-29 10:40:19 +03:00
Spencer 5bc035226f
[cli/dev] allow running --dev without kibana.dev.yml (#36400)
* [cli/dev] allow running --dev without kibana.dev.yml

* disable kibana.dev.yml for functional test servers

* [cli/dev] automatically strip xpack config when running --oss

* revert bad merge artifact
2019-05-20 10:18:12 -07:00
Tyler Smalley 860977694b
[kbn-es] Security updates (#36288)
* In kbn-test, provide password to cluster.start()
* Security enabled by default, overwrite by passing `-E "xpack.security.enabled=false"`

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-05-08 12:25:26 -07:00
Peter bc90140f8e
enable security plugin in basic (#35891)
enable security on file dataviz and import (ML plugin)

update unit tests

add api test coverage for security in basic

move audit logging to standard+ license level
2019-05-03 11:21:32 -07:00
Tyler Smalley 8f782a8dbd
[kbn-es] Set password for native realm accounts (#35586)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-05-01 09:34:14 -07:00
Spencer 9122511370
[ftr] convert remaining JS to TS (#35110) 2019-04-18 12:06:24 -07:00
Greg Thompson e05098dd27
Upgrade EUI to v10.0.1 (#35112)
* eui@10.0.0; tsconfig update

* limit key lookups to strings

* Search Profiler hightlight details flyout classes

* bump

* snapshot updates

* x-pack snapshot updates
2019-04-17 09:16:34 -05:00
Spencer cce64060d0
[npm] upgrade getopts (#34603)
getopts added the `string` option in a recent version, which I didn't realize when I made updates to src/dev/run/run.ts, which rely on this option. To make sure it is available this updates getopts in all projects from `2.x` to `^2.2.4`
2019-04-15 14:39:34 -07:00
Tiago Costa 20bdf7d4a9
Migration to Babel7 and @babel/preset-typescript (#33093)
* chore(NA): first changes on every package.json order to support new babel 7. chore(NA): build for kbn-pm with babel 7.

* chore(NA): patch babel register to load typescrit

* chore(NA): first working version with babel 7 replacing typescript compiler.

* fix(NA): common preset declaration in order to make it work with babel-loader.

* chore(na): organizing babel preset env package json.

* chore(NA): mocha tests enabled.

* fix(NA): typo on importing

* test(NA): majority of x-pack tests ported to use babel-jest

* fix(NA): report info button test with babel-jest.

* fix(NA): polling service tests.

* test(na): fix server plugins plugin tests.

* test(NA): batch of test fixs for jest tests under babel-jest hoisting.

* chore(NA): add babel plugin to hoist mock prefixed vars on jest tests.

* chore(NA): update yarn.lock file.

* chore(NA): tests passing.

* chore(NA): remove wrong dep

* chore(NA): fix tsconfig

* chore(NA): skip babel for ts-jest.

* chore(NA): selectively apply the plugin to strip off namespace from ts files.

* chore(NA): remove not needed changes from ts tests

* chore(NA): removed ts-jest dependency. chore(NA): migrate ts tests on x-pack to use babel-jest with the new pattern.

* chore(NA): migrate kibana default distribution typescript tests to run with babel-jest and the new test mock pattern.

* chore(NA): merge and solve conflicts with master.

* chore(NA): fix problems reported by eslint

* chore(NA): fix license ovveride for babel-plugin-mock-imports

* chore(NA): update jest integration tests for kbn pm

* chore(NA): update babel jest integration tests for kbn pm.

* test(NA): update jest integration snapshot for kbn pm.

* chore(NA): apply changes according to the pull request reviews.

* chore(NA): apply changes according to the pull request reviews.

* refact(NA): migrate jest tests to the new pattern.

* fix(NA): babel 7 polyfill in the tests bundle.

* chore(NA): restore needed step in order to compile x-pack with typescript.

* chore(NA): change build to compile typescript with babel for the oss code. chore(NA): change transpile typescript task to only transpile types for x-pack. refact(NA): common preset for babel 7

* Revert "chore(NA): change build to compile typescript with babel for the oss code. chore(NA): change transpile typescript task to only transpile types for x-pack. refact(NA): common preset for babel 7"

This reverts commit 2707d538f5.

* fix(NA): import paths for tabConfigConst

* chore(NA): fix transpiling error on browser tests

* chore(NA): simplify kbn babel preset package.

* chore(NA): migrate build to use babel transpiler for typescript excluding xpack.

* fix(NA): introduced error on test quick task.

* fix(NA): fix preset for client side code on build.

* fix(NA): build with babel

* fix(NA): negated patterns in the end.

* fix(NA): kbn_tp_sample_panel_action creation.

* fix(NA): babel typescript transform plugin workaround when exporting interface name.

* refact(NA): remove not needed type cast to any on jest test.

* docs(NA): add developement documentation about jest mocks test pattern.

* chore(NA): missing unmerged path.

* chore(NA): fix jest tests for template.

* [CCR] Client integration tests (table lists) (#33525)

* Force user to re-authenticate if token refresh fails with `400` status code. (#33774)

* Improve performance of the Logstash Pipeline Viewer (#33793)

Resolves #27513.

_This PR is a combination of #31293 (the code changes) + #33570 (test updates). These two PRs were individually reviewed and merged into a feature branch. This combo PR here simply sets up the merge from the feature branch to `master`._

Summary of changes, taken from #31293:

## Before this PR
The Logstash Pipeline Viewer UI would make a single Kibana API call to fetch all the information necessary to render the Logstash pipeline. This included information necessary to render the detail drawer that opens up when a user clicks on an individual vertex in the pipeline.

Naturally, this single API call fetched _a lot_ of data, not just from the Kibana server but also, in turn, from Elasticsearch as well. The "pro" of this approach was that the user would see instantaneous results if they clicked on a vertex in a pipeline and opened the detail drawer for that vertex. The "cons" were the amount of computation Elasticsearch had to perform and the amount of data being transferred over the wire between Elasticsearch and the Kibana server as well as between the Kibana server and the browser.

## With this PR
This PR makes the Kibana API call to fetch data necessary for **initially** rendering the pipeline — that is, with the detail drawer closed — much lighter. When the user clicks on a vertex in a pipeline, a second API call is then made to fetch data necessary for the detail drawer.

## Gains, by the numbers

Based on a simple, 1-input, 1-filter, and 1-output pipeline.

* Before this PR, the Elasticsearch `logstash_stats` API responses (multiple calls were made using the `composite` aggregation over the `date_histogram` aggregation) generated a total of 1228 aggregation buckets (before any `filter_path`s were applied but across all `composite` "pages"). With this PR, the single `logstash_stats` API response (note that this is just for the initial rendering of the pipeline, with the detail drawer closed) generated 12 buckets (also before any `filter_path`s were applied). That's a **99.02% reduction** in number of buckets.

* Before this PR, the Elasticsearch `logstash_stats` API responses added up to 70319 bytes. With this PR, the single `logstash_stats` API response for the same pipeline is 746 bytes. That's a **98.93% reduction** in size.

* Before this PR, the Elasticsearch `logstash_state` API response was 7718 bytes. With this PR, the API response for the same pipeline is 2328 bytes. That's a **69.83% reduction** in size.

* Before this PR the Kibana API response was 51777 bytes. With this PR, the API response for the same pipeline is 2567 bytes (again, note that this is just for the initial rendering of the pipeline, with the detail drawer closed). That's a **95.04% reduction** in size.

* [Maps] split settings into layer and source panels (#33788)

* [Maps] split settings into layer and source panels

* fix SCSS import

* [env] exit if starting as root (#21563)

* [env] exit if starting as root

* fix windows

* s/--allow-root

* Typescript sample panel action (#33602)

* Typescript sample panel action

* Update EUI version to match main cabana version

* update yarn.lock

* add back typings include

* use correct relative path

* Home page "recent links" should communicate saved object type #21896 (#33694)

* adds object type for screen order
* adds object type for pointer hovering
* Update src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx

Co-Authored-By: rockfield <philipp.b@ya.ru>
2019-03-26 20:44:03 +00:00
Spencer 2e232c2e31
[@kbn/expect] "fork" expect.js into repo (#33761)
* [@kbn/expect] "fork" expect.js into repo

* [eslint] autofix references to expect.js

* [tslint] autofix all expect.js imports

* now that expect.js is in strict mode, avoid reassigning fn.length
2019-03-25 09:56:48 -07:00
Spencer 06195e9d8b
Refactor ES-related environment variables (#33036)
* [ci/es] base default es version on pkg.branch value

* [ci/env] initialize $TEST_ES_FROM in checkout_sibling_es.sh

* [UA] remove TEST_ES_SNAPSHOT_VERSION override

* [ci/es] call checkout_sibling_es.sh from one location

* [ci] remove unused `--from` param

* [ci/env] always default to snapshots, switch to source when necessary

* [kbn/test] default esFrom to $TEST_ES_FROM

* [ci/setup] fix define order

* [ci/grunt] don't pass --esFrom let env pass through

* [ci/env] use branch, not version

* [ci] use same indent style as following lines

* [kbn/test] apply default values when processing args

* [kbn/test] simplify defaults, read default on each process
2019-03-13 11:51:06 -07:00
Spencer a7e1061bad
Typescript-ify FTR Remote (#32447)
* [ftr] flatten GenericProviderTypes to fix "log" types

* [ftr/remote] typscript-ify

* remove webdriver types, since they're version 3 and we're using version 4

* simplify initWebDriver() function

* keep jest tests in the functional tests as js, mixing jest and mocha types doesn't work
2019-03-06 07:25:59 -08:00
Spencer 4749c6aab6
[ts][ftr] improve types for ftr and expect.js, cleanup changes to tsconfig files (#31948)
In https://github.com/elastic/kibana/pull/31234 there were some extra changes that I've reverted, like use of the `tsconfig-paths` package to magically rewrite import statements to defy the standard node module resolution algorithm, the inclusion of several unnecessary options in the `test/tsconfig.json` file, and changes of the line-endings in the config files. This also brings a few enhancements from https://github.com/elastic/kibana/pull/30190 including a modularized version of the expect.js types, and options for explicit mappings for the PageObjects and services used in ftr tests.
2019-02-28 12:06:00 -08:00
Spencer ae3632b559
[kbn-test] upgrade to babel7, add ts support (#32168)
* [babel] add babel7 compatible node preset

* [kbn-test] upgrade to babel7 preset
2019-02-28 09:56:19 -08:00
Jonathan Budzenski e9f0006890
Remove es _xpack endpoint usage (#29465)
* _xpack/rollup -> _rollup

* _xpack/sql -> _sql

* _xpack/license -> _license

* _xpack/migration -> _migration

* _xpack/watcher -> _watcher

* _xpack/monitoring -> _monitoring

* _xpack/security -> _security

* [console_extensions] regenerate

* [console_extensions] update ml overrides

* [console_extensions] update security overrides

* [console_extensions] update rollup overrides

* Revert "[console_extensions] update rollup overrides"

This reverts commit bb3742570d.

* Revert "[console_extensions] update security overrides"

This reverts commit 5c0263b35e.

* Revert "[console_extensions] update ml overrides"

This reverts commit e8254d5671.

* Revert "[console_extensions] regenerate"

This reverts commit 91b754e956.
2019-01-29 13:28:32 -06:00
Josh Dover 45a4d3bce0
[kbn-es] Add support to kbn-es and kbn-test for data archives (#28723)
* Add support to kbn-es and kbn-test for data archives

* Fix log indent

* Decompress directly to data directory

Co-Authored-By: joshdover <me@joshdover.com>

* Improve logs
2019-01-23 16:45:19 -06:00
nicknak 7cc7147cd5
Testing x pack jest integration (#26825)
* progress

* progress

* cleanup and elastic configs

* make upgrades to support adding aditional users, with

* use defaultDeep to ensure settings pass correctly

* move needed configs to start servers into kbn_server (except x-pack plugin paths and users)

* move xpack config to an export

* add more time

* diff rollbacks

* roll back prettier diff

* revert setupUsers signature

* remove more bluebird

* update bluebird for fixes with jest compatability

* fix ts errors

* dont allow jest to keep going making errors confising

* Separates configs for jest integration core/x-pack.

* Pass nested kbn config parameters.

* Adds example x-pack integration test using live es.

* Cloud detectors should be configurable for tests.

* Cloud detectors should use native promises only.

* No erroneous comments...

* Util is only for promisify, duh!

* New tests should have docuementation to help those looking to utilize them.

* Doc section headings should be consistent with each other.

* With git there is no need to commit commented code.
2019-01-10 14:31:12 -05:00
Brandon Kobel 2fa3cd8bf4 Changing from /_xpack/security/ to /_security/ (#26922)
* Changing from /_xpack/security/ to /_security/

* Putting ML's routes back, will be addressed separately
2018-12-18 09:34:24 -05:00
Aleh Zasypkin 6995ea9513
Remove ES node discovery settings from test configuration. (#27125) 2018-12-15 00:52:55 +01:00
Aleh Zasypkin b187a01a60 @kbn/test - include node.name and cluster.initial_master_nodes settings when starting ES. 2018-12-13 18:53:35 +01:00
Spencer c122fa96a0
[eslint] use disallow license header rule (#26309)
Fixes #26295

There are several places where we have accidentally added new license headers with linters but failed to remove old license headers manually. This prevents that by applying the an inverted version of the license headers rule that removed invalid license headers when files are moved.
2018-11-27 16:49:17 -08:00
Spencer 433c324016
[bootstrap] run babel-cli with --quiet (#26097)
This updated the `kbn:boostrap` scripts in the packages to use `--quiet` when bootstrapping. This prevents babel from logging every file it builds, but still logs errors if any occur. To make things a little simpler I also used the [`npm-run-all`](https://github.com/mysticatea/npm-run-all) package in `@kbn/i18n` to execute all the builds there in parallel and pass `--quiet`/`--watch` to all builds without duplicating the tasks or making them incompatible with windows.

Before:
```
running `kbn:bootstrap` scripts

@kbn/config-schema: $ yarn build
@kbn/datemath: $ yarn build
@kbn/i18n: $ yarn build
@kbn/config-schema: $ tsc
@kbn/datemath: $ babel src --out-dir target --copy-files
@kbn/i18n: $ yarn build:web && yarn build:node && yarn build:types
@kbn/i18n: $ cross-env BABEL_ENV=web babel src --config-file ./babel.config.js --out-dir target/web --extensions ".ts,.js,.tsx"
@kbn/datemath: src/index.js -> target/index.js
@kbn/i18n: Successfully compiled 18 files with Babel.
@kbn/i18n: $ cross-env BABEL_ENV=node babel src --config-file ./babel.config.js --out-dir target/node --extensions ".ts,.js,.tsx"
@kbn/i18n: Successfully compiled 18 files with Babel.
@kbn/i18n: $ tsc --emitDeclarationOnly
@kbn/dev-utils: $ yarn build
@kbn/es-query: $ yarn build
@kbn/dev-utils: $ babel src --out-dir target
@kbn/es-query: $ babel src --out-dir target
@kbn/dev-utils: src/index.js -> target/index.js
@kbn/dev-utils: src/proc_runner/errors.js -> target/proc_runner/errors.js
@kbn/dev-utils: src/proc_runner/index.js -> target/proc_runner/index.js
@kbn/dev-utils: src/proc_runner/observe_lines.js -> target/proc_runner/observe_lines.js
@kbn/dev-utils: src/proc_runner/observe_readable.js -> target/proc_runner/observe_readable.js
@kbn/es-query: src/es_query/__tests__/_migrate_filter.js -> target/es_query/__tests__/_migrate_filter.js
@kbn/dev-utils: src/proc_runner/observe_signals.js -> target/proc_runner/observe_signals.js
@kbn/es-query: src/es_query/__tests__/build_es_query.js -> target/es_query/__tests__/build_es_query.js
@kbn/es-query: src/es_query/__tests__/decorate_query.js -> target/es_query/__tests__/decorate_query.js
@kbn/dev-utils: src/proc_runner/proc.js -> target/proc_runner/proc.js
@kbn/es-query: src/es_query/__tests__/from_filters.js -> target/es_query/__tests__/from_filters.js
@kbn/es-query: src/es_query/__tests__/from_kuery.js -> target/es_query/__tests__/from_kuery.js
@kbn/es-query: src/es_query/__tests__/from_lucene.js -> target/es_query/__tests__/from_lucene.js
@kbn/es-query: src/es_query/__tests__/lucene_string_to_dsl.js -> target/es_query/__tests__/lucene_string_to_dsl.js
@kbn/dev-utils: src/proc_runner/proc_runner.js -> target/proc_runner/proc_runner.js
@kbn/dev-utils: src/proc_runner/with_proc_runner.js -> target/proc_runner/with_proc_runner.js
@kbn/dev-utils: src/proc_runner/with_proc_runner.test.js -> target/proc_runner/with_proc_runner.test.js
@kbn/es-query: src/es_query/build_es_query.js -> target/es_query/build_es_query.js
@kbn/dev-utils: src/serializers/absolute_path_serializer.js -> target/serializers/absolute_path_serializer.js
@kbn/es-query: src/es_query/decorate_query.js -> target/es_query/decorate_query.js
@kbn/dev-utils: src/serializers/index.js -> target/serializers/index.js
@kbn/es-query: src/es_query/from_filters.js -> target/es_query/from_filters.js
@kbn/dev-utils: src/streams/concat_stream.js -> target/streams/concat_stream.js
@kbn/dev-utils: src/streams/index.js -> target/streams/index.js
@kbn/dev-utils: src/streams/promise_from_streams.js -> target/streams/promise_from_streams.js
@kbn/es-query: src/es_query/from_kuery.js -> target/es_query/from_kuery.js
@kbn/dev-utils: src/streams/reduce_stream.js -> target/streams/reduce_stream.js
@kbn/es-query: src/es_query/from_lucene.js -> target/es_query/from_lucene.js
@kbn/dev-utils: src/tooling_log/index.js -> target/tooling_log/index.js
@kbn/es-query: src/es_query/index.js -> target/es_query/index.js
@kbn/dev-utils: src/tooling_log/log_levels.js -> target/tooling_log/log_levels.js
@kbn/es-query: src/es_query/lucene_string_to_dsl.js -> target/es_query/lucene_string_to_dsl.js
@kbn/dev-utils: src/tooling_log/log_levels.test.js -> target/tooling_log/log_levels.test.js
@kbn/es-query: src/es_query/migrate_filter.js -> target/es_query/migrate_filter.js
@kbn/dev-utils: src/tooling_log/tooling_log.js -> target/tooling_log/tooling_log.js
@kbn/es-query: src/filters/__tests__/phrase.js -> target/filters/__tests__/phrase.js
@kbn/es-query: src/filters/__tests__/query.js -> target/filters/__tests__/query.js
@kbn/dev-utils: src/tooling_log/tooling_log.test.js -> target/tooling_log/tooling_log.test.js
@kbn/dev-utils: src/tooling_log/tooling_log_text_writer.js -> target/tooling_log/tooling_log_text_writer.js
@kbn/dev-utils: src/tooling_log/tooling_log_text_writer.test.js -> target/tooling_log/tooling_log_text_writer.test.js
@kbn/es-query: src/filters/__tests__/range.js -> target/filters/__tests__/range.js
@kbn/es-query: src/filters/exists.js -> target/filters/exists.js
@kbn/es-query: src/filters/index.js -> target/filters/index.js
@kbn/es-query: src/filters/phrase.js -> target/filters/phrase.js
@kbn/es-query: src/filters/phrases.js -> target/filters/phrases.js
@kbn/es-query: src/filters/query.js -> target/filters/query.js
@kbn/es-query: src/filters/range.js -> target/filters/range.js
@kbn/es-query: src/index.js -> target/index.js
@kbn/es-query: src/kuery/ast/__tests__/ast.js -> target/kuery/ast/__tests__/ast.js
@kbn/es-query: src/kuery/ast/ast.js -> target/kuery/ast/ast.js
@kbn/es-query: src/kuery/ast/index.js -> target/kuery/ast/index.js
@kbn/es-query: src/kuery/ast/kuery.js -> target/kuery/ast/kuery.js
@kbn/es-query: src/kuery/ast/legacy_kuery.js -> target/kuery/ast/legacy_kuery.js
@kbn/es-query: src/kuery/filter_migration/__tests__/exists.js -> target/kuery/filter_migration/__tests__/exists.js
@kbn/es-query: src/kuery/filter_migration/__tests__/filter_to_kuery.js -> target/kuery/filter_migration/__tests__/filter_to_kuery.js
@kbn/es-query: src/kuery/filter_migration/__tests__/geo_bounding_box.js -> target/kuery/filter_migration/__tests__/geo_bounding_box.js
@kbn/es-query: src/kuery/filter_migration/__tests__/geo_polygon.js -> target/kuery/filter_migration/__tests__/geo_polygon.js
@kbn/es-query: src/kuery/filter_migration/__tests__/phrase.js -> target/kuery/filter_migration/__tests__/phrase.js
@kbn/es-query: src/kuery/filter_migration/__tests__/range.js -> target/kuery/filter_migration/__tests__/range.js
@kbn/es-query: src/kuery/filter_migration/exists.js -> target/kuery/filter_migration/exists.js
@kbn/es-query: src/kuery/filter_migration/filter_to_kuery.js -> target/kuery/filter_migration/filter_to_kuery.js
@kbn/es-query: src/kuery/filter_migration/geo_bounding_box.js -> target/kuery/filter_migration/geo_bounding_box.js
@kbn/es-query: src/kuery/filter_migration/geo_polygon.js -> target/kuery/filter_migration/geo_polygon.js
@kbn/es-query: src/kuery/filter_migration/index.js -> target/kuery/filter_migration/index.js
@kbn/es-query: src/kuery/filter_migration/phrase.js -> target/kuery/filter_migration/phrase.js
@kbn/es-query: src/kuery/filter_migration/range.js -> target/kuery/filter_migration/range.js
@kbn/es-query: src/kuery/functions/__tests__/and.js -> target/kuery/functions/__tests__/and.js
@kbn/es-query: src/kuery/functions/__tests__/exists.js -> target/kuery/functions/__tests__/exists.js
@kbn/es-query: src/kuery/functions/__tests__/geo_bounding_box.js -> target/kuery/functions/__tests__/geo_bounding_box.js
@kbn/es-query: src/kuery/functions/__tests__/geo_polygon.js -> target/kuery/functions/__tests__/geo_polygon.js
@kbn/es-query: src/kuery/functions/__tests__/is.js -> target/kuery/functions/__tests__/is.js
@kbn/es-query: src/kuery/functions/__tests__/not.js -> target/kuery/functions/__tests__/not.js
@kbn/es-query: src/kuery/functions/__tests__/or.js -> target/kuery/functions/__tests__/or.js
@kbn/es-query: src/kuery/functions/__tests__/range.js -> target/kuery/functions/__tests__/range.js
@kbn/es-query: src/kuery/functions/__tests__/utils/get_fields.js -> target/kuery/functions/__tests__/utils/get_fields.js
@kbn/es-query: src/kuery/functions/and.js -> target/kuery/functions/and.js
@kbn/es-query: src/kuery/functions/exists.js -> target/kuery/functions/exists.js
@kbn/es-query: src/kuery/functions/geo_bounding_box.js -> target/kuery/functions/geo_bounding_box.js
@kbn/es-query: src/kuery/functions/geo_polygon.js -> target/kuery/functions/geo_polygon.js
@kbn/es-query: src/kuery/functions/index.js -> target/kuery/functions/index.js
@kbn/es-query: src/kuery/functions/is.js -> target/kuery/functions/is.js
@kbn/es-query: src/kuery/functions/not.js -> target/kuery/functions/not.js
@kbn/es-query: src/kuery/functions/or.js -> target/kuery/functions/or.js
@kbn/es-query: src/kuery/functions/range.js -> target/kuery/functions/range.js
@kbn/es-query: src/kuery/functions/utils/get_fields.js -> target/kuery/functions/utils/get_fields.js
@kbn/es-query: src/kuery/index.js -> target/kuery/index.js
@kbn/es-query: src/kuery/node_types/__tests__/function.js -> target/kuery/node_types/__tests__/function.js
@kbn/es-query: src/kuery/node_types/__tests__/literal.js -> target/kuery/node_types/__tests__/literal.js
@kbn/es-query: src/kuery/node_types/__tests__/named_arg.js -> target/kuery/node_types/__tests__/named_arg.js
@kbn/es-query: src/kuery/node_types/__tests__/wildcard.js -> target/kuery/node_types/__tests__/wildcard.js
@kbn/es-query: src/kuery/node_types/function.js -> target/kuery/node_types/function.js
@kbn/es-query: src/kuery/node_types/index.js -> target/kuery/node_types/index.js
@kbn/es-query: src/kuery/node_types/literal.js -> target/kuery/node_types/literal.js
@kbn/es-query: src/kuery/node_types/named_arg.js -> target/kuery/node_types/named_arg.js
@kbn/es-query: src/kuery/node_types/wildcard.js -> target/kuery/node_types/wildcard.js
@kbn/test: $ yarn build
@kbn/test: $ babel src --out-dir target
@kbn/test: src/es/es_test_cluster.js -> target/es/es_test_cluster.js
@kbn/test: src/es/es_test_config.js -> target/es/es_test_config.js
@kbn/test: src/es/index.js -> target/es/index.js
@kbn/test: src/functional_tests/cli/index.js -> target/functional_tests/cli/index.js
@kbn/test: src/functional_tests/cli/run_tests/args.js -> target/functional_tests/cli/run_tests/args.js
@kbn/test: src/functional_tests/cli/run_tests/args.test.js -> target/functional_tests/cli/run_tests/args.test.js
@kbn/test: src/functional_tests/cli/run_tests/cli.js -> target/functional_tests/cli/run_tests/cli.js
@kbn/test: src/functional_tests/cli/run_tests/cli.test.js -> target/functional_tests/cli/run_tests/cli.test.js
@kbn/test: src/functional_tests/cli/start_servers/args.js -> target/functional_tests/cli/start_servers/args.js
@kbn/test: src/functional_tests/cli/start_servers/args.test.js -> target/functional_tests/cli/start_servers/args.test.js
@kbn/test: src/functional_tests/cli/start_servers/cli.js -> target/functional_tests/cli/start_servers/cli.js
@kbn/test: src/functional_tests/cli/start_servers/cli.test.js -> target/functional_tests/cli/start_servers/cli.test.js
@kbn/test: src/functional_tests/lib/auth.js -> target/functional_tests/lib/auth.js
@kbn/test: src/functional_tests/lib/index.js -> target/functional_tests/lib/index.js
@kbn/test: src/functional_tests/lib/paths.js -> target/functional_tests/lib/paths.js
@kbn/test: src/functional_tests/lib/run_cli.js -> target/functional_tests/lib/run_cli.js
@kbn/test: src/functional_tests/lib/run_cli.test.js -> target/functional_tests/lib/run_cli.test.js
@kbn/test: src/functional_tests/lib/run_elasticsearch.js -> target/functional_tests/lib/run_elasticsearch.js
@kbn/test: src/functional_tests/lib/run_ftr.js -> target/functional_tests/lib/run_ftr.js
@kbn/test: src/functional_tests/lib/run_kibana_server.js -> target/functional_tests/lib/run_kibana_server.js
@kbn/test: src/functional_tests/tasks.js -> target/functional_tests/tasks.js
@kbn/test: src/functional_tests/test_helpers.js -> target/functional_tests/test_helpers.js
@kbn/test: src/index.js -> target/index.js
@kbn/test: src/kbn/index.js -> target/kbn/index.js
@kbn/test: src/kbn/kbn_test_config.js -> target/kbn/kbn_test_config.js
@kbn/test: src/kbn/users.js -> target/kbn/users.js
x-pack: $ gulp canvas:plugins:build
x-pack: [13:22:34] /Users/spalger/kbn-dev/master/kibana/x-pack/plugins/canvas/canvas_plugin
x-pack: [13:22:34] Using gulpfile ~/kbn-dev/master/kibana/x-pack/gulpfile.js
x-pack: [13:22:34] Starting 'canvas:plugins:build'...
x-pack: [13:22:50] canvas:plugins Plugins built in 15.75 seconds
x-pack: [13:22:50] Finished 'canvas:plugins:build' after 16 s
kibana: $ yarn build:types && node scripts/register_git_hook
kibana: $ tsc --p tsconfig.types.json
kibana: Registering Kibana pre-commit git hook...
kibana: success Kibana pre-commit git hook was installed successfully.
```

(this will be even worse when we merge #26095)

After:
```
running `kbn:bootstrap` scripts

@kbn/config-schema: $ yarn build
@kbn/datemath: $ yarn build --quiet
@kbn/i18n: $ run-p 'build:babel:** --quiet' build:tsc
@kbn/datemath: $ babel src --out-dir target --copy-files --quiet
@kbn/config-schema: $ tsc
@kbn/i18n: $ cross-env BABEL_ENV=node babel src --config-file ./babel.config.js --out-dir target/node --extensions ".ts,.js,.tsx" --quiet
@kbn/i18n: $ cross-env BABEL_ENV=web babel src --config-file ./babel.config.js --out-dir target/web --extensions ".ts,.js,.tsx" --quiet
@kbn/i18n: $ tsc --emitDeclarationOnly
@kbn/i18n: Successfully compiled 18 files with Babel.
@kbn/i18n: Successfully compiled 18 files with Babel.
@kbn/dev-utils: $ yarn build --quiet
@kbn/es-query: $ yarn build --quiet
@kbn/dev-utils: $ babel src --out-dir target --quiet
@kbn/es-query: $ babel src --out-dir target --quiet
@kbn/test: $ yarn build --quiet
@kbn/test: $ babel src --out-dir target --quiet
x-pack: $ gulp canvas:plugins:build
x-pack: [13:16:56] /Users/spalger/kbn-dev/master/kibana/x-pack/plugins/canvas/canvas_plugin
x-pack: [13:16:56] Using gulpfile ~/kbn-dev/master/kibana/x-pack/gulpfile.js
x-pack: [13:16:56] Starting 'canvas:plugins:build'...
x-pack: [13:17:11] canvas:plugins Plugins built in 13.98 seconds
x-pack: [13:17:11] Finished 'canvas:plugins:build' after 14 s
kibana: $ yarn build:types && node scripts/register_git_hook
kibana: $ tsc --p tsconfig.types.json
kibana: Registering Kibana pre-commit git hook...
kibana: success Kibana pre-commit git hook was installed successfully.
```
2018-11-22 21:14:09 -08:00
Spencer fad8d0cc3a
[ci][ftr][kbn/test] split up CI jobs (#25838)
* [ci][ftr][kbn/test] split up CI jobs

* [ci] run --assert-none-excluded in ci groups, before builds

* [ftr] improve error message when excluded tests found

* [ci] document other places the ciGroups live
2018-11-20 14:02:06 -08:00
Spencer b0d11e5607
[kbn/test] add support for using test groups (#25776) 2018-11-16 16:30:55 -08:00
Spencer 101c352221
[es-test-cluster] increase start timeout for snapshots (#25600) 2018-11-13 15:47:38 -08:00
Josh Dover 77522a7bd2
[kbn-pm] Use yarn workspaces for dependencies (#24095) 2018-11-12 12:38:11 -06:00
Spencer 84e72d3ef6
[ftr] allow filtering suites by tag (#25021)
Closes #22840

In the functional tests we want a better way to include/exclude certain tests, especially as we move forward with #22359. This PR allows us to decorate suite objects with "tags", which won't clutter up the test names and can be used to filter out specific tests within a single test config. The functional test runner supports defining `--include-tag` and `--exclude-tag` CLI arguments, and multiple can be defined.

The method of filtering out tests for running against cloud has been updated to use this approach and I plan to do the same to #22359 once this is merged.
2018-11-02 13:06:25 -07:00
liza-mae 5d64140953
Update rmrfSync method (#23854)
* Update rmrfSync method

* Add catch statement

* Fix lint issues

* switch to del package

* remove old rmrf_sync module

* Fix CI failure del is not a function error

* Fix spaces
2018-10-22 12:12:20 -06:00
Spencer d22bdfec46
[yarn] Upgrade to 1.10.1 (#23971)
* [yarn] upgrade required version

* [yarn] update lock files to include integrity

* [yarn] coalesce locked readable-stream versions to avoid yarn bug
2018-10-15 14:34:30 -07:00
Larry Gregory 1f38026731
Spaces Phase 1 (#21408)
### Review notes
This is generally ready for review. We are awaiting https://github.com/elastic/elasticsearch/issues/32777 to improve handling when users do not have any access to Kibana, but this should not hold up the overall review for this PR.

This PR is massive, there's no denying that. Here's what to focus on:
1) `x-pack/plugins/spaces`: This is, well, the Spaces plugin. Everything in here is brand new. The server code is arguably more important, but feel free to review whatever you see fit.
2) `x-pack/plugins/security`: There are large and significant changes here to allow Spaces to be securable. To save a bit of time, you are free to ignore changes in `x-pack/plugins/security/public`: These are the UI changes for the role management screen, which were previously reviewed by both us and the design team.
3) `x-pack/test/saved_object_api_integration` and `x-pack/test/spaces_api_integration`: These are the API test suites which verify functionality for:
     a) Both security and spaces enabled
     b) Only security enabled
     c) Only spaces enabled

What to ignore:
1) As mentioned above, you are free to ignore changes in `x-pack/plugins/security/public`
2) Changes to `kibana/src/server/*`: These changes are part of a [different PR that we're targeting against master](https://github.com/elastic/kibana/pull/23378) for easier review.

## Saved Objects Client Extensions
A bulk of the changes to the saved objects service are in the namespaces PR, but we have a couple of important changes included here.

### Priority Queue for wrappers
We have implemented a priority queue which allows plugins to specify the order in which their SOC wrapper should be applied: `kibana/src/server/saved_objects/service/lib/priority_collection.ts`. We are leveraging this to ensure that both the security SOC wrapper and the spaces SOC wrapper are applied in the correct order (more details below).

### Spaces SOC Wrapper
This wrapper is very simple, and it is only responsible for two things:
1) Prevent users from interacting with any `space` objects (use the Spaces client instead, described below)
2) Provide a `namespace` to the underlying Saved Objects Client, and ensure that no other wrappers/callers have provided a namespace. In order to accomplish this, the Spaces wrapper uses the priority queue to ensure that it is the last wrapper invoked before calling the underlying client.

### Security SOC Wrapper
This wrapper is responsible for performing authorization checks. It uses the priority queue to ensure that it is the first wrapper invoked. To say another way, if the authorization checks fail, then no other wrappers will be called, and the base client will not be called either. This wrapper authorizes users in one of two ways: RBAC or Legacy. More details on this are below.


### Examples:
`GET /s/marketing/api/saved_objects/index-pattern/foo`

**When both Security and Spaces are enabled:**
1) Saved objects API retrieves an instance of the SOC via `savedObjects.getScopedClient()`, and invokes its `get` function
2) The Security wrapper is invoked.
    a) Authorization checks are performed to ensure user can access this particular saved object at this space.
3) The Spaces wrapper is invoked.
   a) Spaces applies a `namespace` to be used by the underlying client
4) The underlying client/repository are invoked to retrieve the object from ES.

**When only Spaces are enabled:**
1) Saved objects API retrieves an instance of the SOC via `savedObjects.getScopedClient()`, and invokes its `get` function
2) The Spaces wrapper is invoked.
   a) Spaces applies a `namespace` to be used by the underlying client
3) The underlying client/repository are invoked to retrieve the object from ES.

**When only Security is enabled:**
(assume `/s/marketing` is no longer part of the request)
1) Saved objects API retrieves an instance of the SOC via `savedObjects.getScopedClient()`, and invokes its `get` function
2) The Security wrapper is invoked.
   a) Authorization checks are performed to ensure user can access this particular saved object globally.
3) The underlying client/repository are invoked to retrieve the object from ES.

## Authorization
Authorization changes for this project are centered around Saved Objects, and builds on the work introduced in RBAC Phase 1.

### Saved objects client
#### Security without spaces
When security is enabled, but spaces is disabled, then the authorization model behaves the same way as before: If the user is taking advantage of Kibana Privileges, then we check their privileges "globally" before proceeding. A "global" privilege check specifies `resources: ['*']` when calling the [ES _has_privileges api.](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html). Legacy users (non-rbac) will continue to use the underlying index privileges for authorization.

#### Security with spaces
When both plugins are enabled, then the authorization model becomes more fine-tuned. Rather than checking privileges globally, the privileges are checked against a specific resource that matches the user's active space. In order to accomplish this, the Security plugin needs to know if Spaces is enabled, and if so, it needs to ask Spaces for the user's active space. The subsequent call to the `ES _has_privileges api` would use `resources: ['space:marketing']` to verify that the user is authorized at the `marketing` space. Legacy users (non-rbac) will continue to use the underlying index privileges for authorization. **NOTE** The legacy behavior implies that those users will have access to all spaces. The read/write restrictions are still enforced, but there is no way to restrict access to a specific space for legacy auth users.

#### Spaces without security
No authorization performed. Everyone can access everything.

### Spaces client
Spaces, when enabled, prevents saved objects of type `space` from being CRUD'd via the Saved Objects Client. Instead, the only "approved" way to work with these objects is through the new Spaces client (`kibana/x-pack/plugins/spaces/lib/spaces_client.ts`).

When security is enabled, the Spaces client performs its own set of authorization checks before allowing the request to proceed. The Spaces client knows which authorization checks need to happen for a particular request, but it doesn't know _how_ to check privileges. To accomplish this, the spaces client will delegate the check security's authorization service.

#### FAQ: Why oh why can't you used the Saved Objects Client instead!?
That's a great question! We did this primarily to simplify the authorization model (at least for our initial release). Accessing regular saved objects follows a predictible authorization pattern (described above). Spaces themselves inform the authorization model, and this interplay would have greatly increased the complexity. We are brainstorming ideas to obselete the Spaces client in favor of using the Saved Objects Client everywhere, but that's certainly out of scope for this release.



## Test Coverage
### Saved Objects API
A bulk of the changes to enable spaces are centered around saved objects, so we have spent a majority of our time automating tests against the saved objects api.

**`x-pack/test/saved_object_api_integration/`** contains the test suites for the saved objects api. There is a `common/suites` subfolder which contains a bulk of the test logic. The suites defined here are used in the following test configurations:
1) Spaces only: `./spaces_only`
2) Security and spaces: `./security_and_spaces`
3) Security only: `./security_only`

Each of these test configurations will start up ES/Kibana with the appropriate license and plugin set. Each set runs through the entire test suite described in `common/suites`. Each test with in each suite is run multiple times with different inputs, to test the various permutations of authentication, authorization type (legacy vs RBAC), space-level privileges, and the user's active space.  

### Spaces API
Spaces provides an experimental public API.

**`x-pack/test/spaces_api_integration`** contains the test suites for the Spaces API. Similar to the Saved Objects API tests described above, there is a `common/suites` folder which contains a bulk of the test logic. The suites defined here are used in the following test configurations:
1) Spaces only: `./spaces_only`
2) Security and spaces: `./security_and_spaces`


### Role Management UI
We did not provide any new functional UI tests for role management, but the existing suite was updated to accomidate the screen rewrite.

We do have a decent suite of jest unit tests for the various components that make up the new role management screen. They're nested within `kibana/x-pack/plugins/security/public/views/management/edit_role`

### Spaces Management UI
We did not provide any new functional UI tests for spaces management, but the components that make up the screens are well-tested, and can be found within `kibana/x-pack/plugins/spaces/public/views/management/edit_space`

### Spaces Functional UI Tests
There are a couple of UI tests that verify _basic_ functionality. They assert that a user can login, select a space, and then choose a different space once inside: `kibana/x-pack/test/functional/apps/spaces`



## Reference

Notable child PRs are listed below for easier digesting. Note that some of these PRs are built on other PRs, so the deltas in the links below may be outdated. Cross reference with this PR when in doubt.

### UI
- Reactify Role Management Screen: https://github.com/elastic/kibana/pull/19035
- Space Aware Privileges UI: https://github.com/elastic/kibana/pull/21049
- Space Selector (in Kibana Nav): https://github.com/elastic/kibana/pull/19497
- Recently viewed Widget: https://github.com/elastic/kibana/pull/22492
- Support Space rename/delete: https://github.com/elastic/kibana/pull/22586

### Saved Objects Client
- ~~Space Aware Saved Objects: https://github.com/elastic/kibana/pull/18862~~
- ~~Add Space ID to document id: https://github.com/elastic/kibana/pull/21372~~
- Saved object namespaces (supercedes #18862 and #21372):  https://github.com/elastic/kibana/pull/22357
- Securing saved objects: https://github.com/elastic/kibana/pull/21995
- Dedicated Spaces client (w/ security): https://github.com/elastic/kibana/pull/21995

### Other
- Public Spaces API (experimental): https://github.com/elastic/kibana/pull/22501
- Telemetry: https://github.com/elastic/kibana/pull/20581
- Reporting: https://github.com/elastic/kibana/pull/21457
- Spencer's original Spaces work: https://github.com/elastic/kibana/pull/18664
- Expose `spaceId` to "Add Data" tutorials: https://github.com/elastic/kibana/pull/22760

Closes #18948 

"Release Note: Create spaces within Kibana to organize dashboards, visualizations, and other saved objects. Secure access to each space when X-Pack Security is enabled"
2018-10-01 07:09:33 -04:00
liza-mae e477ca3fdf
Cleanup from PR 22608, remove esInstallDir (#23450) 2018-09-24 13:57:23 -06:00
liza-mae 5d9d7242e5
Add option to functional test server to run elasticsearch from instal… (#22608)
* Add option to functional test server to run elasticsearch from install dir

* Fix variable

* Fix server CLI test

* Updates to include install path in esFrom command line option

* Fix snapshot

* Update args/cli tests

* Keep default snapshot in args/help
2018-09-24 11:39:09 -06:00
Spencer b55705e9b4
[ts] enable support for iterators in browsers (#22986)
I was surprised when I tried to spread a `Set` in TypeScript and the browser complained about `Set.slice()` not being defined. This is because TypeScript does not automatically enable support for iterators when targeting earlier ES versions, like we do in the browser, unless you use the `"downlevelIteration": true` compiler option. This injects some helpers into the necessary files for reading/spreading iterators, which can be stuffed behind an import statement with using the `"importHelpers": true` compiler option and include `tslib` in our dependencies. This is already a dependency of several of our packages, so it shouldn't cause any additional modules.
2018-09-13 14:18:13 -07:00
Lee Drengenberg eeee0d800a
x-pack tests should use servers from other config files already loaded (#22739)
* x-pack tests should use servers from other config files already loaded

* Fix es_test_config that was using TEST_KIBANA_USERNAME/PASSWORD
2018-09-05 19:54:38 -05:00
Spencer 4d9bc2f121
[devUtils/toolingLog] give tooling log configurable writers (#22110)
* [devUtils/toolingLog] give tooling log configurable writers

* property shorthand

* remove redundant parameter

* call Error.captureStackTrace when subclassing Error

* describe why we skip stack trace logging for CliError

* always return true/false from log writers

* improve type definitions, writeTo is just an object with write method

* get rid of weird dedent for failures
2018-08-21 17:09:27 -07:00
Tim Roes 743edc6c0e
Make panel action tests more generic (#22174)
* Make panel action tests more generic

* Remove test file

* Add simple app tests

* Shorten/fix import

* Remove unneeded task

* Add debug output

* Allow duplicate --plugin-path params

* Remove debugging options

* Add README
2018-08-20 21:48:38 +02:00
archana cb8c1de733 [Tests] Add http integration test setup (#19261)
* [Tests] Add http integration test setup

* Base path tests

* SSL tests

* Eslint fixes

* Remove env from config schema

* Rename folders so no_rewrite and rewrite match configs/tests

* wip

* Use self-signed cert for SSL test

* Improve basepath tests

* Run base path proxy server in dev mode for now

* Remove env from x-pack reporting config

* Remove redundant base-path tests

* Test SSL with redirectHttpFromPort set

* Test SSL with redirectHttpFromPort set

* Flesh out comments

* Remove some cruft

* Add SSL tests to CI run
2018-08-17 08:36:14 +02:00
Spencer b4e1193015
Revert "Run some functional tests against kibana in production mode (#21899)" (#22111)
This reverts commit 63df7cb2e4.

It seems this caused unintended failures on master, will resubmit after CI is green
2018-08-16 23:28:37 -07:00
Spencer 63df7cb2e4
Run some functional tests against kibana in production mode (#21899)
Right now the functional tests are run against a distributable of Kibana in CI, but that distributable is running with `--env.name=development`. That causes the optimizer to run again before the tests can start and prevents the functional tests from running against the actual version of the application users will end up getting. This seems necessary for some tests, but not all of them, but I would like to get all of the tests running against the production version of Kibana soon.

This PR implements a second ftr config, `test/functional_production` that uses basically a copy of the `test/functional` config but with a few minor adjustments, removing the `--env.name=development` kbnServerArg and using a unique junit report name. To accomplish this I needed to modify the `@kbn/test` module to only pass the `--dev` flag to the Kibana server if it is being run in development mode, which it currently does by testing the args for `--env.name=development` or two args next to each other: `'--env.name'` and `'development'`. It does this by converting the `extraKbnOpts` option into an `addExtraKbnArgs` function, which is called with the final args just before passing them to the proc runner and given a chance to modify then after all other args are resolved (pulling from different places in config based on the build type, etc.)

Over the next couple weeks I'll push up PRs for individual test suites, migrating them over to the new production config, hopefully in a short period of time we will have all the function test suites back under that `test/function` config and can run them all against the Kibana server in production mode.
2018-08-16 12:15:58 -07:00
Spencer 595476bcf2
[kbn-test] use slightly more debug-friendly error output (#21985)
A couple times while debugging failures in `functional_tests(_servers)` with people I've asked for stack traces and received responses like "that's all there is", and it turns out that's right, because the cli's are passing the error object directly to `chalk.red()`, which converts it into a string that only includes the message. This pr moves the common operations from `run_tests/cli.js` and `run_servers/cli.js` into `lib/run_cli` and includes test for the common functionality there, as well as a common error printing logic that still includes the red message, but also includes a stack trace that will help out a lot in debugging.
2018-08-15 09:50:42 -07:00
Spencer 4f0d2ade1e
[kbn-test] convert kibana-install-dir flag to installDir option (#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 e5b94aa024.

* [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
2018-08-02 17:23:34 -07:00
Felix Stürmer 1211efdf40
Upgrade prettier to version 1.14.0 (#21466)
This upgrades prettier to version 1.14.0. The main motivation is to gain support for the new TypeScript language features introduced in 2.9 and 3.0.

Prettier versions 1.13 and 1.14 also introduced some other JavaScript and TypeScript style improvements resulting in a few small line break and parenthesis changes.

The relevant release notes are:

* [Prettier 1.13.0 Release Notes](https://prettier.io/blog/2018/05/27/1.13.0.html)
* [Prettier 1.40.0 Release Notes](https://prettier.io/blog/2018/07/29/1.14.0.html)
2018-07-31 15:30:36 +02:00
Tiago Costa b142f80d7d
Match chalk dependency version on kibana with the one used on x-pack (#20621)
* chore(NA): match chalk dependency version on kibana with x-pack to ^2.3.2.

* chore(NA): bump chalk version dependencies and update lock files.
2018-07-13 00:26:57 +01:00
Tim Roes cb5ee01c6a
Increase prettier line width to 100 (#20535)
* Increase prettier line width to 100

* Fix packages JS prettier

* Change style guide to 100 width

* Fix line-width in latest master changes
2018-07-09 22:50:37 +02:00
Josh Soref 2b27fb1c5f Fix misspellings (#19981) 2018-06-26 20:17:41 -07:00
archana b03243f5d8
[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
2018-06-26 18:08:40 -05:00
Aleh Zasypkin 18037984da
Upgrade rxjs: 6.1.0 ---> 6.2.1. (#20209) 2018-06-25 20:04:19 +02:00
Spencer 6a429d7fa3
[npm] upgrade to RxJS 6 (#18885)
This PR upgrades RxJS to version 6 and switches to a fork of `stream-to-observable` which includes an updated version of `any-observable` that supports RxJS 6 until https://github.com/jamestalmage/stream-to-observable/pull/10 is merged. The primary change in this version of RxJS is the movement of stream operators from `Obersable.prototype` to the `rxjs/operators` module. Some of the operators, like `catch` and `do`, have been renamed (`catchError`, and `tap`). The Obsevable factories have also been moved from static methods on the `Observable` class to named exports of the root `rxjs` module. Some of those factories have also changed slightly, like `fromEvent` which now emits arrays if the event handler is called with multiple arguments.

```js
// import the Rx namespace to get the Observable factories
import * as Rx from 'rxjs';
// import the operators as named imports
import { map, tap, switchMap } from 'rxjs/operators';
```
2018-06-18 10:16:38 -07:00
Spencer f0cc432faf
Apache 2.0 license headers (#19383)
In order to make the license that applies to each file as clear as possible, and to be consistent with elasticsearch, we are adding Apache 2.0 license headers to the top of each file.

Existence of this header is enforced by eslint and tslint and missing headers were automatically added in the last commit by running:

```
node scripts/eslint --fix && node scripts/tslint --fix
```
2018-05-28 20:06:30 -07:00
archana f63a3df17d
Option to run kibana from build for CI (#19125) (#19225)
* Option to run kibana from build for CI (#19125)

* Support --dev option for servers only

* try skipping dashboard time zones test
2018-05-21 08:31:30 -05:00
archana eaa4960981
Revert "Option to run kibana from build for CI" (#19224)
* Revert "[DOCS] Removes redundant index.asciidoc files (#19192)"

This reverts commit d11b5aae9a.

* Revert "[typescript] add typescript support for the server and browser (#19104)"

This reverts commit c6112067fc.

* Revert "Option to run kibana from build for CI (#19125)"

This reverts commit 5969860303.
2018-05-18 14:09:38 -05:00
archana 5969860303
Option to run kibana from build for CI (#19125) 2018-05-18 12:45:53 -05:00
Aleh Zasypkin 078fb147a4
Rename @kbn/babel-preset/common & node & webpack to @kbn/babel-preset/common_preset & node_preset & webpack_preset. (#19025) 2018-05-15 17:23:20 +02:00
archana b58e757794
Functional test setup with kbn-test package (#18568)
Restructure testing with kbn-test package

 - Run with multiple configs, move cli options to config
 - Package-ify kbn-test
 - Eventually we'll have functional_test_runner live in a package
of its own, and then this kbn-test will use that as a dependency,
probably still as a devDependency.
 - Implement functional_tests_server
 - Collapse single and multiple config apis into one command

Use kbn-es

Replace es_test_cluster + es_test_config with kbn/test utils

Implement new createEsTestCluster

Improve scripts, jsdocs, cli top-level tools

Lift error handling to the top level
2018-05-09 18:23:49 -05:00