Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into migrate/url-short…
Browse files Browse the repository at this point in the history
…ener
  • Loading branch information
flash1293 committed Dec 4, 2019
2 parents 7cd578b + 7ce0a37 commit a01881f
Show file tree
Hide file tree
Showing 121 changed files with 1,004 additions and 663 deletions.
76 changes: 39 additions & 37 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,45 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
timeout(time: 120, unit: 'MINUTES') {
timestamps {
ansiColor('xterm') {
catchError {
parallel([
'kibana-intake-agent': kibanaPipeline.legacyJobRunner('kibana-intake'),
'x-pack-intake-agent': kibanaPipeline.legacyJobRunner('x-pack-intake'),
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') }),
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
'oss-ciGroup4': kibanaPipeline.getOssCiGroupWorker(4),
'oss-ciGroup5': kibanaPipeline.getOssCiGroupWorker(5),
'oss-ciGroup6': kibanaPipeline.getOssCiGroupWorker(6),
'oss-ciGroup7': kibanaPipeline.getOssCiGroupWorker(7),
'oss-ciGroup8': kibanaPipeline.getOssCiGroupWorker(8),
'oss-ciGroup9': kibanaPipeline.getOssCiGroupWorker(9),
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
'oss-accessibility': kibanaPipeline.getPostBuildWorker('accessibility', { runbld('./test/scripts/jenkins_accessibility.sh', 'Execute kibana-accessibility') }),
// 'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') }),
]),
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') }),
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
'xpack-ciGroup4': kibanaPipeline.getXpackCiGroupWorker(4),
'xpack-ciGroup5': kibanaPipeline.getXpackCiGroupWorker(5),
'xpack-ciGroup6': kibanaPipeline.getXpackCiGroupWorker(6),
'xpack-ciGroup7': kibanaPipeline.getXpackCiGroupWorker(7),
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
'xpack-accessibility': kibanaPipeline.getPostBuildWorker('xpack-accessibility', { runbld('./test/scripts/jenkins_xpack_accessibility.sh', 'Execute xpack-accessibility') }),
// 'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') }),
]),
])
githubPr.withDefaultPrComments {
catchError {
parallel([
'kibana-intake-agent': kibanaPipeline.legacyJobRunner('kibana-intake'),
'x-pack-intake-agent': kibanaPipeline.legacyJobRunner('x-pack-intake'),
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') }),
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
'oss-ciGroup4': kibanaPipeline.getOssCiGroupWorker(4),
'oss-ciGroup5': kibanaPipeline.getOssCiGroupWorker(5),
'oss-ciGroup6': kibanaPipeline.getOssCiGroupWorker(6),
'oss-ciGroup7': kibanaPipeline.getOssCiGroupWorker(7),
'oss-ciGroup8': kibanaPipeline.getOssCiGroupWorker(8),
'oss-ciGroup9': kibanaPipeline.getOssCiGroupWorker(9),
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
'oss-accessibility': kibanaPipeline.getPostBuildWorker('accessibility', { runbld('./test/scripts/jenkins_accessibility.sh', 'Execute kibana-accessibility') }),
// 'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') }),
]),
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') }),
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
'xpack-ciGroup4': kibanaPipeline.getXpackCiGroupWorker(4),
'xpack-ciGroup5': kibanaPipeline.getXpackCiGroupWorker(5),
'xpack-ciGroup6': kibanaPipeline.getXpackCiGroupWorker(6),
'xpack-ciGroup7': kibanaPipeline.getXpackCiGroupWorker(7),
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
'xpack-accessibility': kibanaPipeline.getPostBuildWorker('xpack-accessibility', { runbld('./test/scripts/jenkins_xpack_accessibility.sh', 'Execute xpack-accessibility') }),
// 'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') }),
]),
])
}
}
kibanaPipeline.sendMail()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,13 @@ Wait timed out after 10055ms
</system-out>
<skipped/>
</testcase>
<testcase name="machine learning anomaly detection saved search with lucene query job creation opens the advanced section" classname="Firefox XPack UI Functional Tests.x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job·ts" time="6.040">
<system-out><![CDATA[[00:21:57] └-: machine learning...]]></system-out>
<failure><![CDATA[{ NoSuchSessionError: Tried to run command without establishing a connection
at Object.throwDecodedError (/dev/shm/workspace/kibana/node_modules/selenium-webdriver/lib/error.js:550:15)
at parseHttpResponse (/dev/shm/workspace/kibana/node_modules/selenium-webdriver/lib/http.js:563:13)
at Executor.execute (/dev/shm/workspace/kibana/node_modules/selenium-webdriver/lib/http.js:489:26)
at process._tickCallback (internal/process/next_tick.js:68:7) name: 'NoSuchSessionError', remoteStacktrace: '' }]]></failure>
</testcase>
</testsuite>
</testsuites>
3 changes: 2 additions & 1 deletion packages/kbn-test/src/failed_tests_reporter/get_failures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ const getFailureText = (failure: NonNullable<TestCase['failure']>) => {

const isLikelyIrrelevant = ({ name, failure }: TestFailure) => {
if (
failure.includes('NoSuchSessionError: This driver instance does not have a valid session ID')
failure.includes('NoSuchSessionError: This driver instance does not have a valid session ID') ||
failure.includes('NoSuchSessionError: Tried to run command without establishing a connection')
) {
return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/dev/jest/babel_transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = babelJest.createTransformer({
'@babel/preset-env': {
// disable built-in filtering, which is more performant but strips the import of `regenerator-runtime` required by EUI
useBuiltIns: false,
corejs: false
}
}]
],
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/server/config/__tests__/deprecation_warnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const SETUP_NODE_ENV = require.resolve('../../../../setup_node_env');
const SECOND = 1000;

describe('config/deprecation warnings', function () {
this.timeout(15 * SECOND);
this.timeout(65 * SECOND);

let stdio = '';
let proc = null;
Expand All @@ -53,7 +53,7 @@ describe('config/deprecation warnings', function () {

// Either time out in 60 seconds, or resolve once the line is in our buffer
return Promise.race([
new Promise((resolve) => setTimeout(resolve, 60000)),
new Promise((resolve) => setTimeout(resolve, 60 * SECOND)),
new Promise((resolve, reject) => {
proc.stdout.on('data', (chunk) => {
stdio += chunk.toString('utf8');
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/ui/public/courier/fetch/get_search_params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ export function getSearchParams(config: IUiSettingsClient, esShardTimeout: numbe
};
}

export function getIgnoreThrottled(config: IUiSettingsClient) {
function getIgnoreThrottled(config: IUiSettingsClient) {
return !config.get('search:includeFrozen');
}

export function getMaxConcurrentShardRequests(config: IUiSettingsClient) {
function getMaxConcurrentShardRequests(config: IUiSettingsClient) {
const maxConcurrentShardRequests = config.get('courier:maxConcurrentShardRequests');
return maxConcurrentShardRequests > 0 ? maxConcurrentShardRequests : undefined;
}
Expand Down
33 changes: 28 additions & 5 deletions src/legacy/ui/public/courier/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,31 @@
* under the License.
*/

export * from './fetch';
export * from './search_source';
export * from './search_strategy';
export * from './utils/courier_inspector_utils';
export * from './types';
export { SearchSource } from './search_source';

// TODO: Exporting this mock outside of jest tests causes errors because
// jest is undefined. Need to refactor the mock to be consistent with
// other NP-style mocks.
// export { searchSourceMock } from './search_source/mocks';

export {
addSearchStrategy, // used externally by Rollups
getSearchErrorType, // used externally by Rollups
hasSearchStategyForIndexPattern, // used externally by Discover
isDefaultTypeIndexPattern, // used externally by Discover
SearchError, // used externally by Visualizations & Rollups
} from './search_strategy';

export {
getRequestInspectorStats,
getResponseInspectorStats,
} from './utils/courier_inspector_utils';

// types
export { SearchSourceContract } from './search_source';

export {
EsQuerySortValue, // used externally by Discover
FetchOptions, // used externally by AggTypes
SortDirection, // used externally by Discover
} from './types';
7 changes: 3 additions & 4 deletions src/legacy/ui/public/courier/utils/courier_inspector_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { i18n } from '@kbn/i18n';
import { SearchResponse } from 'elasticsearch';
import { SearchSourceContract, RequestInspectorStats } from '../types';

function getRequestInspectorStats(searchSource: SearchSourceContract) {
export function getRequestInspectorStats(searchSource: SearchSourceContract) {
const stats: RequestInspectorStats = {};
const index = searchSource.getField('index');

Expand Down Expand Up @@ -56,7 +56,8 @@ function getRequestInspectorStats(searchSource: SearchSourceContract) {

return stats;
}
function getResponseInspectorStats(

export function getResponseInspectorStats(
searchSource: SearchSourceContract,
resp: SearchResponse<unknown>
) {
Expand Down Expand Up @@ -121,5 +122,3 @@ function getResponseInspectorStats(

return stats;
}

export { getRequestInspectorStats, getResponseInspectorStats };
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { createFilterAction } from './apply_filter_action';
import { expectError } from '../../tests/helpers';
import { expectErrorAsync } from '../../tests/helpers';

test('has APPLY_FILTER_ACTION type and id', () => {
const action = createFilterAction();
Expand Down Expand Up @@ -95,12 +95,13 @@ describe('execute()', () => {
describe('when no filters are given', () => {
test('throws an error', async () => {
const action = createFilterAction();
const error = expectError(() =>
const error = await expectErrorAsync(() =>
action.execute({
embeddable: getEmbeddable(),
} as any)
);
expect(error).toBeInstanceOf(Error);
expect(error.message).toBe('Applying a filter requires a filter and embeddable as context');
});

test('updates filter input on success', async () => {
Expand Down
18 changes: 17 additions & 1 deletion src/plugins/embeddable/public/tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,27 @@
* under the License.
*/

export const expectError = (fn: (...args: any) => any) => {
export const expectErrorAsync = (fn: (...args: unknown[]) => Promise<unknown>): Promise<Error> => {
return fn()
.then(() => {
throw new Error('Expected an error throw.');
})
.catch(error => {
if (error.message === 'Expected an error throw.') {
throw error;
}
return error;
});
};

export const expectError = (fn: (...args: any) => any): Error => {
try {
fn();
throw new Error('Expected an error throw.');
} catch (error) {
if (error.message === 'Expected an error throw.') {
throw error;
}
return error;
}
};
Expand Down
2 changes: 1 addition & 1 deletion tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = function (grunt) {
!grunt.option('quick') && 'run:typeCheck',
!grunt.option('quick') && 'run:i18nCheck',
'run:checkFileCasing',
'licenses',
'run:licenses',
'test:quick',
])
);
Expand Down
2 changes: 0 additions & 2 deletions test/functional/apps/visualize/_area_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export default function ({ getService, getPageObjects }) {
it('should save and load with special characters', async function () {
const vizNamewithSpecialChars = vizName1 + '/?&=%';
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizNamewithSpecialChars);
await PageObjects.visualize.waitForVisualizationSavedToastGone();
});

it('should save and load with non-ascii characters', async function () {
Expand All @@ -67,7 +66,6 @@ export default function ({ getService, getPageObjects }) {

it('should save and load', async function () {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
await PageObjects.visualize.waitForVisualizationSavedToastGone();
await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.visualize.waitForVisualization();
});
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/visualize/_data_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function ({ getService, getPageObjects }) {

it('should be able to save and load', async function () {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
await PageObjects.visualize.waitForVisualizationSavedToastGone();

await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.visualize.waitForVisualization();
});
Expand Down Expand Up @@ -126,7 +126,7 @@ export default function ({ getService, getPageObjects }) {
// check that it works after a save and reload
const SAVE_NAME = 'viz w/ percents';
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(SAVE_NAME);
await PageObjects.visualize.waitForVisualizationSavedToastGone();

await PageObjects.visualize.loadSavedVisualization(SAVE_NAME);
await PageObjects.visualize.waitForVisualization();

Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_data_table_nontimeindex.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function ({ getService, getPageObjects }) {

it('should be able to save and load', async function () {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
await PageObjects.visualize.waitForVisualizationSavedToastGone();

await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.visualize.waitForVisualization();
});
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_heatmap_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function ({ getService, getPageObjects }) {

it('should save and load', async function () {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
await PageObjects.visualize.waitForVisualizationSavedToastGone();

await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.visualize.waitForVisualization();
});
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_line_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default function ({ getService, getPageObjects }) {

it('should be able to save and load', async function () {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
await PageObjects.visualize.waitForVisualizationSavedToastGone();

await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.visualize.waitForVisualization();
});
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/visualize/_pie_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function ({ getService, getPageObjects }) {

it('should save and load', async function () {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
await PageObjects.visualize.waitForVisualizationSavedToastGone();

await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.visualize.waitForVisualization();
});
Expand Down Expand Up @@ -156,7 +156,7 @@ export default function ({ getService, getPageObjects }) {

it('should correctly save disabled agg', async () => {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
await PageObjects.visualize.waitForVisualizationSavedToastGone();

await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.visualize.waitForRenderingCount();

Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_tag_cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function ({ getService, getPageObjects }) {

it('should save and load', async function () {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
await PageObjects.visualize.waitForVisualizationSavedToastGone();

await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.visualize.waitForVisualization();
});
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_vertical_bar_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function ({ getService, getPageObjects }) {

it('should save and load', async function () {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
await PageObjects.visualize.waitForVisualizationSavedToastGone();

await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.visualize.waitForVisualization();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function ({ getService, getPageObjects }) {

it('should save and load', async function () {
await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb(vizName1);
await PageObjects.visualize.waitForVisualizationSavedToastGone();

await PageObjects.visualize.loadSavedVisualization(vizName1);
await PageObjects.visualize.waitForVisualization();
});
Expand Down
8 changes: 8 additions & 0 deletions test/functional/page_objects/common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,14 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
});
return response.status !== 200;
}
async waitForSaveModalToClose() {
log.debug('Waiting for save modal to close');
await retry.try(async () => {
if (await testSubjects.exists('savedObjectSaveModal')) {
throw new Error('save modal still open');
}
});
}
}

return new CommonPage();
Expand Down
Loading

0 comments on commit a01881f

Please sign in to comment.