Skip to content

Commit

Permalink
Merge branch 'master' into fix/84058
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Dec 15, 2020
2 parents 6ca7d39 + 335cd1f commit c2de162
Show file tree
Hide file tree
Showing 2,789 changed files with 127,578 additions and 485,190 deletions.
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: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,5 @@ snapshots.js
/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/
/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/
/packages/kbn-ui-framework/dist
/packages/kbn-ui-framework/doc_site/build
/packages/kbn-ui-framework/generator-kui/*/templates/
/packages/kbn-ui-shared-deps/flot_charts
/packages/kbn-monaco/src/painless/antlr
31 changes: 1 addition & 30 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ module.exports = {
/**
* Temporarily disable some react rules for specific plugins, remove in separate PRs
*/
{
files: ['packages/kbn-ui-framework/**/*.{js,mjs,ts,tsx}'],
rules: {
'jsx-a11y/no-onchange': 'off',
},
},
{
files: ['src/plugins/kibana_react/**/*.{js,mjs,ts,tsx}'],
rules: {
Expand Down Expand Up @@ -413,7 +407,6 @@ module.exports = {
{
files: [
'**/public/**/*.js',
'packages/kbn-ui-framework/doc_site/src/**/*.js',
'src/fixtures/**/*.js', // TODO: this directory needs to be more obviously "public" (or go away)
],
settings: {
Expand All @@ -436,11 +429,7 @@ module.exports = {
* Files that ARE NOT allowed to use devDependencies
*/
{
files: [
'packages/kbn-ui-framework/**/*.js',
'x-pack/**/*.js',
'packages/kbn-interpreter/**/*.js',
],
files: ['x-pack/**/*.js', 'packages/kbn-interpreter/**/*.js'],
rules: {
'import/no-extraneous-dependencies': [
'error',
Expand All @@ -458,10 +447,6 @@ module.exports = {
*/
{
files: [
'packages/kbn-ui-framework/**/*.test.js',
'packages/kbn-ui-framework/doc_site/**/*.js',
'packages/kbn-ui-framework/generator-kui/**/*.js',
'packages/kbn-ui-framework/Gruntfile.js',
'packages/kbn-es/src/**/*.js',
'packages/kbn-interpreter/tasks/**/*.js',
'packages/kbn-interpreter/src/plugin/**/*.js',
Expand Down Expand Up @@ -1073,20 +1058,6 @@ module.exports = {
},
},

/**
* disable jsx-a11y for kbn-ui-framework
*/
{
files: ['packages/kbn-ui-framework/**/*.js'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/anchor-has-content': 'off',
'jsx-a11y/tabindex-no-positive': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/aria-role': 'off',
},
},

/**
* Canvas overrides
*/
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ selenium
*.swp
*.swo
*.out
/packages/kbn-ui-framework/doc_site/build/*
!/packages/kbn-ui-framework/doc_site/build/index.html
package-lock.json
.yo-rc.json
.vscode
Expand Down
7 changes: 7 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Security Policy

Thanks for your interest in the security of our products.
Our security policy can be found at [https://www.elastic.co/community/security](https://www.elastic.co/community/security).

## Reporting a Vulnerability
Please send security vulnerability reports to security@elastic.co.
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 {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.
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
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[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)

## AppLeaveConfirmAction.callback property

<b>Signature:</b>

```typescript
callback?: () => void;
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface AppLeaveConfirmAction

| Property | Type | Description |
| --- | --- | --- |
| [callback](./kibana-plugin-core-public.appleaveconfirmaction.callback.md) | <code>() =&gt; void</code> | |
| [text](./kibana-plugin-core-public.appleaveconfirmaction.text.md) | <code>string</code> | |
| [title](./kibana-plugin-core-public.appleaveconfirmaction.title.md) | <code>string</code> | |
| [type](./kibana-plugin-core-public.appleaveconfirmaction.type.md) | <code>AppLeaveActionType.confirm</code> | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ See [AppMountParameters](./kibana-plugin-core-public.appmountparameters.md) for
<b>Signature:</b>

```typescript
export declare type AppLeaveHandler = (factory: AppLeaveActionFactory) => AppLeaveAction;
export declare type AppLeaveHandler = (factory: AppLeaveActionFactory, nextAppId?: string) => AppLeaveAction;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeHelpExtensionLinkBase](./kibana-plugin-core-public.chromehelpextensionlinkbase.md)

## ChromeHelpExtensionLinkBase type


<b>Signature:</b>

```typescript
export declare type ChromeHelpExtensionLinkBase = Pick<EuiButtonEmptyProps, 'iconType' | 'target' | 'rel' | 'data-test-subj'>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeHelpExtensionMenuCustomLink](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.md) &gt; [content](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.content.md)

## ChromeHelpExtensionMenuCustomLink.content property

Content of the button (in lieu of `children`<!-- -->)

<b>Signature:</b>

```typescript
content: React.ReactNode;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeHelpExtensionMenuCustomLink](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.md) &gt; [href](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.href.md)

## ChromeHelpExtensionMenuCustomLink.href property

URL of the link

<b>Signature:</b>

```typescript
href: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeHelpExtensionMenuCustomLink](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.md) &gt; [linkType](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.linktype.md)

## ChromeHelpExtensionMenuCustomLink.linkType property

Extend EuiButtonEmpty to provide extra functionality

<b>Signature:</b>

```typescript
linkType: 'custom';
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeHelpExtensionMenuCustomLink](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.md)

## ChromeHelpExtensionMenuCustomLink type
## ChromeHelpExtensionMenuCustomLink interface


<b>Signature:</b>

```typescript
export declare type ChromeHelpExtensionMenuCustomLink = EuiButtonEmptyProps & {
linkType: 'custom';
content: React.ReactNode;
};
export interface ChromeHelpExtensionMenuCustomLink extends ChromeHelpExtensionLinkBase
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [content](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.content.md) | <code>React.ReactNode</code> | Content of the button (in lieu of <code>children</code>) |
| [href](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.href.md) | <code>string</code> | URL of the link |
| [linkType](./kibana-plugin-core-public.chromehelpextensionmenucustomlink.linktype.md) | <code>'custom'</code> | Extend EuiButtonEmpty to provide extra functionality |
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeHelpExtensionMenuDiscussLink](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.md) &gt; [href](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.href.md)

## ChromeHelpExtensionMenuDiscussLink.href property

URL to discuss page. i.e. `https://discuss.elastic.co/c/${appName}`

<b>Signature:</b>

```typescript
href: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ChromeHelpExtensionMenuDiscussLink](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.md) &gt; [linkType](./kibana-plugin-core-public.chromehelpextensionmenudiscusslink.linktype.md)

## ChromeHelpExtensionMenuDiscussLink.linkType property

Creates a generic give feedback link with comment icon

<b>Signature:</b>

```typescript
linkType: 'discuss';
```
Loading

0 comments on commit c2de162

Please sign in to comment.