Skip to content

Commit 3facd94

Browse files
Merge branch 'master' into fix/disabled_agg_error
2 parents daf9376 + 20638a6 commit 3facd94

File tree

983 files changed

+32468
-7685
lines changed

Some content is hidden

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

983 files changed

+32468
-7685
lines changed

.ci/teamcity/default/jest.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@ source "$(dirname "${0}")/../util.sh"
66

77
export JOB=kibana-default-jest
88

9-
cd "$XPACK_DIR"
10-
119
checks-reporter-with-killswitch "Jest Unit Tests" \
12-
node scripts/jest --bail --debug
10+
node scripts/jest x-pack --ci --verbose --maxWorkers=5

.ci/teamcity/oss/jest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ source "$(dirname "${0}")/../util.sh"
77
export JOB=kibana-oss-jest
88

99
checks-reporter-with-killswitch "OSS Jest Unit Tests" \
10-
node scripts/jest --ci --verbose
10+
node scripts/jest --config jest.config.oss.js --ci --verbose --maxWorkers=5

.ci/teamcity/oss/jest_integration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ source "$(dirname "${0}")/../util.sh"
77
export JOB=kibana-oss-jest-integration
88

99
checks-reporter-with-killswitch "OSS Jest Integration Tests" \
10-
node scripts/jest_integration --verbose
10+
node scripts/jest_integration --ci --verbose

docs/developer/contributing/development-functional-tests.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We use functional tests to make sure the {kib} UI works as expected. It replaces
66
[discrete]
77
=== Running functional tests
88

9-
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]. If you’re writing a plugin outside the {kib} repo, you will have your own config file.
9+
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.
1010
See <<external-plugin-functional-tests>> for more info.
1111

1212
There are three ways to run the tests depending on your goals:
Lines changed: 62 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[[development-tests]]
22
== Testing
33

4-
To ensure that your changes will not break other functionality, please run the test suite and build (<<building-kibana>>) before submitting your Pull Request.
5-
64
[discrete]
75
=== Running specific {kib} tests
86

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

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

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

2624
|Functional
27-
|`test/*integration/**/config.js` `test/*functional/**/config.js` `test/accessibility/config.js`
28-
|`yarn test:ftr:server --config test/[directory]/config.js``yarn test:ftr:runner --config test/[directory]/config.js --grep=regexp`
25+
|`test/**/config.js` `x-pack/test/**/config.js`
26+
|`node scripts/functional_tests_server --config [directory]/config.js``node scripts/functional_test_runner_ --config [directory]/config.js --grep=regexp`
2927
|===
3028

31-
For X-Pack tests located in `x-pack/` see
32-
link:{kib-repo}tree/{branch}/x-pack/README.md#testing[X-Pack Testing]
33-
3429
Test runner arguments: - Where applicable, the optional arguments
35-
`-t=regexp` or `--grep=regexp` will only run tests or test suites
30+
`--grep=regexp` will only run tests or test suites
3631
whose descriptions matches the regular expression. - `[test path]` is
3732
the relative path to the test file.
3833

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

48-
[discrete]
49-
=== Cross-browser compatibility
36+
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.
5037

51-
**Testing IE on OS X**
38+
[source,bash]
39+
----
40+
yarn jest --config src/plugins/dashboard/jest.config.js
41+
----
5242

53-
**Note:** IE11 is not supported from 7.9 onwards.
43+
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.
44+
45+
[source,bash]
46+
----
47+
kibana/src/plugins/dashboard/server$ yarn test:jest #or
48+
kibana/src/plugins/dashboard$ yarn test:jest server #or
49+
kibana$ yarn test:jest src/plugins/dashboard/server
50+
----
51+
52+
Any additional options supplied to `test:jest` will be passed onto the Jest CLI with the resulting Jest command always being outputted.
53+
54+
[source,bash]
55+
----
56+
kibana/src/plugins/dashboard/server$ yarn test:jest --coverage
57+
58+
# is equivelant to
59+
60+
yarn jest --coverage --verbose --config /home/tyler/elastic/kibana/src/plugins/dashboard/jest.config.js server
61+
----
62+
63+
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.
5464

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

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

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

96-
include::development-accessibility-tests.asciidoc[leveloffset=+1]
88+
include::development-accessibility-tests.asciidoc[leveloffset=+1]
89+
90+
[discrete]
91+
=== Cross-browser compatibility
92+
93+
**Testing IE on OS X**
94+
95+
**Note:** IE11 is not supported from 7.9 onwards.
96+
97+
* http://www.vmware.com/products/fusion/fusion-evaluation.html[Download
98+
VMWare Fusion].
99+
* https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/#downloads[Download
100+
IE virtual machines] for VMWare.
101+
* Open VMWare and go to Window > Virtual Machine Library. Unzip the
102+
virtual machine and drag the .vmx file into your Virtual Machine
103+
Library.
104+
* Right-click on the virtual machine you just added to your library and
105+
select "`Snapshots…`", and then click the "`Take`" button in the modal
106+
that opens. You can roll back to this snapshot when the VM expires in 90
107+
days.
108+
* In System Preferences > Sharing, change your computer name to be
109+
something simple, e.g. "`computer`".
110+
* Run {kib} with `yarn start --host=computer.local` (substituting
111+
your computer name).
112+
* Now you can run your VM, open the browser, and navigate to
113+
`http://computer.local:5601` to test {kib}.
114+
* Alternatively you can use browserstack
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [AppLeaveConfirmAction](./kibana-plugin-core-public.appleaveconfirmaction.md) &gt; [callback](./kibana-plugin-core-public.appleaveconfirmaction.callback.md)
4+
5+
## AppLeaveConfirmAction.callback property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
callback?: () => void;
11+
```

docs/development/core/public/kibana-plugin-core-public.appleaveconfirmaction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface AppLeaveConfirmAction
1818

1919
| Property | Type | Description |
2020
| --- | --- | --- |
21+
| [callback](./kibana-plugin-core-public.appleaveconfirmaction.callback.md) | <code>() =&gt; void</code> | |
2122
| [text](./kibana-plugin-core-public.appleaveconfirmaction.text.md) | <code>string</code> | |
2223
| [title](./kibana-plugin-core-public.appleaveconfirmaction.title.md) | <code>string</code> | |
2324
| [type](./kibana-plugin-core-public.appleaveconfirmaction.type.md) | <code>AppLeaveActionType.confirm</code> | |

docs/development/core/public/kibana-plugin-core-public.appleavehandler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ See [AppMountParameters](./kibana-plugin-core-public.appmountparameters.md) for
1111
<b>Signature:</b>
1212

1313
```typescript
14-
export declare type AppLeaveHandler = (factory: AppLeaveActionFactory) => AppLeaveAction;
14+
export declare type AppLeaveHandler = (factory: AppLeaveActionFactory, nextAppId?: string) => AppLeaveAction;
1515
```

docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,7 @@ readonly links: {
101101
readonly dateMath: string;
102102
};
103103
readonly management: Record<string, string>;
104-
readonly ml: {
105-
readonly guide: string;
106-
readonly anomalyDetection: string;
107-
readonly anomalyDetectionJobs: string;
108-
readonly dataFrameAnalytics: string;
109-
};
104+
readonly ml: Record<string, string>;
110105
readonly visualize: Record<string, string>;
111106
};
112107
```

0 commit comments

Comments
 (0)