Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-85774
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Dec 17, 2020
2 parents bad74bc + 9e1c76f commit 26899bf
Show file tree
Hide file tree
Showing 1,476 changed files with 45,239 additions and 17,060 deletions.
3 changes: 2 additions & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"targetBranchChoices": [
{ "name": "master", "checked": true },
{ "name": "7.x", "checked": true },
"7.11",
"7.10",
"7.9",
"7.8",
Expand All @@ -28,7 +29,7 @@
"targetPRLabels": ["backport"],
"branchLabelMapping": {
"^v8.0.0$": "master",
"^v7.11.0$": "7.x",
"^v7.12.0$": "7.x",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
}
}
4 changes: 1 addition & 3 deletions .ci/teamcity/default/jest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ source "$(dirname "${0}")/../util.sh"

export JOB=kibana-default-jest

cd "$XPACK_DIR"

checks-reporter-with-killswitch "Jest Unit Tests" \
node scripts/jest --bail --debug
node scripts/jest x-pack --ci --verbose --maxWorkers=5
2 changes: 1 addition & 1 deletion .ci/teamcity/oss/jest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ source "$(dirname "${0}")/../util.sh"
export JOB=kibana-oss-jest

checks-reporter-with-killswitch "OSS Jest Unit Tests" \
node scripts/jest --ci --verbose
node scripts/jest --config jest.config.oss.js --ci --verbose --maxWorkers=5
2 changes: 1 addition & 1 deletion .ci/teamcity/oss/jest_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ source "$(dirname "${0}")/../util.sh"
export JOB=kibana-oss-jest-integration

checks-reporter-with-killswitch "OSS Jest Integration Tests" \
node scripts/jest_integration --verbose
node scripts/jest_integration --ci --verbose
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.15.1
14.15.2
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.15.1
14.15.2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We use functional tests to make sure the {kib} UI works as expected. It replaces
[discrete]
=== Running functional tests

The `FunctionalTestRunner` is very bare bones and gets most of its functionality from its config file, located at link:{kib-repo}tree/{branch}/test/functional/config.js[test/functional/config.js]. If you’re writing a plugin outside the {kib} repo, you will have your own config file.
The `FunctionalTestRunner` is very bare bones and gets most of its functionality from its config file, located at {blob}test/functional/config.js[test/functional/config.js] or {blob}x-pack/test/functional/config.js[x-pack/test/functional/config.js]. If you’re writing a plugin outside the {kib} repo, you will have your own config file.
See <<external-plugin-functional-tests>> for more info.

There are three ways to run the tests depending on your goals:
Expand Down
106 changes: 62 additions & 44 deletions docs/developer/contributing/development-tests.asciidoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[[development-tests]]
== Testing

To ensure that your changes will not break other functionality, please run the test suite and build (<<building-kibana>>) before submitting your Pull Request.

[discrete]
=== Running specific {kib} tests

Expand All @@ -13,63 +11,57 @@ invoke them:
|===
|Test runner |Test location |Runner command (working directory is {kib}
root)
|Jest |`src/**/*.test.js` `src/**/*.test.ts`
|`yarn test:jest -t regexp [test path]`
|Jest |`**/*.test.{js,mjs,ts,tsx}`
|`yarn test:jest [test path]`

|Jest (integration) |`**/integration_tests/**/*.test.js`
|`yarn test:jest_integration -t regexp [test path]`
|Jest (integration) |`**/integration_tests/**/*.test.{js,mjs,ts,tsx}`
|`yarn test:jest_integration [test path]`

|Mocha
|`src/**/__tests__/**/*.js` `!src/**/public/__tests__/*.js` `packages/kbn-dev-utils/src/**/__tests__/**/*.js` `tasks/**/__tests__/**/*.js`
|`**/__tests__/**/*.js`
|`node scripts/mocha --grep=regexp [test path]`

|Functional
|`test/*integration/**/config.js` `test/*functional/**/config.js` `test/accessibility/config.js`
|`yarn test:ftr:server --config test/[directory]/config.js``yarn test:ftr:runner --config test/[directory]/config.js --grep=regexp`
|`test/**/config.js` `x-pack/test/**/config.js`
|`node scripts/functional_tests_server --config [directory]/config.js``node scripts/functional_test_runner_ --config [directory]/config.js --grep=regexp`
|===

For X-Pack tests located in `x-pack/` see
link:{kib-repo}tree/{branch}/x-pack/README.md#testing[X-Pack Testing]

Test runner arguments: - Where applicable, the optional arguments
`-t=regexp` or `--grep=regexp` will only run tests or test suites
`--grep=regexp` will only run tests or test suites
whose descriptions matches the regular expression. - `[test path]` is
the relative path to the test file.

Examples: - Run the entire elasticsearch_service test suite:
`yarn test:jest src/core/server/elasticsearch/elasticsearch_service.test.ts`
- Run the jest test case whose description matches
`stops both admin and data clients`:
`yarn test:jest -t 'stops both admin and data clients' src/core/server/elasticsearch/elasticsearch_service.test.ts`
- Run the api integration test case whose description matches the given
string: ``` yarn test:ftr:server –config test/api_integration/config.js
yarn test:ftr:runner –config test/api_integration/config
=== Unit Testing

[discrete]
=== Cross-browser compatibility
Kibana primarily uses Jest for unit testing. Each plugin or package defines a `jest.config.js` that extends link:{kib-repo}tree/{branch}/packages/kbn-test/jest-preset.js[a preset] provided by the link:{kib-repo}tree/{branch}/packages/kbn-test[`@kbn/test`] package. Unless you intend to run all unit tests within the project, it's most efficient to provide the Jest configuration file for the plugin or package you're testing.

**Testing IE on OS X**
[source,bash]
----
yarn jest --config src/plugins/dashboard/jest.config.js
----

**Note:** IE11 is not supported from 7.9 onwards.
A script is available to provide a better user experience when testing while navigating throughout the repository. To run the tests within your current working directory, use `yarn test:jest`. Like the Jest CLI, you can also supply a path to determine which tests to run.

[source,bash]
----
kibana/src/plugins/dashboard/server$ yarn test:jest #or
kibana/src/plugins/dashboard$ yarn test:jest server #or
kibana$ yarn test:jest src/plugins/dashboard/server
----

Any additional options supplied to `test:jest` will be passed onto the Jest CLI with the resulting Jest command always being outputted.

[source,bash]
----
kibana/src/plugins/dashboard/server$ yarn test:jest --coverage
# is equivelant to
yarn jest --coverage --verbose --config /home/tyler/elastic/kibana/src/plugins/dashboard/jest.config.js server
----

NOTE: There are still a handful of legacy tests that use the Mocha test runner. For those tests, use `node scripts/mocha --grep=regexp [test path]`. Tests using Mocha are located within `__tests__` directories.

* http://www.vmware.com/products/fusion/fusion-evaluation.html[Download
VMWare Fusion].
* https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/#downloads[Download
IE virtual machines] for VMWare.
* Open VMWare and go to Window > Virtual Machine Library. Unzip the
virtual machine and drag the .vmx file into your Virtual Machine
Library.
* Right-click on the virtual machine you just added to your library and
select "`Snapshots…`", and then click the "`Take`" button in the modal
that opens. You can roll back to this snapshot when the VM expires in 90
days.
* In System Preferences > Sharing, change your computer name to be
something simple, e.g. "`computer`".
* Run {kib} with `yarn start --host=computer.local` (substituting
your computer name).
* Now you can run your VM, open the browser, and navigate to
`http://computer.local:5601` to test {kib}.
* Alternatively you can use browserstack

[discrete]
=== Running browser automation tests
Expand All @@ -93,4 +85,30 @@ include::development-functional-tests.asciidoc[leveloffset=+1]

include::development-unit-tests.asciidoc[leveloffset=+1]

include::development-accessibility-tests.asciidoc[leveloffset=+1]
include::development-accessibility-tests.asciidoc[leveloffset=+1]

[discrete]
=== Cross-browser compatibility

**Testing IE on OS X**

**Note:** IE11 is not supported from 7.9 onwards.

* http://www.vmware.com/products/fusion/fusion-evaluation.html[Download
VMWare Fusion].
* https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/#downloads[Download
IE virtual machines] for VMWare.
* Open VMWare and go to Window > Virtual Machine Library. Unzip the
virtual machine and drag the .vmx file into your Virtual Machine
Library.
* Right-click on the virtual machine you just added to your library and
select "`Snapshots…`", and then click the "`Take`" button in the modal
that opens. You can roll back to this snapshot when the VM expires in 90
days.
* In System Preferences > Sharing, change your computer name to be
something simple, e.g. "`computer`".
* Run {kib} with `yarn start --host=computer.local` (substituting
your computer name).
* Now you can run your VM, open the browser, and navigate to
`http://computer.local:5601` to test {kib}.
* Alternatively you can use browserstack
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,8 @@ readonly links: {
readonly dateMath: string;
};
readonly management: Record<string, string>;
readonly ml: {
readonly guide: string;
readonly anomalyDetection: string;
readonly anomalyDetectionJobs: string;
readonly dataFrameAnalytics: string;
};
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export interface DocLinksStart
| --- | --- | --- |
| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | <code>string</code> | |
| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | <code>string</code> | |
| [links](./kibana-plugin-core-public.doclinksstart.links.md) | <code>{</code><br/><code> readonly dashboard: {</code><br/><code> readonly guide: string;</code><br/><code> readonly drilldowns: string;</code><br/><code> readonly drilldownsTriggerPicker: string;</code><br/><code> readonly urlDrilldownTemplateSyntax: string;</code><br/><code> readonly urlDrilldownVariables: string;</code><br/><code> };</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly loadingData: string;</code><br/><code> readonly introduction: string;</code><br/><code> };</code><br/><code> readonly addData: string;</code><br/><code> readonly kibana: string;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly eql: string;</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> };</code><br/><code> readonly management: Record&lt;string, string&gt;;</code><br/><code> readonly ml: {</code><br/><code> readonly guide: string;</code><br/><code> readonly anomalyDetection: string;</code><br/><code> readonly anomalyDetectionJobs: string;</code><br/><code> readonly dataFrameAnalytics: string;</code><br/><code> };</code><br/><code> readonly visualize: Record&lt;string, string&gt;;</code><br/><code> }</code> | |
| [links](./kibana-plugin-core-public.doclinksstart.links.md) | <code>{</code><br/><code> readonly dashboard: {</code><br/><code> readonly guide: string;</code><br/><code> readonly drilldowns: string;</code><br/><code> readonly drilldownsTriggerPicker: string;</code><br/><code> readonly urlDrilldownTemplateSyntax: string;</code><br/><code> readonly urlDrilldownVariables: string;</code><br/><code> };</code><br/><code> readonly filebeat: {</code><br/><code> readonly base: string;</code><br/><code> readonly installation: string;</code><br/><code> readonly configuration: string;</code><br/><code> readonly elasticsearchOutput: string;</code><br/><code> readonly startup: string;</code><br/><code> readonly exportedFields: string;</code><br/><code> };</code><br/><code> readonly auditbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly metricbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly heartbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly logstash: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly functionbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly winlogbeat: {</code><br/><code> readonly base: string;</code><br/><code> };</code><br/><code> readonly aggs: {</code><br/><code> readonly date_histogram: string;</code><br/><code> readonly date_range: string;</code><br/><code> readonly filter: string;</code><br/><code> readonly filters: string;</code><br/><code> readonly geohash_grid: string;</code><br/><code> readonly histogram: string;</code><br/><code> readonly ip_range: string;</code><br/><code> readonly range: string;</code><br/><code> readonly significant_terms: string;</code><br/><code> readonly terms: string;</code><br/><code> readonly avg: string;</code><br/><code> readonly avg_bucket: string;</code><br/><code> readonly max_bucket: string;</code><br/><code> readonly min_bucket: string;</code><br/><code> readonly sum_bucket: string;</code><br/><code> readonly cardinality: string;</code><br/><code> readonly count: string;</code><br/><code> readonly cumulative_sum: string;</code><br/><code> readonly derivative: string;</code><br/><code> readonly geo_bounds: string;</code><br/><code> readonly geo_centroid: string;</code><br/><code> readonly max: string;</code><br/><code> readonly median: string;</code><br/><code> readonly min: string;</code><br/><code> readonly moving_avg: string;</code><br/><code> readonly percentile_ranks: string;</code><br/><code> readonly serial_diff: string;</code><br/><code> readonly std_dev: string;</code><br/><code> readonly sum: string;</code><br/><code> readonly top_hits: string;</code><br/><code> };</code><br/><code> readonly scriptedFields: {</code><br/><code> readonly scriptFields: string;</code><br/><code> readonly scriptAggs: string;</code><br/><code> readonly painless: string;</code><br/><code> readonly painlessApi: string;</code><br/><code> readonly painlessSyntax: string;</code><br/><code> readonly luceneExpressions: string;</code><br/><code> };</code><br/><code> readonly indexPatterns: {</code><br/><code> readonly loadingData: string;</code><br/><code> readonly introduction: string;</code><br/><code> };</code><br/><code> readonly addData: string;</code><br/><code> readonly kibana: string;</code><br/><code> readonly siem: {</code><br/><code> readonly guide: string;</code><br/><code> readonly gettingStarted: string;</code><br/><code> };</code><br/><code> readonly query: {</code><br/><code> readonly eql: string;</code><br/><code> readonly luceneQuerySyntax: string;</code><br/><code> readonly queryDsl: string;</code><br/><code> readonly kueryQuerySyntax: string;</code><br/><code> };</code><br/><code> readonly date: {</code><br/><code> readonly dateMath: string;</code><br/><code> };</code><br/><code> readonly management: Record&lt;string, string&gt;;</code><br/><code> readonly ml: Record&lt;string, string&gt;;</code><br/><code> readonly transforms: Record&lt;string, string&gt;;</code><br/><code> readonly visualize: Record&lt;string, string&gt;;</code><br/><code> }</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [FieldFormat](./kibana-plugin-plugins-data-public.fieldformat.md) &gt; [allowsNumericalAggregations](./kibana-plugin-plugins-data-public.fieldformat.allowsnumericalaggregations.md)

## FieldFormat.allowsNumericalAggregations property

<b>Signature:</b>

```typescript
allowsNumericalAggregations?: boolean;
```
Loading

0 comments on commit 26899bf

Please sign in to comment.