Commit graph

112 commits

Author SHA1 Message Date
Ahmad Bamieh 79d547488d
[7.x] [Telemetry] force staging urls in tests (#63356) (#63408)
* specify telemetry url configs

* opt out by default except where we are testing telemetry
2020-04-14 01:54:22 +03:00
Mikhail Shustov a8558f926e
Serve static assets from NP (#60490) (#61619)
* add hapi.inert plugin to NP

* update tests

* move serving static assets

* update tests

* add functional tests

* fix type errors. Hapi.Request doesn't support typings for payload

* update docs

* remove comment

* move assets to NP

* update all assets references

* address Spencer's comments

* move ui settings migration to migration examples

* document legacy plugin spec

* move platform assets test to integration_tests

* address Spencer's comment p.2

* try to fix type errors

* fix merge commit

* update tests
2020-03-27 18:01:28 +01:00
Rashmi Kulkarni d7bb13a311
[7.x] FTR configurable test users (#52431) (#60428)
* FTR configurable test users (#52431)

* initial implementation of configurable test users

* user superuser by default to match master

* referenced the configs in reporting and api integration

* setting the minimum number of default roles

* looking for x-pack tests with users and roles

* add testUserService in dashboard mode tests

* running only ciGroup7

* uncommenting - addign visualization

* re-enabling all CI groups to run on CI

* reinstating Jenkinsfile

* disable Test user for OIDC config

* improved logging and added Roles for OSS tests to get better info on the runs.

* disable test_user for auth tests

* don't fetch enabledPlugins when testuser disabled

* fix es-lint

* running oss tests with x-pack enabled

* [revertme] build default dist for oss tests

* updating NOTICE.txt file as it complained in the kibana intake tests

* changed to pick OSS builds

* trying a license change to trial

* switch back to xpack builds

* created a new sample data role and used it in homepage tests

* revert test/scripts/jenkins_ci_group.sh

* only refresh browser and wait for chrome if we are already on Kibana page

* fix large_string test to use minimum set of roles and privileges

* fix for date nanos custom timestamp with a configured role

* changes to the files with addition of new roles for the test_user

* reverting to OSS changes and few additions to the time_zone test to run as a test_user

* changes to security

* changes to the x-pack test to use elastic superuser

* fix for chart_types test

* fixes to area chart , input control test

* fix for dashboard filtering test and a new config role

* changes to handle the x-pack tests

* additional role for date nanos mixed

* added the logstash role to the accessibility tests

* removed telemetry setting

* docs+few changes to the tests

* removed Page navigation

* removed pageNavigation which was unused

* test/accessibility/apps/management.ts

* update management.ts

* aria label, and other changes

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* accidentally checked in a piped file with results.

* reverted

* unloading of logstash data, fixing aria label

* aria-label

* added the required role

* fix for tsvb chart

* fix for sample data test reverted home_page pageobject file

* changes to sample data test and visualize index file to incorporate OSS changes

* changes to describe() and some more changes to incorporate in settings_page

* re-adding the after()

* removed unwanted roles

* replaced kibana_user with kibana_admin

* added the check of deprecated kibana_user

* testing with kibana_admin  role

* fix for discover test

* incorporated the review comments

* incorporated the review comments

* incorporate review comments and added restoreDefaults()

* removed describe.only

* reverted the OSS logic change I had here- pulled into seperate PR

* incorporated the review comments

* incorporated review changes

* adding hidden=true to find hidden kibanaChrome

* change field.test.tsx to be same as that of master branch

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* removed the accidentally added file

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-03-17 18:21:48 -07:00
Nick Partridge af577cc79c
Kibana property config migrations (#55937) (#56720)
* Move defaultAppId config param into kibanaLegacy
* Move disableWelcomeScreen config param into Home plugin
* Update api and docs with silent option for renameFromRoot
2020-02-04 08:04:04 -06:00
Larry Gregory 8b0b09a4ea
Security - Role Mappings UI (#53620) (#54534)
* Initial role mappings UI

* apply design edits

* address PR feedback

* fix type cast for number field

* Update x-pack/legacy/plugins/security/public/views/management/role_mappings/edit_role_mapping/components/mapping_info_panel/mapping_info_panel.tsx

Co-Authored-By: Joe Portner <5295965+jportner@users.noreply.github.com>

* Cleanup FTR configuration, and handle role mapping 404 errors properly

* align naming of role mappings feature check

* Apply suggestions from code review

Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>

* add missing test assertions

* inlining feature check logic

* switch to using snapshot

* use href instead of onClick

* adding delete unit test

* consolidate href building

* unify page load error handling

* simplify initial loading state

* documenting unconditional catch blocks

* use nodes.info instead of transport.request

* Apply suggestions from code review

Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>

* move model out of LP into NP

* convert except_field_rule to except_any_rule

* docs, take 1

* update gif

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-11 20:05:46 -05:00
Tim Sullivan 4855bcd6b8
[Test/Newsfeed] Re-enable test and add news item to be filtered (#53905) (#53915) 2020-01-03 10:05:14 -07:00
spalger c2c12539b8 autofix all violations 2019-12-13 23:55:01 -07:00
Aleh Zasypkin bb8e383295
[7.x] Migrate the rest of the API endpoints to the New Platform plugin (#52789) 2019-12-11 20:54:15 +01:00
Spencer c72fae4ddf
[7.x] [ftr/lifecycle] refactor to be typesafe (#52453) (#52598)
* [ftr/lifecycle] refactor to be typesafe

* update test fixture

# Conflicts:
#	packages/kbn-test/src/functional_test_runner/lib/lifecycle.ts
#	test/functional/services/remote/poll_for_log_entry.ts
#	test/functional/services/remote/remote.ts
#	test/functional/services/remote/webdriver.ts
2019-12-09 20:29:39 -07:00
Rashmi Kulkarni 330dde2ac1
moved security to OSS/common (#52322) (#52330) 2019-12-05 13:29:58 -08:00
Spencer 47631985fa
[7.x] [FTR] expose new es client service (#51066) (#51173)
* [FTR] expose new es client service (#51066)

* always extend all common config and expose new es client service

* replace `es` service with `legacyEs`

* fix one refernce that's unique to 7.x
2019-11-20 19:12:19 -07:00
Joe Portner 10d93a9ccb
Additional validation for elasticsearch username (#48247) (#50920)
* Additional validation for elasticsearch username

If "elastic" user is set in config:
* In dev mode, throws an error
* In prod mode, logs a deprecation warning

* Fix user for functional tests

* Revert last two commits

Revert "Fix user for functional tests" and
"Fix user for plugin functional tests in Jenkinsfile"

* Change elasticsearch creds for test server

Now uses "kibana" user instead of "elastic" user

* Fix plugin API functional tests

* Fix PKI API integration test

* Change log messages, now conditional on `dist: false` not `dev: true`
2019-11-18 11:51:03 -05:00
Tim Sullivan 53af425c62
[7.x] [Newsfeed] UI plugin for Kibana (#49579) (#50503)
* [Newsfeed] UI plugin for Kibana (#49579)

* Added base folder structure for Newsfeed plugin

* Added base folders for lib and component

* Added newsfeed button to navigation controls on the right side

* add getApi() to return api data observable (#49581)

* Added flyout base body and provided EuiHeaderAlert component inside the newsfeed plugin

* Moved newsfeed plugin to OSS and added for the styles purpose new folder for legacy plugin 'newsfeed' with the same id to support this

* Added subscribe on fetch newsfeed change

* Add NewsfeedApiDriver class (#49710)

* add NewsfeedApiDriver class

* fix xpack prefix

* add corner case handling

* Added data binding to the ui

* added EuiHeaderAlert style overrides (#49739)

* Fixed due to comments on PR

* add missing fields to NewsfeedItem and FetchResult

* fix templating of service url

* gracefully handle temporary request failure

* Mapped missing fields for data and badge

* Fixed typos issues

* integrate i18n.getLocale()

* allow service url root to be changed in dev mode

* replace a lot of consts with config

* fix flyout height (#49809)

* Add "error" field to FetchResult: Error | null

* simplify fetch error handling

* Do not store hash for items that are filtered out

* add expireOn in case it is useful to UI

* always use staging url for dev config

* unit test for newsfeed api driver

* simplify modelItems

* Fixed eslint errors

* Fixed label translations

* Add unit test for concatenating the stored hashes with the new

* add newsfeed to i18n.json

* Fixed expression error

* --wip-- [skip ci]

* fix parse error

* fix test

* test(newsfeed): Added testing endpoint which simulates the Elastic Newsfeed for consumption in functional tests

* add tests for getApi()

* add tests for getApi

* Added no news page

* fix fetch not happening after page refresh with sessionStorage primed

* test(newsfeed): Added testing endpoint which simulates the Elastic Newsfeed for consumption in functional tests

* Added loading screen

* Small fixes due to comments

* Fixed issue with stop fetching news on error catch

* test(newsfeed): Configure FTS to point newsfeed to the simulated newsfeed endpoit

* Fixed browser error message: Invariant Violation: [React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.

* Fixed typo issue in label name

* polish the code changes

* Add simple jest/enzyme tests for the components

* honor utc format

* Filter pre-published items

* Fall back to en

* retry tests

* comment clarfication

* Setup newsfeed service fixture from test/common/config

* Added base functional tests for newsfeed functionality

* valid urlroot is for prod

* add documentation for the supported enabled setting

* more urlRoot

* --wip-- [skip ci]

* add the before for fn

* add ui_capabilties test

* update jest snapshot

* Fixed failing test

* finish newsfeed error functional test

* include ui_capability config

* error case testing in ci group 6

* refactor(newsfeed): moved newsfeed api call so that it is done before its use

* code polish

* enabled newsfeed_err test in CI

* allow default export for ftr file

* [Newsfeed/Lint] fix chained fn lint
2019-11-13 14:36:23 -07:00
Ahmad Bamieh d7992f9bf0 [Telemetry] Server side fetcher (#50015) (#50454)
* initial push

* self code review

* ignore node-fetch type

* usageFetcher api

* user agent metric

* telemetry plugin collector

* remove extra unused method

* remove unused import

* type check

* fix collections tests

* pass kfetch as dep

* add ui metrics integration test for user agent

* dont start ui metrics when not authenticated

* user agent count always 1

* fix broken ui-metric integration tests

* try using config.get

* avoid fetching configs if sending

* type unknown -> string

* check if fetcher is causing the issue

* disable ui_metric from functional tests

* enable ui_metric back again

* ignore keyword above 256

* check requesting app first

* clean up after all the debugging :)

* fix tests

* always return 200 for ui metric reporting

* remove boom import

* logout after removing role/user

* undo some changes in tests

* inside try catch

* prevent potential race conditions in priorities with =

* use snake_case for telemetry plugin collection

* usageFetcher -> sendUsageFrom

* more replacements

* remove extra unused route

* config() -> config

* Update src/legacy/core_plugins/telemetry/index.ts

Co-Authored-By: Mike Côté <mikecote@users.noreply.github.com>

* Update src/legacy/core_plugins/ui_metric/server/routes/api/ui_metric.ts

Co-Authored-By: Mike Côté <mikecote@users.noreply.github.com>

* config() -> config

* fix SO update logic given the current changes

* fix opt in check

* triple check

* check for non boolean

* take into account older settings

* import TelemetryOptInProvider

* update test case
2019-11-13 12:29:00 -05:00
Spencer c88cad27ca
[7.x] use a custom wrapper around chance with longer defaults… (#49866)
* use a custom wrapper around chance with longer defaults to avoid conflicts

* fix a reference to chance

* fix another reference to chance service

# Conflicts:
#	x-pack/test/saml_api_integration/apis/security/saml_login.ts
2019-10-31 08:52:10 -07:00
Ahmad Bamieh e51369a72a
[7.x] [Telemetry] Move to OSS (#45769) (#48370) 2019-10-16 11:50:17 +03:00
Tre 4256ec2937
[7.x] [FTR] Support for new and old es clients (#47377) (#47601)
* Add dep for new es client,
refactor all mentions of the old client
to the new.
2019-10-08 12:00:32 -06:00
Spencer 813dbbd725
[7.x] [dev-utils] implement basic KbnClient util for talking t… (#47003)
* [dev-utils] implement basic KbnClient util for talking to Kibana server

* update KbnClient to expose full KibanaServerService API

* expose request() function and uriencode helper

* [uiSettings] retry read on conflicts auto upgrading

* expose function for resolving a Kibana server url

* only use apis in test hooks

* run x-pack-ciGroup2 60 times

* log retries as errors so they are included in console output for job

* bump

* Revert "run x-pack-ciGroup2 60 times"

This reverts commit 6b6f392edf.

* refactor urlencode tag to be a little clearer

* support customizing maxAttempts in request method
2019-10-01 00:12:23 -07:00
Spencer 7c0acf05a4
[7.x] [ftr/savedObjects] add simple saved object api client to… (#45940)
* [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 14:45:56 -07:00
Dmitry Lemeshko 145945ebbf esArchiver: retry kibana config update (#43987) (#44169)
* [services/es_archiver] retry uiSettings update

* run x-pack-ciGroup7 30x times

* Revert "run x-pack-ciGroup7 30x times"

This reverts commit 80e199c3aa.

* [saved_object_api_integration/common/services] add retry service to the set

* add retry service for x-pack api tests
2019-08-27 18:00:39 -07:00
spalger f663e18cb8 [7.x] [prettier] upgrade to 1.18.2 (#40229)
* [prettier] upgrade to 1.18.2

* autofix prettier violations

(cherry picked from commit a95ae8c037)
2019-07-03 13:00:44 -07:00
Josh Dover 5c4e18778f
[7.x] Add addError function to toastNotifications (#32187) (#37739) 2019-06-03 17:06:47 -05:00
Todd Kennedy e9bfc7fb11
[chore] upgrade wreck (#36527) (#36552)
wreck has been deprecated and will receive no further security updates
in favor of @hapi/wreck
2019-05-14 18:30:43 -07:00
Matt Bargar 11a05bd8a4
Add esTypes property to index pattern field (#35251) (#35438)
Adds an array property to the Field object containing all of the types the field is mapped as across ES indices.
2019-04-23 13:36:30 -04:00
Dmitry Lemeshko 28dd528de3
[services/retry] add onRetryBlock function to run before each retry (#34434) (#34488)
* [services/retry] add onFaliureBlock function to run before each retry
2019-04-04 21:46:31 +02:00
Spencer ba82d027cd
[ts][ftr] improve types for ftr and expect.js, cleanup changes to tsconfig files (#31948) (#32250)
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 14:26:32 -08:00
Aleh Zasypkin 515682956d
[7.x] Introduce Elasticsearch service. (#32206) 2019-02-28 18:53:32 +02:00
Spencer 49ceb63556
[7.x] run the kibana server in production mode for functional testing (#31346) (#31444)
Backports the following commits to 7.x:
 - run the kibana server in production mode for functional testing  (#31346)
2019-02-18 14:56:22 -08:00
Spencer 67c34184fa
[7.x] [ftr] move server.maxPayloadBytes config to central shared config (#31360) (#31383)
Backports the following commits to 7.x:
 - [ftr] move server.maxPayloadBytes config to central shared config  (#31360)
2019-02-17 19:01:39 -08:00
Spencer 00a7ae5326
[7.x] [ftr/services/es] use apiVersion from es plugin (#30733) (#30766)
* [ftr/services/es] use apiVersion from es plugin (#30733)

* switch to 7.x api version
2019-02-12 08:18:28 -08:00
Spencer 750d2c4a8a
[ftr/services/kbnServer] set uiSetting defaults more often (#30459) (#30577)
* [ftr/services/kbnServer] set uiSetting defaults more often

* [ftr/services/uiSettings] only init defaults when they're defined
2019-02-09 13:22:03 -08:00
Spencer 4d40ddff7a
Implement config for disabling welcome screen (#28888)
As suggested by @legrego in #28792, this PR adds a config flag to completely disable the welcome screen, which is enabled by the functional test runner to ensure that the welcome screen doesn't pop up.
2019-01-17 12:13:13 -08:00
Jonathan Budzenski b5b64f4706
Support for multiple Elasticsearch nodes and sniffing (#21928)
* Node sniffing

* update monitoring

* cleaning

* remove tests

* rewrite tests using the proxy

* fix monitoring mocha tests

* fix payload

* return full error

* default interval false

* add sniff settings to monitoring

* add docs for sniff settings

* re-add index search integration test

* catch parse error

* capital

* fix merge

* hapi upgrade

* return

* pass by prefix

* rm empty test fille

* split error handling

* fix merge

* update recent elasticsearch.url references

* prettier vs eslint

* transport.request, include query params

* mega comment

* revert elasticsearchUrl

* safe hosts

* more docs es.url references

* remove unused ml/esServerUrl

* log if both set
2018-12-18 13:22:43 -06:00
Spencer df69626a30
[esArchiver] auto-create the default space object when necessary (#24953)
* [esArchiver] auto-create the default space object when necessary

* [esArchiver] check for spaces plugin to create default space
2018-11-01 09:41:09 -07:00
Josh Dover 27e5406d7a
Upgrade Hapi in legacy platform to v17 (#21707)
* Disable even-better monitoring

* Upgrade to Hapi v15

* Upgrade to Hapi v16

* Handle optional req params correctly

* Update http and kbnServer

* Get mocha tests passing

* Convert `reply` usages [wip]

* Fix Joi and Plugin incompatibilities

* Get server up and running

* Get basic logging working

* Fix optimizer

* Fix recent route handlers

* Various fixes

* Fix recent routes

* Upgrade wreck for async/await

* Fix mocha tests

* Fix joi issues

* Fix xpack jest tests

* Fix recent routes

* Fix tests

* Fix index setup

* Decouple monitoring stats collection from good plugin

* Update reload logging test to work

* Reimplement logging with updated good plugin

* Fix unit tests

* Fix getConnections back

* Make LegacyLoggingServer compatible with Hapi v17

* Update joi types

* Fix x-pack unit tests

* Remove stray debugger

* Remove hapi-compat

* Fix API integrations

* Upgrade boom

* Fix security plugin

* Misc fixes

* bump

* Fix licensePreRoutingFactory

* Fix failing integration tests

* Remove unnecessary test change

* Remove hapi-latest package

* fx

* Various cleanup

* Fix race condition in oppsy events

* Use elastic/good fork

* Fix boom.wrap and hapi-latest changes

* Simplify LegacyLoggingServer updates

* package.json cleanup + test fix

* yarn.lock cleanup

* Change good tag

* Fixes

* Change return err -> throw err in routes

* Fix await returns

* Fix new load_data test

* Make cookie security flags consistent

* tmp doc

* Fix types

* Fix tests

* Upgrade canvas plugin

* Move good package to published @elastic/good one

* Fix SO test

* Fix logging reloading

* Update APM apis

* Fix error logging

* Fix logging test

* Convert spaces plugin

* Add validation error shim

* Remove 7.0 release notes

* Await renderApp

* Fix ccr routes

* Prevent header popovers from scrolling with page content (#23850)

* Fix spaces test

* new yarn.lock-s

* Fix spaces tests

* Remove h2o2-latest

* Fix @types/hapi

* Upgrade InfraOps plugin

* Fix package.json

* Add back isSameSite: false

* Upgrade beats_management plugin

* Update snapshot

* Fix InfraOps

* Upgrade kql_telemetry

* Merge upstream/master

* Upgrade apm and ml

* Put snapshot test back

* Fx beats

* Upgrade rollups

* Update boom usages in new plugins
2018-10-25 16:01:12 -05:00
Spencer 9209987165
[accessibility] implement no-animation mode, auto enable for functional tests (#21629) 2018-08-20 19:30:24 -07: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 e49d5f3b10
[uiSettings] support overriding uiSettings from the config file (#21628)
This PR implements the `uiSettings.overrides` setting which [when stored in kibana.yml or passed as config args when starting Kibana] allows forcing some uiSettings to always have a specific value. This setting accepts a map of uiSetting keys to values that will always be used to override whatever is stored in the config saved object.

![image](https://user-images.githubusercontent.com/1329312/43619094-feded1ae-9680-11e8-9ec3-c12d4d949c46.png)

When users view the settings in the advanced settings UI they are disabled and describe why they can't be changed.

![image](https://user-images.githubusercontent.com/1329312/43618938-2cdee0f4-9680-11e8-9ed6-f384d4ee78f6.png)

Attempting to change these values from the uiSettings client/service/api is also prevented, causing a 400 error to be thrown and/or sent as the response.
2018-08-14 21:52:35 -07:00
Spencer 3b8e95758c
[retry] implement waitFor method (#21747)
We currently use the `retry` service to call a function over and over in a loop, waiting for it to run without throwing an error, and ultimately failing if it does not succeed before a timeout is exceeded. This is the easiest way to get certain interactions to work, either because we don't know when we should be able to execute the interaction successfully, or because the timing is just too tricky to plan out correctly. Another place where we are using the `retry` service, which I don't think is appropriate, is when we need to wait for a certain condition to be met. This is where `retry.waitFor()` comes in:

```js
await retry.waitFor('dashboard search to be enabled', async () => {
  const searchInput = await testSubjects.find('savedObjectFinderSearchInput');
  return await searchInput.isEnabled();
})
```

The `retry.waitFor()` method behaves much like the `retry.try()` method behind the scenes, calling a function over and over, but instead of waiting for it to run without throwing an error it waits for it to return a "truthy" value. It also requires a description string that is used to make rather nice log output and a more descriptive error message than something like https://github.com/elastic/kibana/blob/master/test/functional/apps/dashboard/_data_shared_attributes.js#L61-L67
2018-08-14 13:35:32 -07:00
Josh Dover 17af683933
Reverts breaking change for Status API (#21927)
* Unbreak status API

* Update xpack test

* Bump
2018-08-13 17:26:20 -05:00
Josh Dover 33c6ade756
Convert status page to EUI (#21491)
* Convert the status_page plugin to EUI

* Fix uiColor for disabled state
2018-08-09 12:26:17 -05: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
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
CJ Cenizal 77b53db939
Change tryForTime error output from 'failure' to 'error', to make it easier to grep the logs for actual failures. (#19707) 2018-06-12 17:19:50 -07:00
archana 547723f24c
[Functional test server] Watch port for optimize should be different (#19619) 2018-06-05 16:10:15 -05: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
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
Spencer 90e2aa001b
[savedObjects] Use index template (#14271)
* [es][savedObjects/index] put template on each savedObject write

The elasticsearch plugin currently checks for the Kibana index on each iteration of the healthCheck, and creates it if it does not exist. This removes that step from the healthCheck and instead, before each savedObject is written to elasticsearch, ensures that Elasticsearch has the necessary index template should the write result in index creation.

The healthCheck still has the `patchKibanaIndex()` logic, which checks the type in the Kibana index and adds any missing types. This step now does nothing when the Kibana index does not exist, and does what it has always done when it does.

* [ftr] remove unused kibanaIndex service

(cherry picked from commit b1ef897dafeb6d43fe279776e44a9d793a389dc3)

* [savedObjects/integration] create now creates kibana index

* [es/healthCheck] remove use of format()

* [es/healthCheck/tests] use sinon assertions

* [es/patchKibanaIndex] test for kibana index missing behavior

* [savedObjects/errors] add tests for EsAutoCreateIndexError

* [savedObjects/config] deprecate and remove savedObjects.indexCheckTimeout config

* use dangling commas consistently

* [ui/error_auto_create_index] fix class names

* [ui/savedObjectsClient] no need to specify basePath

* [eslint] fix linting issue
2017-11-21 17:05:46 -07:00
Spencer 5cddc10077
Upgrade to eslint 4 (#14862)
* [eslint] upgrade to 4.10.0

* [eslint-config-kibana] limit jest config to jest test files

* [ui_framework] remove trailing comma from rest-spreads

* [dashboard/tests] tag jest helpers with .test.js suffix

* explicitly import expect.js where used

* [eslint] apply auto-fixes

* [eslint] manually add/wrap some parens for compliance

* [npm] point to local packages for testing/review

* [jest] remove .test extension from jest helpers

* [ui_framework] fix trailing comma removal from 3bc661a1c8

* [packages] upgrade eslint packages
2017-11-14 18:16:59 -07:00
Spencer 6998f07454 [uiSettings] auto create/upgrade saved config (#14164)
* [uiSettings] auto upgrade savedConfig doc when missing

* naming tweaks

* fix comments

* ensure that rcVersions are not found within a version

* add some tests for non-single digit versions/rcs/betas

* return the condition, rather than using an if()

* assert that getUpgradeableConfig() is always called once

* [uiSettingsService] remove excess space

* [savedObjectsClient] only attempt to createOrUpgradeSavedConfig once

* [uiSettings/routes/tests] remove unused assert helper

* [functional/console] correct test title

* [ftr/kibanaServer/uiSettings] fix disableToastAutohide timeout
2017-10-05 15:34:09 -07:00
Spencer 4fed3725ae [SavedObjects] use constructor options (#14200) 2017-09-27 14:57:47 -07:00
Spencer 8a64872ecb [fix/UiSettings] ignore certain errors (#13079)
* [SavedObjectClient] emit detectable errors

* [uiSettingsService] consume new SavedObjectsClient errors

* [SavedObjectsClient] expose errorTypeHelpers as such

* [elasticsearch/tests] recreate error for each test

* [http] wait for elasticsearch plugin to be ready

* [shortUrl/tests] ensure that create request responds with 200

* [shortUrl] use errorTypeHelpers to filter errors

* [uiSettings/savedObjectsClientStub] stub errorTypeHelpers

* [SavedObjectsClient/errors] expose error module so tests can make errors

* [shortUrl/tests] use actual SavedObjectsClient errors

* [uiSettings/savedObjectsClientStub] use actual errors lib

* [SavedObjectsClient] use decorate instead of "wrap"

* [server/routes/uiSettings] refactor routes to forward Boom errors from uiSettings

* [uiSettings] colocate routes and service

* [testUtils/esTestCluster] use more standard api style

* [testUtils/es] add createCallCluster util

* [testUtils/esTestCluster] add getters for client/callCluster

* [es/healthcheck] ensure that healtcheck stops when server is stopped

* [uiSettings/routes] add param/payload validation

* [uiSettings/routes] add tests that verify error behaviors
2017-08-08 17:55:36 -07:00
Spencer 6748b22d03 Implement esTestCluster test util (#13099)
* [es/tests] remove unused module

* [testUtil/es] add utility for starting es nodes in tests

* [ftr/tests] use esTestCluster util to start es

* [es/tests/routes] use esTestCluster to start own es

* [testUtils/kbnServer] disable uiSettings unless plugins are enabled

* [testUtils/esTestCluster] use standard test es port by default

* [server/http/tests] add esTestCluster to setup

* [test/config] unify es test config into a single module

* [testUtils/esTestCluster] directory is no longer configurable

* [testUtils/esTestCluster] throw when es.start() is called again without es.stop()

* [testUtils/esTestCluster] is* checks should not mutate state
2017-07-28 09:47:41 -07:00
Stacey Gammon fa302a16f3 ensure timezone attribute in tests is adhered to (#13121)
* ensure timezone attribute is adhered to

Two issues - one the archiver was loading the visualize mapping after
the config setting so it was bring overwritten, and two,
uiSettings.replace wasn’t working correctly to begin with.

* extra line to ensure server is stabilized to prevent transitory failures
2017-07-26 12:15:56 -04:00
Tyler Smalley 3c0c0ff441 Use single ES document type (#12794)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2017-07-19 09:27:16 -07:00
Spencer 10656c2108 [ftr/kbnServer] prevent caching errors when fetching status (#12848) 2017-07-13 17:02:28 -07:00
Spencer eb31af6d7b [tests/functional] catch and ignore errors during stabilization (#11906) 2017-05-25 14:06:54 -07:00
Spencer d3ba428796 [ftr] make room for more projects (#11848)
Squashed commit of the following:

commit 659ea986fdeb9a5ff2ca1fa5360cccb01c671ede
Author: spalger <spalger@users.noreply.github.com>
Date:   Wed May 17 09:19:22 2017 -0700

    [test/*/fixtures] rename es_archives to es_archiver

commit d3667457c78e88e2d6974f3c38dd0fe61b846b91
Author: spalger <spalger@users.noreply.github.com>
Date:   Wed May 17 08:22:03 2017 -0700

    [ftr/config] fix default directory value functions

commit 9a6a2cc0b295e2281e83da04fcea40e9d6f00781
Author: spalger <spalger@users.noreply.github.com>
Date:   Wed May 17 07:30:52 2017 -0700

    fix import paths

commit fcb65a877d54b5b1d36b8c81f1264b36845e826e
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 21:39:57 2017 -0700

    [grunt/ftr] use named exports for configs

commit 7d7f38c7615cdbf8eb0119efc0f2a5188bca8792
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 18:50:04 2017 -0700

    [test] remove unnecessary directory definitions

commit 0c28984669768482f0a2ee7fc2800d5bcaf49025
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 18:46:29 2017 -0700

    [ftr/config] make default directories relative to config path

commit cd2f33612624cacffec138797f3fc0f4ecb46cca
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 18:32:12 2017 -0700

    [test/common] put server config into common

commit 7851ed811a236576c63bd20850b3ef2099be2a4e
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 18:18:20 2017 -0700

    [grunt] "deprecate" test:api:runner task

commit b2ac4c26593a1947c94f0168191fe8123ff74122
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 18:15:41 2017 -0700

    [ftr] accept the project name as an unnamed arg

commit 47e292894fc70c0a04883403c50c5d2ae0738d76
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 17:56:34 2017 -0700

    [ftr/grunt] convert ftr task to multi-task with config

commit 83375855f88e5e7b3fa8b6a1c5d24a9f54766ce5
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 17:54:54 2017 -0700

    [test/functional] move fixtures into test/functional project

commit 05994e9c92cf134c58f831c285b3b522a801acbc
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 17:02:51 2017 -0700

    [src/test_utils] merge with test/utils directory

commit c77ee5ed36b8b7eadf876cb6d9482a49dfc92b66
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 16:53:00 2017 -0700

    [test/api_integration] migrate api tests to functional test runner

commit ca328c34648dd7e07f70e1844e07cfc392e41103
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 16:50:12 2017 -0700

    [esArchiver] refresh modified indices after load

commit cde74a540850fd97578f441d6dccaefd1444e656
Author: spalger <spalger@users.noreply.github.com>
Date:   Tue May 16 16:46:48 2017 -0700

    [test/functional] move shared services into test/common

commit 0ea2646aea5817f6d1595e6ae0d356c426f138f0
Author: spalger <spalger@users.noreply.github.com>
Date:   Mon May 15 22:51:23 2017 -0700

    [scripts/mocha] run _mocha script when debugging

commit 1cc80600d90e318d4738920aa557d124075a4570
Author: spalger <spalger@users.noreply.github.com>
Date:   Mon May 15 22:48:12 2017 -0700

    [ftr/config] allow child config files to have no testFiles config

commit 2bb6c957443b18cebc419baa6f9db301c8f4dc4f
Author: spalger <spalger@users.noreply.github.com>
Date:   Mon May 15 21:52:26 2017 -0700

    [ftr] move screenshots into test/functional
2017-05-17 18:53:45 -07:00