Skip to content

Commit

Permalink
Merge branch 'master' into snapshot_policies_links
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jul 28, 2020
2 parents 8b6449a + 1c791f3 commit 35b6799
Show file tree
Hide file tree
Showing 532 changed files with 8,220 additions and 7,792 deletions.
21 changes: 12 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,19 +771,22 @@ module.exports = {
},

/**
* APM overrides
* APM and Observability overrides
*/
{
files: ['x-pack/plugins/apm/**/*.js'],
files: [
'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}',
],
rules: {
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-console': ['warn', { allow: ['error'] }],
},
},
{
plugins: ['react-hooks'],
files: ['x-pack/plugins/apm/**/*.{ts,tsx}'],
rules: {
'react/function-component-definition': [
'warn',
{
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
},
],
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': ['error', { additionalHooks: '^useFetcher$' }],
},
Expand Down
6 changes: 5 additions & 1 deletion docs/developer/advanced/running-elasticsearch.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ This will run a snapshot of {es} that is usually built nightly. Read more about
----
yarn es snapshot
----
By default, two users are added to Elasticsearch:

- A superuser with username: `elastic` and password: `changeme`, which can be used to log into Kibana with.
- A user with username: `kibana_system` and password `changeme`. This account is used by the Kibana server to authenticate itself to Elasticsearch, and to perform certain actions on behalf of the end user. These credentials should be specified in your kibana.yml as described in <<using-kibana-with-security>>

See all available options, like how to specify a specific license, with the `--help` flag.

Expand Down Expand Up @@ -115,4 +119,4 @@ PUT _cluster/settings
}
----

Follow the cross-cluster search instructions for setting up index patterns to search across clusters (<<management-cross-cluster-search>>).
Follow the cross-cluster search instructions for setting up index patterns to search across clusters (<<management-cross-cluster-search>>).
4 changes: 2 additions & 2 deletions docs/developer/architecture/code-exploration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,9 @@ WARNING: Missing README.
See Configuring security in Kibana.
- {kib-repo}blob/{branch}/x-pack/plugins/security_solution[securitySolution]
- {kib-repo}blob/{branch}/x-pack/plugins/security_solution/README.md[securitySolution]
WARNING: Missing README.
Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing.
- {kib-repo}blob/{branch}/x-pack/plugins/snapshot_restore/README.md[snapshotRestore]
Expand Down
2 changes: 0 additions & 2 deletions docs/developer/contributing/development-tests.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ root)
|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`

|Karma |`src/**/public/__tests__/*.js` |`yarn test:karma:debug`
|===

For X-Pack tests located in `x-pack/` see
Expand Down
33 changes: 0 additions & 33 deletions docs/developer/contributing/development-unit-tests.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,38 +95,6 @@ to proceed in this mode.
node scripts/mocha --debug <file>
----

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.

[source,bash]
----
yarn test:karma
----

Using `yarn test:karma:debug` initializes an environment for debugging
the browser tests. Includes an dedicated instance of the {kib} 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.

[source,bash]
----
yarn test:karma:debug
----

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.

image:http://i.imgur.com/DwHxgfq.png[Browser test debugging]

[discrete]
=== Unit Testing Plugins

Expand All @@ -141,5 +109,4 @@ command from your plugin:
[source,bash]
----
yarn test:mocha
yarn test:karma:debug # remove the debug flag to run them once and close
----
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ esFilters: {
convertRangeFilterToTimeRangeString: typeof convertRangeFilterToTimeRangeString;
mapAndFlattenFilters: (filters: import("../common").Filter[]) => import("../common").Filter[];
extractTimeFilter: typeof extractTimeFilter;
extractTimeRange: typeof extractTimeRange;
}
```
13 changes: 1 addition & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
"kbn": "node scripts/kbn",
"es": "node scripts/es",
"test": "grunt test",
"test:karma": "grunt test:karma",
"test:karma:debug": "grunt test:karmaDebug",
"test:jest": "node scripts/jest",
"test:jest_integration": "node scripts/jest_integration",
"test:mocha": "node scripts/mocha",
Expand Down Expand Up @@ -435,7 +433,7 @@
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-react-hooks": "^4.0.4",
"eslint-plugin-react-perf": "^3.2.3",
"exit-hook": "^2.2.0",
Expand All @@ -447,7 +445,6 @@
"grunt-available-tasks": "^0.6.3",
"grunt-cli": "^1.2.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-karma": "^3.0.2",
"grunt-peg": "^2.0.1",
"grunt-run": "0.8.1",
"gulp-babel": "^8.0.0",
Expand All @@ -465,14 +462,6 @@
"jest-raw-loader": "^1.0.1",
"jimp": "^0.9.6",
"json5": "^1.0.1",
"karma": "5.0.2",
"karma-chrome-launcher": "2.2.0",
"karma-coverage": "1.1.2",
"karma-firefox-launcher": "1.1.0",
"karma-ie-launcher": "1.0.0",
"karma-junit-reporter": "1.2.0",
"karma-mocha": "2.0.0",
"karma-safari-launcher": "1.0.0",
"license-checker": "^16.0.0",
"listr": "^0.14.1",
"load-grunt-config": "^3.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@ exports.getWebpackConfig = function (kibanaPath, projectRoot, config) {
const alias = {
// Kibana defaults https://github.com/elastic/kibana/blob/6998f074542e8c7b32955db159d15661aca253d7/src/legacy/ui/ui_bundler_env.js#L30-L36
ui: fromKibana('src/legacy/ui/public'),
test_harness: fromKibana('src/test_harness/public'),

// Dev defaults for test bundle https://github.com/elastic/kibana/blob/6998f074542e8c7b32955db159d15661aca253d7/src/core_plugins/tests_bundle/index.js#L73-L78
ng_mock$: fromKibana('src/test_utils/public/ng_mock'),
'angular-mocks$': fromKibana(
'src/legacy/core_plugins/tests_bundle/webpackShims/angular-mocks.js'
),
fixtures: fromKibana('src/fixtures'),
test_utils: fromKibana('src/test_utils/public'),
};
Expand Down
4 changes: 0 additions & 4 deletions packages/kbn-plugin-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ Generated plugins receive a handful of scripts that can be used during developme
Build a distributable archive of your plugin.
- `yarn test:karma`
Run the browser tests in a real web browser.
- `yarn test:mocha`
Run the server tests using mocha.
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-plugin-helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ $ plugin-helpers help
start Start kibana and have it include this plugin
build [options] [files...] Build a distributable archive
test Run the server and browser tests
test:karma [options] Run the browser tests in a real web browser
test:mocha [files...] Run the server tests using mocha

Options:
Expand Down
19 changes: 0 additions & 19 deletions packages/kbn-plugin-helpers/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,6 @@ program
}))
);

program
.command('test')
.description('Run the server and browser tests')
.on('--help', docs('test/all'))
.action(createCommanderAction('testAll'));

program
.command('test:karma')
.description('Run the browser tests in a real web browser')
.option('--dev', 'Enable dev mode, keeps the test server running')
.option('-p, --plugins <plugin-ids>', "Manually specify which plugins' test bundles to run")
.on('--help', docs('test/karma'))
.action(
createCommanderAction('testKarma', (command) => ({
dev: Boolean(command.dev),
plugins: command.plugins,
}))
);

program
.command('test:mocha [files...]')
.description('Run the server tests using mocha')
Expand Down
6 changes: 0 additions & 6 deletions packages/kbn-plugin-helpers/src/lib/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,17 @@

import { buildTask } from '../tasks/build';
import { startTask } from '../tasks/start';
import { testAllTask } from '../tasks/test/all';
import { testKarmaTask } from '../tasks/test/karma';
import { testMochaTask } from '../tasks/test/mocha';

// define a tasks interface that we can extend in the tests
export interface Tasks {
build: typeof buildTask;
start: typeof startTask;
testAll: typeof testAllTask;
testKarma: typeof testKarmaTask;
testMocha: typeof testMochaTask;
}

export const tasks: Tasks = {
build: buildTask,
start: startTask,
testAll: testAllTask,
testKarma: testKarmaTask,
testMocha: testMochaTask,
};
3 changes: 0 additions & 3 deletions packages/kbn-plugin-helpers/src/tasks/test/all/README.md

This file was deleted.

60 changes: 0 additions & 60 deletions packages/kbn-plugin-helpers/src/tasks/test/karma/README.md

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions packages/kbn-spec-to-console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ At the root of the Kibana repository, run the following commands:

```sh
# OSS
yarn spec_to_console -g "<ELASTICSEARCH-REPO-FOLDER>/rest-api-spec/src/main/resources/rest-api-spec/api/*" -d "src/plugins/console/server/lib/spec_definitions/json"
yarn spec_to_console -g "<ELASTICSEARCH-REPO-FOLDER>/rest-api-spec/src/main/resources/rest-api-spec/api/*" -d "src/plugins/console/server/lib/spec_definitions/json/generated"

# X-pack
yarn spec_to_console -g "<ELASTICSEARCH-REPO-FOLDER>/x-pack/plugin/src/test/resources/rest-api-spec/api/*" -d "x-pack/plugins/console_extensions/server/lib/spec_definitions/json"
yarn spec_to_console -g "<ELASTICSEARCH-REPO-FOLDER>/x-pack/plugin/src/test/resources/rest-api-spec/api/*" -d "x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated"
```

### Information used in Console that is not available in the REST spec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ const Fs = jest.requireActual('fs');

export const FTR_REPORT = Fs.readFileSync(require.resolve('./ftr_report.xml'), 'utf8');
export const JEST_REPORT = Fs.readFileSync(require.resolve('./jest_report.xml'), 'utf8');
export const KARMA_REPORT = Fs.readFileSync(require.resolve('./karma_report.xml'), 'utf8');
export const MOCHA_REPORT = Fs.readFileSync(require.resolve('./mocha_report.xml'), 'utf8');
export const CYPRESS_REPORT = Fs.readFileSync(require.resolve('./cypress_report.xml'), 'utf8');
Loading

0 comments on commit 35b6799

Please sign in to comment.