Skip to content

Commit

Permalink
Merge branch 'master' into search/add-logs
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Jul 26, 2020
2 parents 26be1ea + 2a82ff9 commit 4311162
Show file tree
Hide file tree
Showing 647 changed files with 13,677 additions and 7,952 deletions.
5 changes: 0 additions & 5 deletions docs/developer/architecture/code-exploration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,6 @@ WARNING: Missing README.
Replaces the legacy ui/share module for registering share context menus.
- {kib-repo}blob/{branch}/src/plugins/status_page[statusPage]
WARNING: Missing README.
- {kib-repo}blob/{branch}/src/plugins/telemetry/README.md[telemetry]
Telemetry allows Kibana features to have usage tracked in the wild. The general term "telemetry" refers to multiple things:
Expand Down
14 changes: 14 additions & 0 deletions docs/maps/trouble-shooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ image::maps/images/inspector.png[]
[float]
=== Solutions to common problems

[float]
==== Index not listed when adding layer

* Verify your geospatial data is correctly mapped as {ref}/geo-point.html[geo_point] or {ref}/geo-shape.html[geo_shape].
** Run `GET myIndexPatternTitle/_field_caps?fields=myGeoFieldName` in <<console-kibana, Console>>, replacing `myIndexPatternTitle` and `myGeoFieldName` with your index pattern title and geospatial field name.
** Ensure response specifies `type` as `geo_point` or `geo_shape`.
* Verify your geospatial data is correctly mapped in your <<managing-fields, Kibana index pattern>>.
** Open your index pattern in <<management, Stack Management>>.
** Ensure your geospatial field type is `geo_point` or `geo_shape`.
** Ensure your geospatial field is searchable and aggregatable.
** If your geospatial field type does not match your Elasticsearch mapping, click the *Refresh* button to refresh the field list from Elasticsearch.
* Index patterns with thousands of fields can exceed the default maximum payload size.
Increase <<settings, `server.maxPayloadBytes`>> for large index patterns.

[float]
==== Features are not displayed

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@
"@types/accept": "3.1.1",
"@types/angular": "^1.6.56",
"@types/angular-mocks": "^1.7.0",
"@types/archiver": "^3.1.0",
"@types/babel__core": "^7.1.2",
"@types/bluebird": "^3.1.1",
"@types/boom": "^7.2.0",
Expand Down Expand Up @@ -398,6 +399,7 @@
"@types/testing-library__react-hooks": "^3.1.0",
"@types/type-detect": "^4.0.1",
"@types/uuid": "^3.4.4",
"@types/vinyl": "^2.0.4",
"@types/vinyl-fs": "^2.4.11",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^2.34.0",
Expand Down Expand Up @@ -474,6 +476,7 @@
"license-checker": "^16.0.0",
"listr": "^0.14.1",
"load-grunt-config": "^3.0.1",
"load-json-file": "^6.2.0",
"mocha": "^7.1.1",
"mock-fs": "^4.12.0",
"mock-http-server": "1.3.0",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"normalize-path": "^3.0.0",
"moment": "^2.24.0",
"rxjs": "^6.5.5",
"strip-ansi": "^6.0.0",
"tree-kill": "^1.2.2",
"tslib": "^2.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-dev-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

export { withProcRunner, ProcRunner } from './proc_runner';
export * from './tooling_log';
export { createAbsolutePathSerializer } from './serializers';
export * from './serializers';
export {
CA_CERT_PATH,
ES_KEY_PATH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { REPO_ROOT } from '../repo_root';

export function createAbsolutePathSerializer(rootPath: string = REPO_ROOT) {
return {
serialize: (value: string) => value.replace(rootPath, '<absolute path>').replace(/\\/g, '/'),
test: (value: any) => typeof value === 'string' && value.startsWith(rootPath),
serialize: (value: string) => value.replace(rootPath, '<absolute path>').replace(/\\/g, '/'),
};
}
25 changes: 25 additions & 0 deletions packages/kbn-dev-utils/src/serializers/any_instance_serizlizer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export function createAnyInstanceSerializer(Class: Function, name?: string) {
return {
test: (v: any) => v instanceof Class,
serialize: () => `<${name ?? Class.name}>`,
};
}
5 changes: 4 additions & 1 deletion packages/kbn-dev-utils/src/serializers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@
* under the License.
*/

export { createAbsolutePathSerializer } from './absolute_path_serializer';
export * from './absolute_path_serializer';
export * from './strip_ansi_serializer';
export * from './recursive_serializer';
export * from './any_instance_serizlizer';
29 changes: 29 additions & 0 deletions packages/kbn-dev-utils/src/serializers/recursive_serializer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export function createRecursiveSerializer(test: (v: any) => boolean, print: (v: any) => string) {
return {
test: (v: any) => test(v),
serialize: (v: any, ...rest: any[]) => {
const replacement = print(v);
const printer = rest.pop()!;
return printer(replacement, ...rest);
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
* under the License.
*/

import { PluginInitializer } from 'kibana/public';
import { StatusPagePlugin, StatusPagePluginSetup, StatusPagePluginStart } from './plugin';
import stripAnsi from 'strip-ansi';

export const plugin: PluginInitializer<StatusPagePluginSetup, StatusPagePluginStart> = () =>
new StatusPagePlugin();
import { createRecursiveSerializer } from './recursive_serializer';

export function createStripAnsiSerializer() {
return createRecursiveSerializer(
(v) => typeof v === 'string' && stripAnsi(v) !== v,
(v) => stripAnsi(v)
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@
* under the License.
*/

export interface ApmOssPlugin {
indexPatterns: string[];
}
export * from './src/index';
1 change: 1 addition & 0 deletions packages/kbn-pm/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": [
"./index.d.ts",
"./src/**/*.ts",
"./dist/*.d.ts",
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Mocha Tests" time="16.198" tests="2" failures="1">
<testsuite name="Root Suite" timestamp="2020-07-22T15:06:26" tests="0" file="cypress/integration/timeline_flyout_button.spec.ts" failures="0" time="0">
</testsuite>
<testsuite name="timeline flyout button" timestamp="2020-07-22T15:06:26" tests="2" failures="1" time="16.198">
<testcase name="timeline flyout button toggles open the timeline" time="8.099" classname="toggles open the timeline">
</testcase>
<testcase name="timeline flyout button &quot;after each&quot; hook for &quot;toggles open the timeline&quot;" time="8.099" classname="&quot;after each&quot; hook for &quot;toggles open the timeline&quot;">
<failure message="Timed out retrying: `cy.click()` could not be issued because this element is currently animating:
`&lt;button class=&quot;euiButtonEmpty euiButtonEmpty--text&quot; type=&quot;button&quot; data-test-subj=&quot;timeline-new&quot;&gt;...&lt;/button&gt;`
You can fix this problem by:
- Passing `{force: true}` which disables all error checking
- Passing `{waitForAnimations: false}` which disables waiting on animations
- Passing `{animationDistanceThreshold: 20}` which decreases the sensitivity
https://on.cypress.io/element-is-animating
Because this error occurred during a `after each` hook we are skipping the remaining tests in the current suite: `timeline flyout button`" type="CypressError"><![CDATA[CypressError: Timed out retrying: `cy.click()` could not be issued because this element is currently animating:
`<button class="euiButtonEmpty euiButtonEmpty--text" type="button" data-test-subj="timeline-new">...</button>`
You can fix this problem by:
- Passing `{force: true}` which disables all error checking
- Passing `{waitForAnimations: false}` which disables waiting on animations
- Passing `{animationDistanceThreshold: 20}` which decreases the sensitivity
https://on.cypress.io/element-is-animating
Because this error occurred during a `after each` hook we are skipping the remaining tests in the current suite: `timeline flyout button`
at cypressErr (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:146621:16)
at cypressErrByPath (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:146630:10)
at Object.throwErrByPath (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:146593:11)
at Object.ensureElementIsNotAnimating (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:137560:24)
at ensureNotAnimating (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:127434:13)
at runAllChecks (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:127522:9)
at retryActionability (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:127542:16)
at tryCatcher (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:9065:23)
at Function.Promise.attempt.Promise.try (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:6339:29)
at tryFn (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:140680:21)
at whenStable (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:140715:12)
at http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:140259:16
at tryCatcher (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:9065:23)
at Promise._settlePromiseFromHandler (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:7000:31)
at Promise._settlePromise (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:7057:18)
at Promise._settlePromise0 (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:7102:10)]]></failure>
</testcase>
</testsuite>
</testsuites>
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ export const FTR_REPORT = Fs.readFileSync(require.resolve('./ftr_report.xml'), '
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');
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ jest.mock('fs', () => {
};
});

import { FTR_REPORT, JEST_REPORT, MOCHA_REPORT, KARMA_REPORT } from './__fixtures__';
import {
FTR_REPORT,
JEST_REPORT,
MOCHA_REPORT,
KARMA_REPORT,
CYPRESS_REPORT,
} from './__fixtures__';
import { parseTestReport } from './test_report';
import { addMessagesToReport } from './add_messages_to_report';

Expand Down Expand Up @@ -270,6 +276,69 @@ it('rewrites mocha reports with minimal changes', async () => {
`);
});

it('rewrites cypress reports with minimal changes', async () => {
const xml = await addMessagesToReport({
messages: [
{
classname: '"after each" hook for "toggles open the timeline"',
name: 'timeline flyout button "after each" hook for "toggles open the timeline"',
message: 'Some extra content\n',
},
],
report: await parseTestReport(CYPRESS_REPORT),
log,
reportPath: Path.resolve(__dirname, './__fixtures__/cypress_report.xml'),
});

expect(createPatch('cypress.xml', CYPRESS_REPORT, xml, { context: 0 })).toMatchInlineSnapshot(`
Index: cypress.xml
===================================================================
--- cypress.xml [object Object]
+++ cypress.xml
@@ -1,25 +1,16 @@
-‹?xml version="1.0" encoding="UTF-8"?›
+‹?xml version="1.0" encoding="utf-8"?›
‹testsuites name="Mocha Tests" time="16.198" tests="2" failures="1"›
- ‹testsuite name="Root Suite" timestamp="2020-07-22T15:06:26" tests="0" file="cypress/integration/timeline_flyout_button.spec.ts" failures="0" time="0"›
- ‹/testsuite›
+ ‹testsuite name="Root Suite" timestamp="2020-07-22T15:06:26" tests="0" file="cypress/integration/timeline_flyout_button.spec.ts" failures="0" time="0"/›
‹testsuite name="timeline flyout button" timestamp="2020-07-22T15:06:26" tests="2" failures="1" time="16.198"›
- ‹testcase name="timeline flyout button toggles open the timeline" time="8.099" classname="toggles open the timeline"›
- ‹/testcase›
+ ‹testcase name="timeline flyout button toggles open the timeline" time="8.099" classname="toggles open the timeline"/›
‹testcase name="timeline flyout button &quot;after each&quot; hook for &quot;toggles open the timeline&quot;" time="8.099" classname="&quot;after each&quot; hook for &quot;toggles open the timeline&quot;"›
- ‹failure message="Timed out retrying: \`cy.click()\` could not be issued because this element is currently animating:
+ ‹failure message="Timed out retrying: \`cy.click()\` could not be issued because this element is currently animating:&#xA;&#xA;\`&lt;button class=&quot;euiButtonEmpty euiButtonEmpty--text&quot; type=&quot;button&quot; data-test-subj=&quot;timeline-new&quot;›...&lt;/button›\`&#xA;&#xA;You can fix this problem by:&#xA; - Passing \`{force: true}\` which disables all error checking&#xA; - Passing \`{waitForAnimations: false}\` which disables waiting on animations&#xA; - Passing \`{animationDistanceThreshold: 20}\` which decreases the sensitivity&#xA;&#xA;https://on.cypress.io/element-is-animating&#xA;&#xA;Because this error occurred during a \`after each\` hook we are skipping the remaining tests in the current suite: \`timeline flyout button\`" type="CypressError"›‹![CDATA[Failed Tests Reporter:
+ - Some extra content
-\`&lt;button class=&quot;euiButtonEmpty euiButtonEmpty--text&quot; type=&quot;button&quot; data-test-subj=&quot;timeline-new&quot;&gt;...&lt;/button&gt;\`
-You can fix this problem by:
- - Passing \`{force: true}\` which disables all error checking
- - Passing \`{waitForAnimations: false}\` which disables waiting on animations
- - Passing \`{animationDistanceThreshold: 20}\` which decreases the sensitivity
+CypressError: Timed out retrying: \`cy.click()\` could not be issued because this element is currently animating:
-https://on.cypress.io/element-is-animating
-
-Because this error occurred during a \`after each\` hook we are skipping the remaining tests in the current suite: \`timeline flyout button\`" type="CypressError"›‹![CDATA[CypressError: Timed out retrying: \`cy.click()\` could not be issued because this element is currently animating:
-
\`‹button class="euiButtonEmpty euiButtonEmpty--text" type="button" data-test-subj="timeline-new"›...‹/button›\`
You can fix this problem by:
- Passing \`{force: true}\` which disables all error checking
@@ -46,5 +37,5 @@
at Promise._settlePromise (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:7057:18)
at Promise._settlePromise0 (http://elastic:changeme@localhost:61141/__cypress/runner/cypress_runner.js:7102:10)]]›‹/failure›
‹/testcase›
‹/testsuite›
-‹/testsuites›
+‹/testsuites›
\\ No newline at end of file
`);
});

it('rewrites karma reports with minimal changes', async () => {
const xml = await addMessagesToReport({
report: await parseTestReport(KARMA_REPORT),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ export async function addMessagesToReport(options: {
log.info(`${classname} - ${name}:${messageList}`);
const output = `Failed Tests Reporter:${messageList}\n\n`;

if (!testCase['system-out']) {
testCase['system-out'] = [output];
if (typeof testCase.failure[0] === 'object' && testCase.failure[0].$.message) {
// failure with "messages" ignore the system-out on jenkins
// so we instead extend the failure message
testCase.failure[0]._ = output + testCase.failure[0]._;
} else if (!testCase['system-out']) {
testCase['system-out'] = [{ _: output }];
} else if (typeof testCase['system-out'][0] === 'string') {
testCase['system-out'][0] = output + String(testCase['system-out'][0]);
testCase['system-out'][0] = { _: output + testCase['system-out'][0] };
} else {
testCase['system-out'][0]._ = output + testCase['system-out'][0]._;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export function runFailedTestsReporterCli() {
}

const patterns = flags._.length ? flags._ : DEFAULT_PATTERNS;
log.info('Searching for reports at', patterns);
const reportPaths = await globby(patterns, {
absolute: true,
});
Expand All @@ -80,6 +81,7 @@ export function runFailedTestsReporterCli() {
throw createFailError(`Unable to find any junit reports with patterns [${patterns}]`);
}

log.info('found', reportPaths.length, 'junit reports', reportPaths);
const newlyCreatedIssues: Array<{
failure: TestFailure;
newIssue: GithubIssueMini;
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/src/failed_tests_reporter/test_report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export interface TestCase {
}

export interface FailedTestCase extends TestCase {
failure: Array<string | { _: string }>;
failure: Array<string | { $: { message?: string }; _: string }>;
}

/**
Expand Down
7 changes: 3 additions & 4 deletions src/cli/serve/read_keystore.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
* under the License.
*/

import path from 'path';
import { set } from '@elastic/safer-lodash-set';

import { Keystore } from '../../legacy/server/keystore';
import { getDataPath } from '../../core/server/path';
import { getKeystore } from '../../cli_keystore/get_keystore';

export function readKeystore(dataPath = getDataPath()) {
const keystore = new Keystore(path.join(dataPath, 'kibana.keystore'));
export function readKeystore(keystorePath = getKeystore()) {
const keystore = new Keystore(keystorePath);
keystore.load();

const keys = Object.keys(keystore.data);
Expand Down
Loading

0 comments on commit 4311162

Please sign in to comment.