Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into watcher-port
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Apr 24, 2019
2 parents 96ee395 + 539bc6f commit 6b17a37
Show file tree
Hide file tree
Showing 2,496 changed files with 161,781 additions and 32,737 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
insert_final_newline = false

[*.{md,asciidoc}]
trim_trailing_whitespace = false
insert_final_newline = false
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ bower_components
/packages/*/target
/packages/eslint-config-kibana
/packages/kbn-es-query/src/kuery/ast/kuery.js
/packages/kbn-es-query/src/kuery/ast/legacy_kuery.js
/packages/kbn-pm/dist
/packages/kbn-plugin-generator/sao_template/template
/packages/kbn-ui-framework/dist
Expand All @@ -33,5 +32,8 @@ bower_components
/packages/kbn-interpreter/src/common/lib/grammar.js
/x-pack/plugins/canvas/canvas_plugin
/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts
/x-pack/plugins/infra/common/graphql/types.ts
/x-pack/plugins/infra/public/graphql/types.ts
/x-pack/plugins/infra/server/graphql/types.ts
**/*.js.snap
!/.eslintrc.js
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ module.exports = {
plugins: ['prettier'],
rules: Object.assign(
{
'prettier/prettier': ['error'],
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
},
require('eslint-config-prettier').rules,
require('eslint-config-prettier/react').rules
Expand Down
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
# Canvas
/x-pack/plugins/canvas/ @elastic/kibana-canvas

# Code
/x-pack/plugins/code/ @teams/code
/x-pack/test/functional/apps/code/ @teams/code
/x-pack/test/api_integration/apis/code/ @teams/code

# Machine Learning
/x-pack/plugins/ml/ @elastic/ml-ui

Expand All @@ -36,3 +41,6 @@
/x-pack/plugins/rollup/ @elastic/es-ui
/x-pack/plugins/searchprofiler/ @elastic/es-ui
/x-pack/plugins/watcher/ @elastic/es-ui

# Kibana TSVB external contractors
/src/legacy/core_plugins/metrics/ @elastic/kibana-tsvb-external
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"timelion": "src/legacy/core_plugins/timelion",
"tagCloud": "src/legacy/core_plugins/tagcloud",
"tsvb": "src/legacy/core_plugins/metrics",
"kbnESQuery": "packages/kbn-es-query",
"xpack.apm": "x-pack/plugins/apm",
"xpack.beatsManagement": "x-pack/plugins/beats_management",
"xpack.crossClusterReplication": "x-pack/plugins/cross_cluster_replication",
Expand Down
43 changes: 30 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,19 +327,36 @@ macOS users on a machine with a discrete graphics card may see significant speed
`yarn debug` will start the server with Node's inspect flag. Kibana's development mode will start three processes on ports `9229`, `9230`, and `9231`. Chrome's developer tools need to be configured to connect to all three connections. Add `localhost:<port>` for each Kibana process in Chrome's developer tools connection tab.

### Unit testing frameworks
Kibana is migrating unit testing from Mocha to Jest. Legacy unit tests still exist in Mocha but all new unit tests should be written in Jest.

#### Mocha (legacy)
Mocha tests are contained in `__tests__` directories.

#### Jest
Jest tests are stored in the same directory as source code files with the `.test.js` suffix.

### Running Jest Unit Tests

```bash
node scripts/jest
```
Kibana is migrating unit testing from Mocha to Jest. Legacy unit tests still
exist in Mocha but all new unit tests should be written in Jest. Mocha tests
are contained in `__tests__` directories. Whereas Jest tests are stored in
the same directory as source code files with the `.test.js` suffix.

### Running specific Kibana tests

The following table outlines possible test file locations and how to invoke them:

| Test runner | Test location | Runner command (working directory is kibana root) |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| Jest | `src/**/*.test.js`<br>`src/**/*.test.ts` | `node scripts/jest -t regexp [test path]` |
| Jest (integration) | `**/integration_tests/**/*.test.js` | `node scripts/jest_integration -t regexp [test path]` |
| Mocha | `src/**/__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]` |
| Functional | `test/*integration/**/config.js`<br>`test/*functional/**/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` |

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

Test runner arguments:
- Where applicable, the optional arguments `-t=regexp` or `--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 with yarn:
`node scripts/jest src/core/server/elasticsearch/elasticsearch_service.test.ts`
- Run the jest test case whose description matches 'stops both admin and data clients':
`node scripts/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:
`node scripts/functional_tests_server --config test/api_integration/config.js`
`node scripts/functional_tests_runner --config test/api_integration/config.js --grep='should return 404 if id does not match any sample data sets'`

### Debugging Unit Tests

Expand Down
26 changes: 26 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,32 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

---
This product includes code that is based on facebookincubator/idx, which was
available under a "MIT" license.

MIT License

Copyright (c) 2013-present, Facebook, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---
This product includes code that is based on flot-charts, which was available
under a "MIT" license.
Expand Down
2 changes: 2 additions & 0 deletions docs/api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ NOTE: You cannot access these APIs via the Console in Kibana.

[float]
== APIs
* <<features-api>>
* <<spaces-api>>
* <<role-management-api>>
* <<saved-objects-api>>
Expand All @@ -37,6 +38,7 @@ NOTE: You cannot access these APIs via the Console in Kibana.
* <<upgrade-assistant-api>>
--

include::api/features.asciidoc[]
include::api/spaces-management.asciidoc[]
include::api/role-management.asciidoc[]
include::api/saved-objects.asciidoc[]
Expand Down
13 changes: 13 additions & 0 deletions docs/api/features.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[role="xpack"]
[[features-api]]
== Features API

experimental[This API is *experimental* and may be changed or removed completely in a future release.]

The features API allows you to view information about available features in {kib}. Features are used by spaces and security to refine and secure access to {kib}.

NOTE: You cannot access these endpoints via the Console in {kib}.

* <<features-api-get>>

include::features/get.asciidoc[]
Loading

0 comments on commit 6b17a37

Please sign in to comment.