Skip to content

Commit befdcc9

Browse files
Merge branch '7.x' into backport/7.x/pr-58070
2 parents 5a6f83f + 64215c5 commit befdcc9

File tree

387 files changed

+5466
-10359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

387 files changed

+5466
-10359
lines changed

CONTRIBUTING.md

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,11 @@ The following table outlines possible test file locations and how to invoke them
458458

459459
| Test runner | Test location | Runner command (working directory is kibana root) |
460460
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
461-
| Jest | `src/**/*.test.js`<br>`src/**/*.test.ts` | `node scripts/jest -t regexp [test path]` |
462-
| Jest (integration) | `**/integration_tests/**/*.test.js` | `node scripts/jest_integration -t regexp [test path]` |
461+
| Jest | `src/**/*.test.js`<br>`src/**/*.test.ts` | `yarn test:jest -t regexp [test path]` |
462+
| Jest (integration) | `**/integration_tests/**/*.test.js` | `yarn test:jest_integration -t regexp [test path]` |
463463
| Mocha | `src/**/__tests__/**/*.js`<br>`!src/**/public/__tests__/*.js`<br>`packages/kbn-datemath/test/**/*.js`<br>`packages/kbn-dev-utils/src/**/__tests__/**/*.js`<br>`tasks/**/__tests__/**/*.js` | `node scripts/mocha --grep=regexp [test path]` |
464-
| Functional | `test/*integration/**/config.js`<br>`test/*functional/**/config.js`<br>`test/accessibility/config.js` | `node scripts/functional_tests_server --config test/[directory]/config.js`<br>`node scripts/functional_test_runner --config test/[directory]/config.js --grep=regexp` |
465-
| Karma | `src/**/public/__tests__/*.js` | `npm run test:dev` |
464+
| Functional | `test/*integration/**/config.js`<br>`test/*functional/**/config.js`<br>`test/accessibility/config.js` | `yarn test:ftr:server --config test/[directory]/config.js`<br>`yarn test:ftr:runner --config test/[directory]/config.js --grep=regexp` |
465+
| Karma | `src/**/public/__tests__/*.js` | `yarn test:karma:debug` |
466466

467467
For X-Pack tests located in `x-pack/` see [X-Pack Testing](x-pack/README.md#testing)
468468

@@ -473,56 +473,38 @@ Test runner arguments:
473473
Examples:
474474
- Run the entire elasticsearch_service test suite:
475475
```
476-
node scripts/jest src/core/server/elasticsearch/elasticsearch_service.test.ts
476+
yarn test:jest src/core/server/elasticsearch/elasticsearch_service.test.ts
477477
```
478478
- Run the jest test case whose description matches `stops both admin and data clients`:
479479
```
480-
node scripts/jest -t 'stops both admin and data clients' src/core/server/elasticsearch/elasticsearch_service.test.ts
480+
yarn test:jest -t 'stops both admin and data clients' src/core/server/elasticsearch/elasticsearch_service.test.ts
481481
```
482482
- Run the api integration test case whose description matches the given string:
483483
```
484-
node scripts/functional_tests_server --config test/api_integration/config.js
485-
node scripts/functional_test_runner --config test/api_integration/config.js --grep='should return 404 if id does not match any sample data sets'
484+
yarn test:ftr:server --config test/api_integration/config.js
485+
yarn test:ftr:runner --config test/api_integration/config.js --grep='should return 404 if id does not match any sample data sets'
486486
```
487487
488488
### Debugging Unit Tests
489489
490490
The standard `yarn test` task runs several sub tasks and can take several minutes to complete, making debugging failures pretty painful. In order to ease the pain specialized tasks provide alternate methods for running the tests.
491491
492-
To execute both server and browser tests, but skip linting, use `yarn test:quick`.
493-
494-
```bash
495-
yarn test:quick
496-
```
497-
498-
Use `yarn test:mocha` when you want to run the mocha tests.
499-
500-
```bash
501-
yarn test:mocha
502-
```
503-
504-
When you'd like to execute individual server-side test files, you can use the command below. Note that this command takes care of configuring Mocha with Babel compilation for you, and you'll be better off avoiding a globally installed `mocha` package. This command is great for development and for quickly identifying bugs.
505-
506-
```bash
507-
node scripts/mocha <file>
508-
```
509-
510492
You could also add the `--debug` option so that `node` is run using the `--debug-brk` flag. You'll need to connect a remote debugger such as [`node-inspector`](https://github.com/node-inspector/node-inspector) to proceed in this mode.
511493
512494
```bash
513495
node scripts/mocha --debug <file>
514496
```
515497

516-
With `yarn test:browser`, you can run only the browser tests. Coverage reports are available for browser tests by running `yarn test:coverage`. You can find the results under the `coverage/` directory that will be created upon completion.
498+
With `yarn test:karma`, you can run only the browser tests. Coverage reports are available for browser tests by running `yarn test:coverage`. You can find the results under the `coverage/` directory that will be created upon completion.
517499

518500
```bash
519-
yarn test:browser
501+
yarn test:karma
520502
```
521503

522-
Using `yarn test:dev` initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests.
504+
Using `yarn test:karma:debug` initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests.
523505

524506
```bash
525-
yarn test:dev
507+
yarn test:karma:debug
526508
```
527509

528510
In the screenshot below, you'll notice the URL is `localhost:9876/debug.html`. You can append a `grep` query parameter to this URL and set it to a string value which will be used to exclude tests which don't match. For example, if you changed the URL to `localhost:9876/debug.html?query=my test` and then refreshed the browser, you'd only see tests run which contain "my test" in the test description.
@@ -538,7 +520,7 @@ To run the tests for just your particular plugin run the following command from
538520

539521
```bash
540522
yarn test:mocha
541-
yarn test:browser --dev # remove the --dev flag to run them once and close
523+
yarn test:karma:debug # remove the debug flag to run them once and close
542524
```
543525

544526
### Automated Accessibility Testing

docs/development/core/public/kibana-plugin-public.simplesavedobject._constructor_.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Constructs a new instance of the `SimpleSavedObject` class
99
<b>Signature:</b>
1010

1111
```typescript
12-
constructor(client: SavedObjectsClient, { id, type, version, attributes, error, references, migrationVersion }: SavedObjectType<T>);
12+
constructor(client: SavedObjectsClientContract, { id, type, version, attributes, error, references, migrationVersion }: SavedObjectType<T>);
1313
```
1414

1515
## Parameters
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
19-
| client | <code>SavedObjectsClient</code> | |
19+
| client | <code>SavedObjectsClientContract</code> | |
2020
| { id, type, version, attributes, error, references, migrationVersion } | <code>SavedObjectType&lt;T&gt;</code> | |
2121

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [(constructor)](./kibana-plugin-server.elasticsearchconfig._constructor_.md)
4+
5+
## ElasticsearchConfig.(constructor)
6+
7+
Constructs a new instance of the `ElasticsearchConfig` class
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
constructor(rawConfig: ElasticsearchConfigType);
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| rawConfig | <code>ElasticsearchConfigType</code> | |
20+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [apiVersion](./kibana-plugin-server.elasticsearchconfig.apiversion.md)
4+
5+
## ElasticsearchConfig.apiVersion property
6+
7+
Version of the Elasticsearch (6.7, 7.1 or `master`<!-- -->) client will be connecting to.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly apiVersion: string;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [customHeaders](./kibana-plugin-server.elasticsearchconfig.customheaders.md)
4+
5+
## ElasticsearchConfig.customHeaders property
6+
7+
Header names and values to send to Elasticsearch with every request. These headers cannot be overwritten by client-side headers and aren't affected by `requestHeadersWhitelist` configuration.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly customHeaders: ElasticsearchConfigType['customHeaders'];
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [healthCheckDelay](./kibana-plugin-server.elasticsearchconfig.healthcheckdelay.md)
4+
5+
## ElasticsearchConfig.healthCheckDelay property
6+
7+
The interval between health check requests Kibana sends to the Elasticsearch.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly healthCheckDelay: Duration;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [hosts](./kibana-plugin-server.elasticsearchconfig.hosts.md)
4+
5+
## ElasticsearchConfig.hosts property
6+
7+
Hosts that the client will connect to. If sniffing is enabled, this list will be used as seeds to discover the rest of your cluster.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly hosts: string[];
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [ignoreVersionMismatch](./kibana-plugin-server.elasticsearchconfig.ignoreversionmismatch.md)
4+
5+
## ElasticsearchConfig.ignoreVersionMismatch property
6+
7+
Whether to allow kibana to connect to a non-compatible elasticsearch node.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly ignoreVersionMismatch: boolean;
13+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md) &gt; [logQueries](./kibana-plugin-server.elasticsearchconfig.logqueries.md)
4+
5+
## ElasticsearchConfig.logQueries property
6+
7+
Specifies whether all queries to the client should be logged (status code, method, query etc.).
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly logQueries: boolean;
13+
```
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-server.elasticsearchconfig.md)
4+
5+
## ElasticsearchConfig class
6+
7+
Wrapper of config schema.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export declare class ElasticsearchConfig
13+
```
14+
15+
## Constructors
16+
17+
| Constructor | Modifiers | Description |
18+
| --- | --- | --- |
19+
| [(constructor)(rawConfig)](./kibana-plugin-server.elasticsearchconfig._constructor_.md) | | Constructs a new instance of the <code>ElasticsearchConfig</code> class |
20+
21+
## Properties
22+
23+
| Property | Modifiers | Type | Description |
24+
| --- | --- | --- | --- |
25+
| [apiVersion](./kibana-plugin-server.elasticsearchconfig.apiversion.md) | | <code>string</code> | Version of the Elasticsearch (6.7, 7.1 or <code>master</code>) client will be connecting to. |
26+
| [customHeaders](./kibana-plugin-server.elasticsearchconfig.customheaders.md) | | <code>ElasticsearchConfigType['customHeaders']</code> | Header names and values to send to Elasticsearch with every request. These headers cannot be overwritten by client-side headers and aren't affected by <code>requestHeadersWhitelist</code> configuration. |
27+
| [healthCheckDelay](./kibana-plugin-server.elasticsearchconfig.healthcheckdelay.md) | | <code>Duration</code> | The interval between health check requests Kibana sends to the Elasticsearch. |
28+
| [hosts](./kibana-plugin-server.elasticsearchconfig.hosts.md) | | <code>string[]</code> | Hosts that the client will connect to. If sniffing is enabled, this list will be used as seeds to discover the rest of your cluster. |
29+
| [ignoreVersionMismatch](./kibana-plugin-server.elasticsearchconfig.ignoreversionmismatch.md) | | <code>boolean</code> | Whether to allow kibana to connect to a non-compatible elasticsearch node. |
30+
| [logQueries](./kibana-plugin-server.elasticsearchconfig.logqueries.md) | | <code>boolean</code> | Specifies whether all queries to the client should be logged (status code, method, query etc.). |
31+
| [password](./kibana-plugin-server.elasticsearchconfig.password.md) | | <code>string</code> | If Elasticsearch is protected with basic authentication, this setting provides the password that the Kibana server uses to perform its administrative functions. |
32+
| [pingTimeout](./kibana-plugin-server.elasticsearchconfig.pingtimeout.md) | | <code>Duration</code> | Timeout after which PING HTTP request will be aborted and retried. |
33+
| [requestHeadersWhitelist](./kibana-plugin-server.elasticsearchconfig.requestheaderswhitelist.md) | | <code>string[]</code> | List of Kibana client-side headers to send to Elasticsearch when request scoped cluster client is used. If this is an empty array then \*no\* client-side will be sent. |
34+
| [requestTimeout](./kibana-plugin-server.elasticsearchconfig.requesttimeout.md) | | <code>Duration</code> | Timeout after which HTTP request will be aborted and retried. |
35+
| [shardTimeout](./kibana-plugin-server.elasticsearchconfig.shardtimeout.md) | | <code>Duration</code> | Timeout for Elasticsearch to wait for responses from shards. Set to 0 to disable. |
36+
| [sniffInterval](./kibana-plugin-server.elasticsearchconfig.sniffinterval.md) | | <code>false &#124; Duration</code> | Interval to perform a sniff operation and make sure the list of nodes is complete. If <code>false</code> then sniffing is disabled. |
37+
| [sniffOnConnectionFault](./kibana-plugin-server.elasticsearchconfig.sniffonconnectionfault.md) | | <code>boolean</code> | Specifies whether the client should immediately sniff for a more current list of nodes when a connection dies. |
38+
| [sniffOnStart](./kibana-plugin-server.elasticsearchconfig.sniffonstart.md) | | <code>boolean</code> | Specifies whether the client should attempt to detect the rest of the cluster when it is first instantiated. |
39+
| [ssl](./kibana-plugin-server.elasticsearchconfig.ssl.md) | | <code>Pick&lt;SslConfigSchema, Exclude&lt;keyof SslConfigSchema, 'certificateAuthorities' &#124; 'keystore' &#124; 'truststore'&gt;&gt; &amp; {</code><br/><code> certificateAuthorities?: string[];</code><br/><code> }</code> | Set of settings configure SSL connection between Kibana and Elasticsearch that are required when <code>xpack.ssl.verification_mode</code> in Elasticsearch is set to either <code>certificate</code> or <code>full</code>. |
40+
| [username](./kibana-plugin-server.elasticsearchconfig.username.md) | | <code>string</code> | If Elasticsearch is protected with basic authentication, this setting provides the username that the Kibana server uses to perform its administrative functions. |
41+

0 commit comments

Comments
 (0)