Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into task/EMT-617-blan…
Browse files Browse the repository at this point in the history
…k-ingest-package-config-name
  • Loading branch information
paul-tavares committed Jul 23, 2020
2 parents 39b065c + cb48e6e commit a62cf8e
Show file tree
Hide file tree
Showing 148 changed files with 2,736 additions and 496 deletions.
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
22 changes: 0 additions & 22 deletions src/legacy/core_plugins/apm_oss/index.d.ts

This file was deleted.

60 changes: 0 additions & 60 deletions src/legacy/core_plugins/apm_oss/index.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/core_plugins/apm_oss/package.json

This file was deleted.

2 changes: 0 additions & 2 deletions src/legacy/server/kbn_server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import {
import { LegacyConfig, ILegacyService, ILegacyInternals } from '../../core/server/legacy';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { UiPlugins } from '../../core/server/plugins';
import { ApmOssPlugin } from '../core_plugins/apm_oss';
import { CallClusterWithRequest, ElasticsearchPlugin } from '../core_plugins/elasticsearch';
import { UsageCollectionSetup } from '../../plugins/usage_collection/server';
import { UiSettingsServiceFactoryOptions } from '../../legacy/ui/ui_settings/ui_settings_service_factory';
Expand All @@ -62,7 +61,6 @@ declare module 'hapi' {
elasticsearch: ElasticsearchPlugin;
kibana: any;
spaces: any;
apm_oss: ApmOssPlugin;
// add new plugin types here
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function LinkedSearch({ savedSearch, eventEmitter }: LinkedSearchProps) {
}, [eventEmitter]);
const onClickViewInDiscover = useCallback(() => {
application.navigateToApp('discover', {
path: `#/${savedSearch.id}`,
path: `#/view/${savedSearch.id}`,
});
}, [application, savedSearch.id]);

Expand Down Expand Up @@ -128,7 +128,12 @@ export function LinkedSearch({ savedSearch, eventEmitter }: LinkedSearchProps) {
<div style={{ width: 260 }}>
<EuiText size="s">
<p>
<EuiButtonEmpty flush="left" onClick={onClickViewInDiscover} size="xs">
<EuiButtonEmpty
data-test-subj="viewSavedSearch"
flush="left"
onClick={onClickViewInDiscover}
size="xs"
>
<FormattedMessage
id="visDefaultEditor.sidebar.savedSearch.goToDiscoverButtonText"
defaultMessage="View this search in Discover"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export const VisualizeEditor = () => {
isEmbeddableRendered={isEmbeddableRendered}
hasUnappliedChanges={hasUnappliedChanges}
originatingApp={originatingApp}
setOriginatingApp={setOriginatingApp}
savedVisInstance={savedVisInstance}
stateContainer={appState}
visualizationIdFromUrl={visualizationIdFromUrl}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ interface VisualizeTopNavProps {
setHasUnsavedChanges: (value: boolean) => void;
hasUnappliedChanges: boolean;
originatingApp?: string;
setOriginatingApp?: (originatingApp: string | undefined) => void;
savedVisInstance: SavedVisInstance;
stateContainer: VisualizeAppStateContainer;
visualizationIdFromUrl?: string;
Expand All @@ -53,6 +54,7 @@ const TopNav = ({
setHasUnsavedChanges,
hasUnappliedChanges,
originatingApp,
setOriginatingApp,
savedVisInstance,
stateContainer,
visualizationIdFromUrl,
Expand Down Expand Up @@ -86,6 +88,7 @@ const TopNav = ({
hasUnappliedChanges,
openInspector,
originatingApp,
setOriginatingApp,
savedVisInstance,
stateContainer,
visualizationIdFromUrl,
Expand All @@ -100,6 +103,7 @@ const TopNav = ({
hasUnappliedChanges,
openInspector,
originatingApp,
setOriginatingApp,
savedVisInstance,
stateContainer,
visualizationIdFromUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ interface TopNavConfigParams {
setHasUnsavedChanges: (value: boolean) => void;
openInspector: () => void;
originatingApp?: string;
setOriginatingApp?: (originatingApp: string | undefined) => void;
hasUnappliedChanges: boolean;
savedVisInstance: SavedVisInstance;
stateContainer: VisualizeAppStateContainer;
Expand All @@ -51,6 +52,7 @@ export const getTopNavConfig = (
setHasUnsavedChanges,
openInspector,
originatingApp,
setOriginatingApp,
hasUnappliedChanges,
savedVisInstance: { embeddableHandler, savedVis, vis },
stateContainer,
Expand Down Expand Up @@ -112,6 +114,9 @@ export const getTopNavConfig = (
application.navigateToApp(originatingApp);
}
} else {
if (setOriginatingApp && originatingApp && savedVis.copyOnSave) {
setOriginatingApp(undefined);
}
chrome.docTitle.change(savedVis.lastSavedTitle);
chrome.setBreadcrumbs(getEditBreadcrumbs(savedVis.lastSavedTitle));

Expand Down
12 changes: 12 additions & 0 deletions test/functional/apps/dashboard/edit_embeddable_redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,17 @@ export default function ({ getService, getPageObjects }) {
const titles = await PageObjects.dashboard.getPanelTitles();
expect(titles.indexOf(newTitle)).to.not.be(-1);
});

it('loses originatingApp connection after save as when redirectToOrigin is false', async () => {
const newTitle = 'wowee, my title just got cooler again';
await PageObjects.header.waitUntilLoadingHasFinished();
await dashboardPanelActions.openContextMenu();
await dashboardPanelActions.clickEdit();
await PageObjects.visualize.saveVisualizationExpectSuccess(newTitle, {
saveAsNew: true,
redirectToOrigin: false,
});
await PageObjects.visualize.notLinkedToOriginatingApp();
});
});
}
Loading

0 comments on commit a62cf8e

Please sign in to comment.