Commit graph

163 commits

Author SHA1 Message Date
Spencer 4122705bc2
[kbn/test/ftr] add support for custom runners (#58610)
* [kbn/test/ftr] add support for custom runners

* remove irrelevant tests
2020-02-26 13:32:51 -07:00
Spencer 15e4e6c632
Fix failed test reporter for SIEM Cypress use (#57240)
* [@kbn/test] build with source-maps

* [@kbn/test] the jUnit Reporter being used for SIEM Cypress tests sometimes doesn't include testcases in XML

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-14 18:47:32 -07:00
Spencer 4e8ab56497
build immutable bundles for new platform plugins (#53976)
* build immutable bundles for new platform plugins

* only inspect workers if configured to do so

* [navigation] use an index.scss file

* add yarn.lock symlink

* set pluginScanDirs in test so fixtures stay consistent

* cleanup helpers a little

* fix type error

* support KBN_OPTIMIZER_MAX_WORKERS for limiting workers via env

* test support for KBN_OPTIMIZER_MAX_WORKERS

* expand the available memory for workers when only running one or two

* add docs about KBN_OPTIMIZER_MAX_WORKERS environment variable

* fix README link

* update kbn/pm dist

* implement bundle caching/reuse

* update kbn/pm dist

* don't check for cache if --no-cache is passed

* update renovate config

* standardize on index.scss, move console styles over

* add support for --no-cache to cli

* include worker config vars in optimizer version

* ignore concatenated modules

* update integration test

* add safari to browserslist to avoid user-agent warnings in dev

* update docs, clean up optimizer message/misc naming

* always handle initialized messages, don't ignore states that are attached to specific events

* reword caching docs, add environment var to disable caching

* tweak logging and don't use optimizer.useBundleCache as that's disabled in dev

* handle change notifications

* batch changes for 1 second

* rename CompilerState type to CompilerMsg

* getChanges() no longer needs to assign changes to dirs

* remove unused deps

* split up run_worker.ts and share cacheKey generation logic

* add a couple docs

* update tests and remove unused imports

* specify files when creating bundle cache key

* remove one more unused import

* match existing dev cli output more closely

* update kbn/pm dist

* set KBN_NP_PLUGINS_BUILT to avoid warning in CI

* avoid extending global window type

* add note to keep pluginScanDirs in sync

* pass browserslistEnv in workerConfig so it is used for cache key

* load commons.bundle.js in parallel too

* emit initialized+success states if all bundles are cached

* load bootstraps as quickly as possible

* skip flaky suite

* bump

* update jest snapshots

* remove hashing from cache key generation

* remove unnecessary non-null assertion

* improve docs and break up Optimizer#run()

* remove unused import

* refactor kbn/optimizer to break up observable logic, implement more helpful cache invalidation logic with logging

* fix tests

* add initializing phase

* avoid rxjs observable constructor

* remove unnecessary rxjs helper, add tests for bundle cache

* update consumers of optimizer

* update readme with new call style

* replace "new platform" with "kibana platform"

* fix a couple more renames

* add support for several plain-text file formats

* fix naming of OptimizerMsg => OptimizerUpdate, use "store" naming too

* one more OptimizerMsg update

* ensure bundles are not cached when cache config is false

* test for initializing states and bundle cache events

* remove unnecessary timeout change

* Remove unnecessary helpers

* Add tests for BundleCache class

* Add tests for Bundle class

* test summarizeEvent$

* missing paths are no longer listed in mtimes map

* add tests for optimizer/cache_keys

* Add some extra docs

* Remove labeled loop

* add integration test for kbn-optimizer watcher components

* querystring-browser removed

* tweak logging a smidge, improve info and final message

* remove unused imports

* remove duplication of getModuleCount() method

* move type annotation that validates things

* clear up the build completion message

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-12 19:42:42 -07:00
Pierre Gayvallet 38dc1cbd3c
Migrate es-archiver to typescript (#56008)
* migrate lib/archives and lib/docs

* migrate lib/indices

* migrate end of /lib

* migrate /actions

* migrate es_archiver

* migrate cli

* migrate tests

* use proper log stub

* add Record typing

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-02-03 12:03:50 +01:00
Joe Portner 13593344a0
Add lockfile symlinks (#55440)
This is to enable dependency scanning tools to correctly resolve
the dependencies in each package.json file that is used in
production.
2020-01-27 11:38:20 -05:00
Spencer 7b4278dc49
[kbn/pm] add caching to bootstrap (#53622)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-03 09:35:38 -07:00
Spencer e5c562b5c1
associate metadata with runnables (#53245) 2019-12-17 12:26:50 -07:00
spalger a926e3419d Revert "Update babel related packages (#52754)"
This reverts commit 9a115f078f.
2019-12-17 11:32:49 -07:00
renovate[bot] 9a115f078f Update babel related packages (#52754)
* Update babel related packages

* update kbn/pm dist
2019-12-14 20:14:47 -07:00
Spencer 81a30d98bd
[failedTests] fix reportMessageIter and add unit test (#52886)
* [failedTests] fix reportMessageIter and add unit test

* update related snapshots
2019-12-13 08:28:17 -07:00
Dmitry Lemeshko 7658e9c631
FTR: add 'throttle' option to cli (#33241)
* [ftr/cli] add throttling option

* [ftr/cli] add headless option, fix test
2019-12-11 19:41:25 +01:00
Spencer ab1fe3f14e
[kbnClient] Retry uiSettings.replace() calls up to 5 times (#52601)
* [kbn/dev-utils] target ES2019 to transpile ??

* Retry uiSettings.replace() calls up to 5 times

* share logic for selecting junit report name to ensure they are unique

* convert to junit report path helper
2019-12-11 09:50:03 -07:00
Spencer a25bf49eb8
Add failure screenshot links to JUnit failures (#52449) 2019-12-11 09:42:43 -07:00
Spencer 6ea1b2ccee
[ftr/lifecycle] refactor to be typesafe (#52453)
* [ftr/lifecycle] refactor to be typesafe

* update test fixture
2019-12-09 18:46:45 -07:00
Spencer 8e8571bae0
[ci/reportFailures] --dry-run is overloaded, split it up (#52314)
* [ci/reportFailures] --dry-run is overloaded, split it up

* force some failures to verify the fix

* Revert "force some failures to verify the fix"

This reverts commit cf2a58e139.

* update readme to mention new flags

* remove unnecessary commas
2019-12-05 13:25:37 -07:00
Spencer 3c55e55b7a
[failed_tests_cli] update reports with links to github issues (#52048)
* [failed_tests_cli] update reports with links to github issues

* reorder test report hooks so that published Junit includes modified reports

* force failures and enable dry-run mode for debugging

* auto-switch to --dry-run when running in non-tracked branches/prs

* add --skip-junit-update flag to skip mutating the reports

* remove comma after URL to support auto-linking in Jenkins

* Revert "force failures and enable dry-run mode for debugging"

This reverts commit ac0c287a3f.

* fix method call

* extend TestResult to include relevence flag rather than wrapping

* fix createFailureIssue() tests

* make report messages more consistent, append when not dry-run

* rename module

* update snapshots to not contain valid xml

* don't send authorization header if no token defined

* merge with master modified fixtures
2019-12-05 08:46:27 -07:00
Spencer 312821f644
filter out downstream failures with updated error message (#51623) 2019-12-03 13:42:38 -07:00
Spencer 03dad2827e
run mocha tests from x-pack with root mocha script (#51352)
* run mocha tests from x-pack with root mocha script

* Only run Karma tests in xpack intake job

* disable failing suites

* fix typo

* skip correct suite (there are multiple root suites)

* support disabling junit reporting with $DISABLE_JUNIT_REPORTER

* don't generate junit in ispec_plugin tests
2019-11-25 11:39:20 -07:00
Dmitry Lemeshko 6bc43bb9fd
[page_objects/common_page] convert to ts (#50771)
* [page_objects/common_page] convert to ts

* fix lint errors

* descrease navigation timeouts

* use template literal for log messages
2019-11-18 20:08:22 +01:00
renovate[bot] 73ebd567ad Update dependency rxjs to ^6.5.3 (#49837)
* Update dependency rxjs to ^6.5.3

* move argument type def up for better coverage

* adapt to possibly undefined helpExtension

* complete definition of deprecation$ type

* define types that bindNodeCallback can no longer infer

* define more types that bindNodeCallback can't infer

* be more explicit and accurate about the types for a subject/observable pair

* fix interface error, TS now identifies it

* ignore a return type flaw because types are not being managed properly

* avoid overspecifying types

* allow types to be inferred where possible

* remove unnecessary withLatestFrom()

* reduce number of rxjs versions installed

* update kbn/pm dist
2019-11-01 14:44:21 -07:00
Spencer a859577b40
Remove rimraf (#48985)
* Update dependency del to v5

* unify del/rimraf usage with del v5

* update yarn.lock

* update kbn-pm distributable

* remove poorly transformed code

* force some deletes from tmp

* mock less of the fs module

* force tmp deletion in a few more suites

* please make this the last force
2019-10-24 06:29:43 -07:00
Brian Seeders d68eba6d96
Ensure es/kibana cleanup always happens when using scripts/functional_tests (#48986) 2019-10-23 16:13:15 -04:00
Spencer 158d86f842
standardize notice-comment usage (#48677)
* standardize notice-comment usage

* regenerate notice.txt
2019-10-21 11:54:45 -07:00
Spencer 0a85478d41
[failedTestsReporter] load github issues on demand (#47914) 2019-10-11 09:56:47 -07:00
Spencer 23dada5722
fix indentation of failure issue bodies (#47864) 2019-10-10 12:52:35 -07:00
Spencer 36b55ab67e
[ci/failed_tests_reporter] when Github 500s, retry up to 5 tim… (#47740)
* [ci/failed_tests_reporter] when Github 500s, retry up to 5 times

* remove unused import

* properly handle non-string headers
2019-10-10 08:52:34 -07:00
Dmitry Lemeshko 3495f86c45
Collecting code coverage from functional tests (#40512)
* get coverage for console functional test

* instrument kibana

* collect coverage stats after each test, on url navigation, refresh and back

* switch to babel-plugin-istanbul

* switch to babel-plugin-istanbul

* [coverage service] basic version

* trigger final coverage flush when ftr finishes, wait for all logs before exiting

* add coverage report generation

* increase optimizer timeout, re-run idx/babel plugin before istanbul

* increase memory usage for node

* put istanbul preset in the beginning to run as the last one

* bump babel-plugin-istanbul up to 5.2.0

* cleanup

* save unique json files with coverage

* [functional test coverage] update coverage.json path

* run code coverage on CI

* increase max-old-space-size with env variable

* fix coverage folder creation

* use env variable to configure code coverage

* revert ci config changes

* remove duplicate plugin

* remove comments

* fixes
2019-10-10 07:56:49 +02:00
Spencer 9b34d6b76f
refactor failed_tests_reporter to use TS, no octokit (#46993)
* refactor failed_tests_reporter to use TS, no octokit

* update renovate config

* ensure that all kbn-test files are in ts project

* fix some type errors

* add some more tests

* [kbn-test/githubapi] cleanup and document

* collect log messages as strings instead of message objects

* ensure issue is open when updating body

* improve readability of getKibanaIssues

* expose axios helpers from dev-utils

* fix request params for fetching github issues and validate locally

* include a README for failed_tests_reporter

* improve axios error helpers
2019-10-08 13:56:07 -07:00
Tre 1947608378
[FTR] Support for new and old es clients (#47377)
* Add dep for new es client,
refactor all mentions of the old client
to the new.
2019-10-08 09:53:24 -06:00
renovate[bot] 445fa434d5 Update gulp related packages (major) (#46665)
* Update gulp related packages

* ts-ify and gulp4-ify x-pack tasks, remove unused canvas tasks

* remove unnecessary gulp.TaskFunction usage

* fix old references

* update renovate config

* move constants into helpers directory

* typo

* compact tasks a bit, remove unnecessary paths

* fix build directories

* deprecate testonly task

* rather than justifying an unjustifiable ts-ignore, ts-ify the imported module

* update renovate config

* update browser download tests to mock axios

* add root index.d.ts to tsconfig

* export BrowserType

* remove unnecessary `@ts-ignore`

* use consistent casing
2019-10-05 07:53:47 -07:00
renovate[bot] fc53d4efb3 Update dependency tar-fs to ^1.16.3 (#47341) 2019-10-05 05:29:50 -07:00
Lee Drengenberg 700a7ef576
Add option for Internet Explorer IE11 to FTR (#42967)
* Add option for Internet Explorer IE11

* WIP trying to figure out IE options/capabilities

* more attempts to get IE tests working

* more work, but still can't set font size in Dev Tools Console

* two changes for IE

* revert skip in console test

* this change *appears* to set absolute times but they don't stick

* Shakespeare passing on all 3 browsers

* add config.ie.js, change 'internet explorer' to 'ie'

* increase notifications:lifetime so ew have a chance to see the message

* fix lint error remove unused Options

* updates from PR review, remove console.log

* cleanup + reuse existing code

* make iedriver path work for x-pack tests

* try to avoid changing notification timeout

* resolve path and add correct delimiter

* remove unused code, make timepicker work on IE11

* work-around 45333 for IE11

* [WIP] removing some work-arounds

* revert work-arounds

* cleanup

* remove debugging code

* remove debugging code

* removed unused code

* reverting 2 files that didn't have any material changes
2019-10-04 11:13:58 -05:00
Spencer 3bc803e371
[mkdirp] remove in favor of recursive fs.mkdir (#47251)
* [mkdirp] remove in favor of recursive fs.mkdir

* add eslint rule to educate future contributors

* reword the eslint error message to prevent copy-pasting callback code

* Commit updated kbn-pm dist

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Fix typo

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2019-10-04 08:15:06 -07:00
renovate[bot] 0262f6184c Update mocha related packages (major) (#43915)
* Update mocha related packages

* update snapshots

* upgrade gulp-mocha so that it uses new mocha too

* fix async/cb overspecification
2019-10-01 00:07:13 -07:00
Brian Seeders 91090dbca3
Use unique junit report filenames again (#45897)
Fix disappearing test results in pipelines
2019-09-17 15:23:27 -04:00
Spencer fc186e57d5
[ftr/savedObjects] add simple saved object api client to ftr s… (#45856)
* [ftr/savedObjects] add simple saved object api client to ftr services

* fix typo

* use consistent spacing

* fix types and TS-ify the rest of kibanaServer service

* expose server urls with better API

* tweak status api response types

* fix http body param name

* second arg to axios post is the post data

* use standardized error handling behavior

* Revert "use standardized error handling behavior"

This reverts commit 7e9a7f8dc5.

* revert unnecessary changes
2019-09-17 12:07:28 -07:00
Brian Seeders 27d23c4184 Jenkins pipeline with parallel cigroups (#45285)
* Pipeline

* WIP some work for parallelization with ciGroups

* Fix xpack kibana install dir, and add some debugging

* Attempt to quick fix a few tests

* Revert "Revert "Revert "[ci] compress jobs for CI stability" (#44584)""

This reverts commit 078ac2897f.

* Recombine test groups, and try runbld again

* Mostly cleanup, and fix failed_tests reporting to hopefully work for both pipeline and non-pipeline

* Fix typo in shell script

* Remove some debug code

* Add support for changing es transport.port during testing via TEST_ES_TRANSPORT_PORT

* Fix test that uses hard-coded es transport port and add it back in to parallel groups

* Disable checks reporter again for now

* Set env var for TEST_ES_TRANSPORT_PORT in pipeline

* Update Jenkinsfile for shorter testrunner labels

* Fix another hard-coded transport port

* Fix a new test with hard-coded URLs

* Jenkinsfile cleanup and fix one of the groups

* Fix double slash

* Testing vault credentials on jenkins server

* Add a non-existent credential

* Revert "Add a non-existent credential"

This reverts commit 0dc234c465a5483b1a994cb510a182fef766e9cc.

* Try github-checks-reporter again

* github-checks-reporter should only run for elastic/kibana, forks won't work

* Clean up some debug code

* Changing names around to try to make BlueOcean UI a little better

* Add more stages

* Make some changes to stage structure to mirror a nested example from CloudBees

* Handle TODOs, and some cleanup in Jenkinsfile

* Pass GIT_BRANCH when started without GHPRB, fix branch check

* Fix mailer problem and add code that ensures all tests are in cigroups back in

* Test adding worker/job name to junit report paths

* Remove some duplication from ci_setup scripts

* Fix unit test that uses junit path

* Don't reinstall node every time setup_env is run

* Fix yarn install logic

* Fix another unit test that uses junit output dir

* Download latest ES snapshot after kibana builds

* Make sure junit reports are always processed

* Add two failing tests for testing purposes

* Add support to Jenkinsfile for kibana build e-mails

* Remove some debug code for email sending

* Change JOB env handling in junit paths and move it to a sub-directory

* Revert "Add two failing tests for testing purposes"

This reverts commit 5715203e26922a93483feb0ebb8bb3fdcc3daf8c.

* Fix junit report path in test

* Don't send kibana emails on build abort

* Address PR feedback, formatting and use built-in url formatting library

* Fix path formatting for functional test

* Add email sending back in to Jenkinsfile

* Fix another unit test with path problem
2019-09-11 11:58:28 -07:00
Spencer 16eb033a24
[ftr] support --kibana-install-dir flag (#44552)
* [ftr] support --kibana-install-dir flag

* improve spacing/style of success message

* Remove unused var
2019-09-05 13:06:10 -07:00
renovate[bot] 0001c74370 Update dependency del to ^4.1.1 (#44806) 2019-09-04 13:15:59 -07:00
Jonathan Budzenski bad947d7d1
move optimize into data folder (#25944)
* move optimize into data folder

* path

* replace optimize with data in notice glob

* update docs

* more updates

* update snapshots

* re-add folder references

* prettier

* save changes

* rm optimize from .eslintignore

* rm extra file

* fix merge
2019-08-28 10:09:58 -05:00
renovate[bot] dfddf3dbdd Update dependency chalk to ^2.4.2 (#44032)
* Update dependency chalk to ^2.4.2

* update kbn-pm dist
2019-08-27 21:58:53 -07:00
Dmitry Lemeshko d859b79a98
fix logging 'undefined' on tests completion (#43983) 2019-08-26 19:44:43 +02:00
Spencer 90de95822b
[mocha] fix test selectors to get everything in packages (#43797)
* [mocha] fix test selectors to get everything in packages

* fix paths in tests

* ignore test files that make it into target directories

* [@kbn/test] don't build test files

* move tests from datemath and test-subj pkgs into __tests__ dirs

* [kbn/test-subj] remove test script

* update yarn.lock
2019-08-22 18:49:01 -07:00
renovate[bot] 572274b779 Update babel related packages (#43595)
* upgrade all babel related modules, and bump lodash minors

* update kbn-pm dist

* update fetch-mock, necessary to use core-js 3

* use regenerator transform in jest tests, as required by EUI

* disable useBuiltIns rather than using regenerator plugin

* remove extra regenerator-runtime import
2019-08-22 18:40:57 -07:00
Spencer e8409c0160
Move src/dev/run to @kbn/dev-utils (#43387)
* move src/dev/run into `@kbn/dev-utils`

* forgot to save a replacement
2019-08-16 07:13:54 -07:00
Tre 5d8ad40c5c
[FTR] Refactor mocha under @kbn/test (#42862)
* Run prettier on the files that will be refactored under @kbn/test, in a follow-up pr.

* Fixup all paths to mocha,
under kbn-test, with needed
exports/imports.

* Fixed borked path (bad refactor).

* Fixup one more borked path.

* Fixup tsconfig for xml.ts

* Drop setup_node_env as it's already
in KIBANA/scripts/mocha.js.
Also, fixup cwd for globby as we are
exec-ing from a different directory.
2019-08-15 15:48:39 -06:00
Spencer b2515c780d
[watcher] add missing await (#41351)
* [watcher] add missing await

* run x-pack-firefoxSmoke ciGroup 40 times, run watcher tests 20 times per job

* Fix failing watcher test

* Revert "run x-pack-firefoxSmoke ciGroup 40 times, run watcher tests 20 times per job"

This reverts commit c5d891d44d.

* Clean up watches via api

* fix linting errors

* don't swallow errors, wait for completion

* strip trailing numbers in suite tags

* run x-pack-firefoxSmoke group 40 times

* Revert "run x-pack-firefoxSmoke group 40 times"

This reverts commit cc4eb6ce54.

* run x-pack-firefoxSmoke group 40 times

# Conflicts:
#	.ci/jobs.yml

* run tests 80 times

* Revert "run tests 80 times"

This reverts commit 4320c9488a.

* Revert "run x-pack-firefoxSmoke group 40 times"

This reverts commit cf0d4056d7.
2019-08-15 10:49:36 -07:00
Mike Côté cb0cabf0cc
Add Elasticsearch SSL support for integration tests (#41765)
* Allow tests to use SSL between Kibana and Elasticsearch

* Fix cert path

* By default no tests will use the new ssl feature
2019-08-08 18:38:16 -04:00
Mike Côté aaea5679d0
Add SSL support when starting Elasticsearch from yarn es (#42527)
* Initial work

* Add integration tests

* Use constants

* Fix broken code

* Handle scenario where esArgs is a string

* Remove || []

* Apply PR feedback

* Use const format
2019-08-07 10:34:44 -04:00
Tre e62ec7c5ec
[FTR] Refactor FTR to live under KBN-TEST (#42547)
Refactor the FTR to live under KBN-TEST . 

Next, refactor any and all files that the
FTR needs to live under KBN-TEST,
as needed.
2019-08-06 15:35:16 -06:00
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