diff --git a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_start.tsx b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_start.tsx index c92a251974a94..40664a1413845 100644 --- a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_start.tsx +++ b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_start.tsx @@ -54,6 +54,7 @@ export const StartAction: FC = ({ item }) => { iconType="play" onClick={openModal} aria-label={buttonStartText} + data-test-sub="mlAnalyticsJobStartButton" > {buttonStartText} diff --git a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/actions.tsx b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/actions.tsx index 5e5283f9e6c49..8781e49b95ca3 100644 --- a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/actions.tsx +++ b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/actions.tsx @@ -37,6 +37,7 @@ export const AnalyticsViewAction = { aria-label={i18n.translate('xpack.ml.dataframe.analyticsList.viewAriaLabel', { defaultMessage: 'View', })} + data-test-sub="mlAnalyticsJobViewButton" > {i18n.translate('xpack.ml.dataframe.analyticsList.viewActionName', { defaultMessage: 'View', @@ -69,6 +70,7 @@ export const getActions = () => { iconType="stop" onClick={() => stopAnalytics(item)} aria-label={buttonStopText} + data-test-sub="mlAnalyticsJobStopButton" > {buttonStopText} diff --git a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx index b8a914b5e96b5..412779513e533 100644 --- a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx +++ b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/analytics_list.tsx @@ -232,6 +232,7 @@ export const DataFrameAnalyticsList: FC = ({ {i18n.translate('xpack.ml.dataFrame.analyticsList.emptyPromptButtonText', { defaultMessage: 'Create your first data frame analytics job', @@ -352,23 +353,28 @@ export const DataFrameAnalyticsList: FC = ({ - +
+ ({ + 'data-test-subj': `mlAnalyticsTableRow row-${item.id}`, + })} + /> +
); }; diff --git a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/columns.tsx b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/columns.tsx index 3a23eeb1138be..66a2452bfdf96 100644 --- a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/columns.tsx +++ b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/columns.tsx @@ -82,7 +82,13 @@ export const progressColumn = { {isBatchTransform && ( - + {progress}% @@ -110,6 +116,7 @@ export const progressColumn = { ); }, width: '100px', + 'data-test-subj': 'mlAnalyticsTableColumnProgress', }; export const getColumns = ( @@ -155,12 +162,14 @@ export const getColumns = ( iconType={expandedRowItemIds.includes(item.config.id) ? 'arrowUp' : 'arrowDown'} /> ), + 'data-test-subj': 'mlAnalyticsTableRowDetailsToggle', }, { field: DataFrameAnalyticsListColumn.id, name: 'ID', sortable: true, truncateText: true, + 'data-test-subj': 'mlAnalyticsTableColumnId', }, // Description is not supported yet by API /* @@ -180,6 +189,7 @@ export const getColumns = ( }), sortable: true, truncateText: true, + 'data-test-subj': 'mlAnalyticsTableColumnSourceIndex', }, { field: DataFrameAnalyticsListColumn.configDestIndex, @@ -188,6 +198,7 @@ export const getColumns = ( }), sortable: true, truncateText: true, + 'data-test-subj': 'mlAnalyticsTableColumnDestIndex', }, { name: i18n.translate('xpack.ml.dataframe.analyticsList.type', { defaultMessage: 'Type' }), @@ -197,6 +208,7 @@ export const getColumns = ( return {getAnalysisType(item.config.analysis)}; }, width: '150px', + 'data-test-subj': 'mlAnalyticsTableColumnType', }, { name: i18n.translate('xpack.ml.dataframe.analyticsList.status', { defaultMessage: 'Status' }), @@ -206,6 +218,7 @@ export const getColumns = ( return getTaskStateBadge(item.stats.state, item.stats.reason); }, width: '100px', + 'data-test-subj': 'mlAnalyticsTableColumnStatus', }, // For now there is batch mode only so we hide this column for now. /* diff --git a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_button/create_analytics_button.tsx b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_button/create_analytics_button.tsx index 6ce5de4fb0c52..0958dff7a3f51 100644 --- a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_button/create_analytics_button.tsx +++ b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_button/create_analytics_button.tsx @@ -27,7 +27,7 @@ export const CreateAnalyticsButton: FC = props => { onClick={openModal} iconType="plusInCircle" size="s" - data-test-subj="mlDataFrameAnalyticsButtonCreate" + data-test-subj="mlAnalyticsButtonCreate" > {i18n.translate('xpack.ml.dataframe.analyticsList.createDataFrameAnalyticsButton', { defaultMessage: 'Create analytics job', diff --git a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_flyout/create_analytics_flyout.tsx b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_flyout/create_analytics_flyout.tsx index 4861c05687597..f6920815c0c87 100644 --- a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_flyout/create_analytics_flyout.tsx +++ b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_flyout/create_analytics_flyout.tsx @@ -29,7 +29,7 @@ export const CreateAnalyticsFlyout: FC = ({ const { isJobCreated, isJobStarted, isModalButtonDisabled, isValid } = state; return ( - +

@@ -59,6 +59,7 @@ export const CreateAnalyticsFlyout: FC = ({ disabled={!isValid || isModalButtonDisabled} onClick={createAnalyticsJob} fill + data-test-subj="mlAnalyticsCreateJobFlyoutCreateButton" > {i18n.translate('xpack.ml.dataframe.analytics.create.flyoutCreateButton', { defaultMessage: 'Create', @@ -71,6 +72,7 @@ export const CreateAnalyticsFlyout: FC = ({ disabled={isModalButtonDisabled} onClick={startAnalyticsJob} fill + data-test-subj="mlAnalyticsCreateJobFlyoutStartButton" > {i18n.translate('xpack.ml.dataframe.analytics.create.flyoutStartButton', { defaultMessage: 'Start', @@ -78,7 +80,11 @@ export const CreateAnalyticsFlyout: FC = ({ )} {isJobCreated && isJobStarted && ( - + {i18n.translate('xpack.ml.dataframe.analytics.create.flyoutCloseButton', { defaultMessage: 'Close', })} diff --git a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/create_analytics_form.tsx b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/create_analytics_form.tsx index 9cbdc457e75ca..4fed5b4951c5b 100644 --- a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/create_analytics_form.tsx +++ b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/create_analytics_form.tsx @@ -248,6 +248,7 @@ export const CreateAnalyticsForm: FC = ({ actions, sta )} checked={isAdvancedEditorEnabled} onChange={actions.switchToAdvancedEditor} + data-test-subj="mlAnalyticsCreateJobFlyoutAdvancedEditorSwitch" /> = ({ actions, sta } )} isInvalid={(!jobIdEmpty && !jobIdValid) || jobIdExists} + data-test-subj="mlAnalyticsCreateJobFlyoutJobIdInput" /> = ({ actions, sta setFormState({ sourceIndex: selectedOptions[0].label || '' }) } isClearable={false} + data-test-subj="mlAnalyticsCreateJobFlyoutSourceIndexSelect" /> )} {isJobCreated && ( @@ -404,6 +407,7 @@ export const CreateAnalyticsForm: FC = ({ actions, sta } )} isInvalid={!destinationIndexNameEmpty && !destinationIndexNameValid} + data-test-subj="mlAnalyticsCreateJobFlyoutDestinationIndexInput" /> {jobType === JOB_TYPES.REGRESSION && ( @@ -463,6 +467,7 @@ export const CreateAnalyticsForm: FC = ({ actions, sta } isClearable={false} isInvalid={dependentVariable === ''} + data-test-subj="mlAnalyticsCreateJobFlyoutDependentVariableSelect" /> = ({ actions, sta value={trainingPercent} // @ts-ignore Property 'value' does not exist on type 'EventTarget' | (EventTarget & HTMLInputElement) onChange={e => setFormState({ trainingPercent: e.target.value })} + data-test-subj="mlAnalyticsCreateJobFlyoutTrainingPercentSlider" /> @@ -500,6 +506,7 @@ export const CreateAnalyticsForm: FC = ({ actions, sta value={modelMemoryLimit || ''} onChange={e => setFormState({ modelMemoryLimit: e.target.value })} isInvalid={modelMemoryLimit === ''} + data-test-subj="mlAnalyticsCreateJobFlyoutModelMemoryInput" /> = ({ actions, sta })} checked={createIndexPattern === true} onChange={() => setFormState({ createIndexPattern: !createIndexPattern })} + data-test-subj="mlAnalyticsCreateJobFlyoutCreateIndexPatternSwitch" /> diff --git a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/job_type.tsx b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/job_type.tsx index 0c5f4d205e7fd..2b25d51ac2091 100644 --- a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/job_type.tsx +++ b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/job_type.tsx @@ -57,6 +57,7 @@ export const JobType: FC = ({ type, setFormState }) => { const value = e.target.value as AnalyticsJobType; setFormState({ jobType: value }); }} + data-test-subj="mlAnalyticsCreateJobFlyoutJobTypeSelect" /> diff --git a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/refresh_analytics_list_button/refresh_analytics_list_button.tsx b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/refresh_analytics_list_button/refresh_analytics_list_button.tsx index 6707dadc04a69..f54cc4621eccf 100644 --- a/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/refresh_analytics_list_button/refresh_analytics_list_button.tsx +++ b/x-pack/legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/refresh_analytics_list_button/refresh_analytics_list_button.tsx @@ -15,7 +15,7 @@ export const RefreshAnalyticsListButton: FC = () => { const { refresh } = useRefreshAnalyticsList({ isLoading: setIsLoading }); return ( diff --git a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/index.ts b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/index.ts new file mode 100644 index 0000000000000..dd8de77e6d5d0 --- /dev/null +++ b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function({ loadTestFile }: FtrProviderContext) { + describe('data frame analytics', function() { + this.tags(['mlqa', 'skipFirefox']); + + loadTestFile(require.resolve('./outlier_detection_creation')); + loadTestFile(require.resolve('./regression_creation')); + }); +} diff --git a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/outlier_detection_creation.ts b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/outlier_detection_creation.ts new file mode 100644 index 0000000000000..3e80a5782309f --- /dev/null +++ b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/outlier_detection_creation.ts @@ -0,0 +1,157 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import expect from '@kbn/expect'; + +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function({ getService }: FtrProviderContext) { + const esArchiver = getService('esArchiver'); + const ml = getService('ml'); + + describe('outlier detection creation', function() { + this.tags(['smoke']); + before(async () => { + await esArchiver.load('ml/ihp_outlier'); + }); + + after(async () => { + await ml.api.cleanMlIndices(); + await esArchiver.unload('ml/ihp_outlier'); + }); + + const testDataList = [ + { + suiteTitle: 'iowa house prices', + jobType: 'outlier_detection', + jobId: `ihp_1_${Date.now()}`, + source: 'ihp_outlier', + get destinationIndex(): string { + return `dest_${this.jobId}`; + }, + modelMemory: '55mb', + createIndexPattern: true, + expected: { + row: { + type: 'outlier_detection', + status: 'stopped', + progress: '100', + }, + }, + }, + ]; + + for (const testData of testDataList) { + describe(`${testData.suiteTitle}`, function() { + after(async () => { + await ml.api.deleteIndices(testData.destinationIndex); + }); + + it('loads the data frame analytics page', async () => { + await ml.navigation.navigateToMl(); + await ml.navigation.navigateToDataFrameAnalytics(); + }); + + it('loads the job creation flyout', async () => { + await ml.dataFrameAnalytics.startAnalyticsCreation(); + }); + + it('selects the job type', async () => { + await ml.dataFrameAnalyticsCreation.assertJobTypeSelectExists(); + await ml.dataFrameAnalyticsCreation.selectJobType(testData.jobType); + }); + + it('does not display the dependent variable input', async () => { + await ml.dataFrameAnalyticsCreation.assertDependentVariableInputMissing(); + }); + + it('does not display the training percent input', async () => { + await ml.dataFrameAnalyticsCreation.assertTrainingPercentInputMissing(); + }); + + it('inputs the job id', async () => { + await ml.dataFrameAnalyticsCreation.assertJobIdInputExists(); + await ml.dataFrameAnalyticsCreation.setJobId(testData.jobId); + }); + + it('selects the source index', async () => { + await ml.dataFrameAnalyticsCreation.assertSourceIndexInputExists(); + await ml.dataFrameAnalyticsCreation.selectSourceIndex(testData.source); + }); + + it('inputs the destination index', async () => { + await ml.dataFrameAnalyticsCreation.assertDestIndexInputExists(); + await ml.dataFrameAnalyticsCreation.setDestIndex(testData.destinationIndex); + }); + + it('inputs the model memory limit', async () => { + await ml.dataFrameAnalyticsCreation.assertModelMemoryInputExists(); + await ml.dataFrameAnalyticsCreation.setModelMemory(testData.modelMemory); + }); + + it('sets the create index pattern switch', async () => { + await ml.dataFrameAnalyticsCreation.assertCreateIndexPatternSwitchExists(); + await ml.dataFrameAnalyticsCreation.setCreateIndexPatternSwitchState( + testData.createIndexPattern + ); + }); + + it('creates the analytics job', async () => { + await ml.dataFrameAnalyticsCreation.assertCreateButtonExists(); + await ml.dataFrameAnalyticsCreation.createAnalyticsJob(); + }); + + it('starts the analytics job', async () => { + await ml.dataFrameAnalyticsCreation.assertStartButtonExists(); + await ml.dataFrameAnalyticsCreation.startAnalyticsJob(); + }); + + it('closes the create job flyout', async () => { + await ml.dataFrameAnalyticsCreation.assertCloseButtonExists(); + await ml.dataFrameAnalyticsCreation.closeCreateAnalyticsJobFlyout(); + }); + + it('finishes analytics processing', async () => { + await ml.dataFrameAnalytics.waitForAnalyticsCompletion(testData.jobId); + }); + + it('displays the analytics table', async () => { + await ml.dataFrameAnalytics.assertAnalyticsTableExists(); + }); + + it('displays the stats bar', async () => { + await ml.dataFrameAnalytics.assertAnalyticsStatsBarExists(); + }); + + it('displays the created job in the analytics table', async () => { + await ml.dataFrameAnalyticsTable.refreshAnalyticsTable(); + await ml.dataFrameAnalyticsTable.filterWithSearchString(testData.jobId); + const rows = await ml.dataFrameAnalyticsTable.parseAnalyticsTable(); + const filteredRows = rows.filter(row => row.id === testData.jobId); + expect(filteredRows).to.have.length( + 1, + `Filtered analytics table should have 1 row for job id '${testData.jobId}' (got matching items '${filteredRows}')` + ); + }); + + it('displays details for the created job in the analytics table', async () => { + await ml.dataFrameAnalyticsTable.assertAnalyticsRowFields(testData.jobId, { + id: testData.jobId, + sourceIndex: testData.source, + destinationIndex: testData.destinationIndex, + type: testData.expected.row.type, + status: testData.expected.row.status, + progress: testData.expected.row.progress, + }); + }); + + it('creates the destination index and writes results to it', async () => { + await ml.api.assertIndicesExist(testData.destinationIndex); + await ml.api.assertIndicesNotEmpty(testData.destinationIndex); + }); + }); + } + }); +} diff --git a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/regression_creation.ts b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/regression_creation.ts new file mode 100644 index 0000000000000..2de98c9b80240 --- /dev/null +++ b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/regression_creation.ts @@ -0,0 +1,161 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import expect from '@kbn/expect'; + +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default function({ getService }: FtrProviderContext) { + const esArchiver = getService('esArchiver'); + const ml = getService('ml'); + + describe('outlier detection creation', function() { + this.tags(['smoke']); + before(async () => { + await esArchiver.load('ml/egs_regression'); + }); + + after(async () => { + await ml.api.cleanMlIndices(); + await esArchiver.unload('ml/egs_regression'); + }); + + const testDataList = [ + { + suiteTitle: 'electrical grid stability', + jobType: 'regression', + jobId: `egs_1_${Date.now()}`, + source: 'egs_regression', + get destinationIndex(): string { + return `dest_${this.jobId}`; + }, + dependentVariable: 'stab', + trainingPercent: '20', + modelMemory: '105mb', + createIndexPattern: true, + expected: { + row: { + type: 'regression', + status: 'stopped', + progress: '100', + }, + }, + }, + ]; + + for (const testData of testDataList) { + describe(`${testData.suiteTitle}`, function() { + after(async () => { + await ml.api.deleteIndices(testData.destinationIndex); + }); + + it('loads the data frame analytics page', async () => { + await ml.navigation.navigateToMl(); + await ml.navigation.navigateToDataFrameAnalytics(); + }); + + it('loads the job creation flyout', async () => { + await ml.dataFrameAnalytics.startAnalyticsCreation(); + }); + + it('selects the job type', async () => { + await ml.dataFrameAnalyticsCreation.assertJobTypeSelectExists(); + await ml.dataFrameAnalyticsCreation.selectJobType(testData.jobType); + }); + + it('inputs the job id', async () => { + await ml.dataFrameAnalyticsCreation.assertJobIdInputExists(); + await ml.dataFrameAnalyticsCreation.setJobId(testData.jobId); + }); + + it('selects the source index', async () => { + await ml.dataFrameAnalyticsCreation.assertSourceIndexInputExists(); + await ml.dataFrameAnalyticsCreation.selectSourceIndex(testData.source); + }); + + it('inputs the destination index', async () => { + await ml.dataFrameAnalyticsCreation.assertDestIndexInputExists(); + await ml.dataFrameAnalyticsCreation.setDestIndex(testData.destinationIndex); + }); + + it('inputs the dependent variable', async () => { + await ml.dataFrameAnalyticsCreation.assertDependentVariableInputExists(); + await ml.dataFrameAnalyticsCreation.selectDependentVariable(testData.dependentVariable); + }); + + it('inputs the training percent', async () => { + await ml.dataFrameAnalyticsCreation.assertTrainingPercentInputExists(); + await ml.dataFrameAnalyticsCreation.setTrainingPercent(testData.trainingPercent); + }); + + it('inputs the model memory limit', async () => { + await ml.dataFrameAnalyticsCreation.assertModelMemoryInputExists(); + await ml.dataFrameAnalyticsCreation.setModelMemory(testData.modelMemory); + }); + + it('sets the create index pattern switch', async () => { + await ml.dataFrameAnalyticsCreation.assertCreateIndexPatternSwitchExists(); + await ml.dataFrameAnalyticsCreation.setCreateIndexPatternSwitchState( + testData.createIndexPattern + ); + }); + + it('creates the analytics job', async () => { + await ml.dataFrameAnalyticsCreation.assertCreateButtonExists(); + await ml.dataFrameAnalyticsCreation.createAnalyticsJob(); + }); + + it('starts the analytics job', async () => { + await ml.dataFrameAnalyticsCreation.assertStartButtonExists(); + await ml.dataFrameAnalyticsCreation.startAnalyticsJob(); + }); + + it('closes the create job flyout', async () => { + await ml.dataFrameAnalyticsCreation.assertCloseButtonExists(); + await ml.dataFrameAnalyticsCreation.closeCreateAnalyticsJobFlyout(); + }); + + it('finishes analytics processing', async () => { + await ml.dataFrameAnalytics.waitForAnalyticsCompletion(testData.jobId); + }); + + it('displays the analytics table', async () => { + await ml.dataFrameAnalytics.assertAnalyticsTableExists(); + }); + + it('displays the stats bar', async () => { + await ml.dataFrameAnalytics.assertAnalyticsStatsBarExists(); + }); + + it('displays the created job in the analytics table', async () => { + await ml.dataFrameAnalyticsTable.refreshAnalyticsTable(); + await ml.dataFrameAnalyticsTable.filterWithSearchString(testData.jobId); + const rows = await ml.dataFrameAnalyticsTable.parseAnalyticsTable(); + const filteredRows = rows.filter(row => row.id === testData.jobId); + expect(filteredRows).to.have.length( + 1, + `Filtered analytics table should have 1 row for job id '${testData.jobId}' (got matching items '${filteredRows}')` + ); + }); + + it('displays details for the created job in the analytics table', async () => { + await ml.dataFrameAnalyticsTable.assertAnalyticsRowFields(testData.jobId, { + id: testData.jobId, + sourceIndex: testData.source, + destinationIndex: testData.destinationIndex, + type: testData.expected.row.type, + status: testData.expected.row.status, + progress: testData.expected.row.progress, + }); + }); + + it('creates the destination index and writes results to it', async () => { + await ml.api.assertIndicesExist(testData.destinationIndex); + await ml.api.assertIndicesNotEmpty(testData.destinationIndex); + }); + }); + } + }); +} diff --git a/x-pack/test/functional/apps/machine_learning/index.ts b/x-pack/test/functional/apps/machine_learning/index.ts index f6a929bca6031..989f51f4bdde4 100644 --- a/x-pack/test/functional/apps/machine_learning/index.ts +++ b/x-pack/test/functional/apps/machine_learning/index.ts @@ -13,5 +13,6 @@ export default function({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./pages')); loadTestFile(require.resolve('./anomaly_detection')); loadTestFile(require.resolve('./data_visualizer')); + loadTestFile(require.resolve('./data_frame_analytics')); }); } diff --git a/x-pack/test/functional/es_archives/ml/egs_regression/data.json.gz b/x-pack/test/functional/es_archives/ml/egs_regression/data.json.gz new file mode 100644 index 0000000000000..78a8b65b4a124 Binary files /dev/null and b/x-pack/test/functional/es_archives/ml/egs_regression/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/egs_regression/mappings.json b/x-pack/test/functional/es_archives/ml/egs_regression/mappings.json new file mode 100644 index 0000000000000..bfaecc6820469 --- /dev/null +++ b/x-pack/test/functional/es_archives/ml/egs_regression/mappings.json @@ -0,0 +1,1452 @@ +{ + "type": "index", + "value": { + "aliases": { + }, + "index": "egs_regression", + "mappings": { + "properties": { + "g1": { + "type": "float" + }, + "g2": { + "type": "float" + }, + "g3": { + "type": "float" + }, + "g4": { + "type": "float" + }, + "p1": { + "type": "float" + }, + "p2": { + "type": "float" + }, + "p3": { + "type": "float" + }, + "p4": { + "type": "float" + }, + "stab": { + "type": "float" + }, + "stabf": { + "type": "keyword" + }, + "tau1": { + "type": "float" + }, + "tau2": { + "type": "float" + }, + "tau3": { + "type": "float" + }, + "tau4": { + "type": "float" + } + } + }, + "settings": { + "index": { + "number_of_replicas": "1", + "number_of_shards": "1" + } + } + } +} + +{ + "type": "index", + "value": { + "aliases": { + ".kibana": { + } + }, + "index": ".kibana_1", + "mappings": { + "_meta": { + "migrationMappingPropertyHashes": { + "action": "ecc01e367a369542bc2b15dae1fb1773", + "action_task_params": "a9d49f184ee89641044be0ca2950fa3a", + "alert": "3cdf52bff6f482e53b825b45686604db", + "apm-indices": "9bb9b2bf1fa636ed8619cbab5ce6a1dd", + "apm-services-telemetry": "07ee1939fa4302c62ddc052ec03fed90", + "canvas-element": "7390014e1091044523666d97247392fc", + "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", + "config": "87aca8fdb053154f11383fce3dbf3edf", + "dashboard": "d00f614b29a80360e1190193fd333bab", + "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", + "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", + "index-pattern": "66eccb05066c5a89924f48a9e9736499", + "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", + "inventory-view": "84b320fd67209906333ffce261128462", + "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", + "lens": "21c3ea0763beb1ecb0162529706b88c5", + "lens-ui-telemetry": "509bfa5978586998e05f9e303c07a327", + "map": "23d7aa4a720d4938ccde3983f87bd58d", + "maps-telemetry": "a4229f8b16a6820c6d724b7e0c1f729d", + "metrics-explorer-view": "53c5365793677328df0ccb6138bf3cdd", + "migrationVersion": "4a1746014a75ade3a714e1db5763276f", + "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", + "namespace": "2f4316de49999235636386fe51dc06c1", + "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", + "references": "7997cf5a56cc02bdc9c93361bde732b0", + "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", + "search": "181661168bbadd1eff5902361e2a0d5c", + "server": "ec97f1c5da1a19609a60874e5af1100c", + "siem-ui-timeline": "6485ab095be8d15246667b98a1a34295", + "siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084", + "siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29", + "space": "c5ca8acafa0beaa4d08d014a97b6bc6b", + "telemetry": "358ffaa88ba34a97d55af0933a117de4", + "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", + "type": "2f4316de49999235636386fe51dc06c1", + "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", + "updated_at": "00da57df13e94e9d98437d13ace4bfe0", + "upgrade-assistant-reindex-operation": "a53a20fe086b72c9a86da3cc12dad8a6", + "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", + "url": "c7f66a0df8b1b52f17c28c4adb111105", + "visualization": "52d7a13ad68a150c4525b292d23e12cc" + } + }, + "dynamic": "strict", + "properties": { + "action": { + "properties": { + "actionTypeId": { + "type": "keyword" + }, + "config": { + "enabled": false, + "type": "object" + }, + "description": { + "type": "text" + }, + "secrets": { + "type": "binary" + } + } + }, + "action_task_params": { + "properties": { + "actionId": { + "type": "keyword" + }, + "apiKey": { + "type": "binary" + }, + "params": { + "enabled": false, + "type": "object" + } + } + }, + "alert": { + "properties": { + "actions": { + "properties": { + "actionRef": { + "type": "keyword" + }, + "group": { + "type": "keyword" + }, + "params": { + "enabled": false, + "type": "object" + } + }, + "type": "nested" + }, + "alertTypeId": { + "type": "keyword" + }, + "apiKey": { + "type": "binary" + }, + "apiKeyOwner": { + "type": "keyword" + }, + "createdBy": { + "type": "keyword" + }, + "enabled": { + "type": "boolean" + }, + "interval": { + "type": "keyword" + }, + "muteAll": { + "type": "boolean" + }, + "mutedInstanceIds": { + "type": "keyword" + }, + "name": { + "type": "text" + }, + "params": { + "enabled": false, + "type": "object" + }, + "scheduledTaskId": { + "type": "keyword" + }, + "tags": { + "type": "keyword" + }, + "throttle": { + "type": "keyword" + }, + "updatedBy": { + "type": "keyword" + } + } + }, + "apm-indices": { + "properties": { + "apm_oss": { + "properties": { + "errorIndices": { + "type": "keyword" + }, + "metricsIndices": { + "type": "keyword" + }, + "onboardingIndices": { + "type": "keyword" + }, + "sourcemapIndices": { + "type": "keyword" + }, + "spanIndices": { + "type": "keyword" + }, + "transactionIndices": { + "type": "keyword" + } + } + } + } + }, + "apm-services-telemetry": { + "properties": { + "has_any_services": { + "type": "boolean" + }, + "services_per_agent": { + "properties": { + "dotnet": { + "null_value": 0, + "type": "long" + }, + "go": { + "null_value": 0, + "type": "long" + }, + "java": { + "null_value": 0, + "type": "long" + }, + "js-base": { + "null_value": 0, + "type": "long" + }, + "nodejs": { + "null_value": 0, + "type": "long" + }, + "python": { + "null_value": 0, + "type": "long" + }, + "ruby": { + "null_value": 0, + "type": "long" + }, + "rum-js": { + "null_value": 0, + "type": "long" + } + } + } + } + }, + "canvas-element": { + "dynamic": "false", + "properties": { + "@created": { + "type": "date" + }, + "@timestamp": { + "type": "date" + }, + "content": { + "type": "text" + }, + "help": { + "type": "text" + }, + "image": { + "type": "text" + }, + "name": { + "fields": { + "keyword": { + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "canvas-workpad": { + "dynamic": "false", + "properties": { + "@created": { + "type": "date" + }, + "@timestamp": { + "type": "date" + }, + "name": { + "fields": { + "keyword": { + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" + }, + "dateFormat:tz": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "defaultIndex": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "dashboard": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" + } + } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "file-upload-telemetry": { + "properties": { + "filesUploadedTotalCount": { + "type": "long" + } + } + }, + "graph-workspace": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "numLinks": { + "type": "integer" + }, + "numVertices": { + "type": "integer" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "wsState": { + "type": "text" + } + } + }, + "index-pattern": { + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "type": { + "type": "keyword" + }, + "typeMeta": { + "type": "keyword" + } + } + }, + "infrastructure-ui-source": { + "properties": { + "description": { + "type": "text" + }, + "fields": { + "properties": { + "container": { + "type": "keyword" + }, + "host": { + "type": "keyword" + }, + "pod": { + "type": "keyword" + }, + "tiebreaker": { + "type": "keyword" + }, + "timestamp": { + "type": "keyword" + } + } + }, + "logAlias": { + "type": "keyword" + }, + "logColumns": { + "properties": { + "fieldColumn": { + "properties": { + "field": { + "type": "keyword" + }, + "id": { + "type": "keyword" + } + } + }, + "messageColumn": { + "properties": { + "id": { + "type": "keyword" + } + } + }, + "timestampColumn": { + "properties": { + "id": { + "type": "keyword" + } + } + } + }, + "type": "nested" + }, + "metricAlias": { + "type": "keyword" + }, + "name": { + "type": "text" + } + } + }, + "inventory-view": { + "properties": { + "autoBounds": { + "type": "boolean" + }, + "autoReload": { + "type": "boolean" + }, + "boundsOverride": { + "properties": { + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + } + } + }, + "customOptions": { + "properties": { + "field": { + "type": "keyword" + }, + "text": { + "type": "keyword" + } + }, + "type": "nested" + }, + "filterQuery": { + "properties": { + "expression": { + "type": "keyword" + }, + "kind": { + "type": "keyword" + } + } + }, + "groupBy": { + "properties": { + "field": { + "type": "keyword" + }, + "label": { + "type": "keyword" + } + }, + "type": "nested" + }, + "metric": { + "properties": { + "type": { + "type": "keyword" + } + } + }, + "name": { + "type": "keyword" + }, + "nodeType": { + "type": "keyword" + }, + "time": { + "type": "integer" + }, + "view": { + "type": "keyword" + } + } + }, + "kql-telemetry": { + "properties": { + "optInCount": { + "type": "long" + }, + "optOutCount": { + "type": "long" + } + } + }, + "lens": { + "properties": { + "expression": { + "index": false, + "type": "keyword" + }, + "state": { + "type": "flattened" + }, + "title": { + "type": "text" + }, + "visualizationType": { + "type": "keyword" + } + } + }, + "lens-ui-telemetry": { + "properties": { + "count": { + "type": "integer" + }, + "date": { + "type": "date" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + } + }, + "map": { + "properties": { + "bounds": { + "type": "geo_shape" + }, + "description": { + "type": "text" + }, + "layerListJSON": { + "type": "text" + }, + "mapStateJSON": { + "type": "text" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "maps-telemetry": { + "properties": { + "attributesPerMap": { + "properties": { + "dataSourcesCount": { + "properties": { + "avg": { + "type": "long" + }, + "max": { + "type": "long" + }, + "min": { + "type": "long" + } + } + }, + "emsVectorLayersCount": { + "dynamic": "true", + "type": "object" + }, + "layerTypesCount": { + "dynamic": "true", + "type": "object" + }, + "layersCount": { + "properties": { + "avg": { + "type": "long" + }, + "max": { + "type": "long" + }, + "min": { + "type": "long" + } + } + } + } + }, + "mapsTotalCount": { + "type": "long" + }, + "timeCaptured": { + "type": "date" + } + } + }, + "metrics-explorer-view": { + "properties": { + "chartOptions": { + "properties": { + "stack": { + "type": "boolean" + }, + "type": { + "type": "keyword" + }, + "yAxisMode": { + "type": "keyword" + } + } + }, + "currentTimerange": { + "properties": { + "from": { + "type": "keyword" + }, + "interval": { + "type": "keyword" + }, + "to": { + "type": "keyword" + } + } + }, + "name": { + "type": "keyword" + }, + "options": { + "properties": { + "aggregation": { + "type": "keyword" + }, + "filterQuery": { + "type": "keyword" + }, + "groupBy": { + "type": "keyword" + }, + "limit": { + "type": "integer" + }, + "metrics": { + "properties": { + "aggregation": { + "type": "keyword" + }, + "color": { + "type": "keyword" + }, + "field": { + "type": "keyword" + }, + "label": { + "type": "keyword" + } + }, + "type": "nested" + } + } + } + } + }, + "migrationVersion": { + "dynamic": "true", + "properties": { + "index-pattern": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "space": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "ml-telemetry": { + "properties": { + "file_data_visualizer": { + "properties": { + "index_creation_count": { + "type": "long" + } + } + } + } + }, + "namespace": { + "type": "keyword" + }, + "query": { + "properties": { + "description": { + "type": "text" + }, + "filters": { + "enabled": false, + "type": "object" + }, + "query": { + "properties": { + "language": { + "type": "keyword" + }, + "query": { + "index": false, + "type": "keyword" + } + } + }, + "timefilter": { + "enabled": false, + "type": "object" + }, + "title": { + "type": "text" + } + } + }, + "references": { + "properties": { + "id": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + }, + "type": "nested" + }, + "sample-data-telemetry": { + "properties": { + "installCount": { + "type": "long" + }, + "unInstallCount": { + "type": "long" + } + } + }, + "search": { + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "server": { + "properties": { + "uuid": { + "type": "keyword" + } + } + }, + "siem-ui-timeline": { + "properties": { + "columns": { + "properties": { + "aggregatable": { + "type": "boolean" + }, + "category": { + "type": "keyword" + }, + "columnHeaderType": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "example": { + "type": "text" + }, + "id": { + "type": "keyword" + }, + "indexes": { + "type": "keyword" + }, + "name": { + "type": "text" + }, + "placeholder": { + "type": "text" + }, + "searchable": { + "type": "boolean" + }, + "type": { + "type": "keyword" + } + } + }, + "created": { + "type": "date" + }, + "createdBy": { + "type": "text" + }, + "dataProviders": { + "properties": { + "and": { + "properties": { + "enabled": { + "type": "boolean" + }, + "excluded": { + "type": "boolean" + }, + "id": { + "type": "keyword" + }, + "kqlQuery": { + "type": "text" + }, + "name": { + "type": "text" + }, + "queryMatch": { + "properties": { + "displayField": { + "type": "text" + }, + "displayValue": { + "type": "text" + }, + "field": { + "type": "text" + }, + "operator": { + "type": "text" + }, + "value": { + "type": "text" + } + } + } + } + }, + "enabled": { + "type": "boolean" + }, + "excluded": { + "type": "boolean" + }, + "id": { + "type": "keyword" + }, + "kqlQuery": { + "type": "text" + }, + "name": { + "type": "text" + }, + "queryMatch": { + "properties": { + "displayField": { + "type": "text" + }, + "displayValue": { + "type": "text" + }, + "field": { + "type": "text" + }, + "operator": { + "type": "text" + }, + "value": { + "type": "text" + } + } + } + } + }, + "dateRange": { + "properties": { + "end": { + "type": "date" + }, + "start": { + "type": "date" + } + } + }, + "description": { + "type": "text" + }, + "favorite": { + "properties": { + "favoriteDate": { + "type": "date" + }, + "fullName": { + "type": "text" + }, + "keySearch": { + "type": "text" + }, + "userName": { + "type": "text" + } + } + }, + "filters": { + "properties": { + "exists": { + "type": "text" + }, + "match_all": { + "type": "text" + }, + "meta": { + "properties": { + "alias": { + "type": "text" + }, + "controlledBy": { + "type": "text" + }, + "disabled": { + "type": "boolean" + }, + "field": { + "type": "text" + }, + "formattedValue": { + "type": "text" + }, + "index": { + "type": "keyword" + }, + "key": { + "type": "keyword" + }, + "negate": { + "type": "boolean" + }, + "params": { + "type": "text" + }, + "type": { + "type": "keyword" + }, + "value": { + "type": "text" + } + } + }, + "missing": { + "type": "text" + }, + "query": { + "type": "text" + }, + "range": { + "type": "text" + }, + "script": { + "type": "text" + } + } + }, + "kqlMode": { + "type": "keyword" + }, + "kqlQuery": { + "properties": { + "filterQuery": { + "properties": { + "kuery": { + "properties": { + "expression": { + "type": "text" + }, + "kind": { + "type": "keyword" + } + } + }, + "serializedQuery": { + "type": "text" + } + } + } + } + }, + "savedQueryId": { + "type": "keyword" + }, + "sort": { + "properties": { + "columnId": { + "type": "keyword" + }, + "sortDirection": { + "type": "keyword" + } + } + }, + "title": { + "type": "text" + }, + "updated": { + "type": "date" + }, + "updatedBy": { + "type": "text" + } + } + }, + "siem-ui-timeline-note": { + "properties": { + "created": { + "type": "date" + }, + "createdBy": { + "type": "text" + }, + "eventId": { + "type": "keyword" + }, + "note": { + "type": "text" + }, + "timelineId": { + "type": "keyword" + }, + "updated": { + "type": "date" + }, + "updatedBy": { + "type": "text" + } + } + }, + "siem-ui-timeline-pinned-event": { + "properties": { + "created": { + "type": "date" + }, + "createdBy": { + "type": "text" + }, + "eventId": { + "type": "keyword" + }, + "timelineId": { + "type": "keyword" + }, + "updated": { + "type": "date" + }, + "updatedBy": { + "type": "text" + } + } + }, + "space": { + "properties": { + "_reserved": { + "type": "boolean" + }, + "color": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "disabledFeatures": { + "type": "keyword" + }, + "imageUrl": { + "index": false, + "type": "text" + }, + "initials": { + "type": "keyword" + }, + "name": { + "fields": { + "keyword": { + "ignore_above": 2048, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "telemetry": { + "properties": { + "enabled": { + "type": "boolean" + }, + "lastReported": { + "type": "date" + }, + "lastVersionChecked": { + "ignore_above": 256, + "type": "keyword" + }, + "sendUsageFrom": { + "ignore_above": 256, + "type": "keyword" + }, + "userHasSeenNotice": { + "type": "boolean" + } + } + }, + "timelion-sheet": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "type": { + "type": "keyword" + }, + "ui-metric": { + "properties": { + "count": { + "type": "integer" + } + } + }, + "updated_at": { + "type": "date" + }, + "upgrade-assistant-reindex-operation": { + "dynamic": "true", + "properties": { + "indexName": { + "type": "keyword" + }, + "status": { + "type": "integer" + } + } + }, + "upgrade-assistant-telemetry": { + "properties": { + "features": { + "properties": { + "deprecation_logging": { + "properties": { + "enabled": { + "null_value": true, + "type": "boolean" + } + } + } + } + }, + "ui_open": { + "properties": { + "cluster": { + "null_value": 0, + "type": "long" + }, + "indices": { + "null_value": 0, + "type": "long" + }, + "overview": { + "null_value": 0, + "type": "long" + } + } + }, + "ui_reindex": { + "properties": { + "close": { + "null_value": 0, + "type": "long" + }, + "open": { + "null_value": 0, + "type": "long" + }, + "start": { + "null_value": 0, + "type": "long" + }, + "stop": { + "null_value": 0, + "type": "long" + } + } + } + } + }, + "url": { + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "fields": { + "keyword": { + "ignore_above": 2048, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "visualization": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "savedSearchRefName": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" + } + } + } + } + }, + "settings": { + "index": { + "auto_expand_replicas": "0-1", + "number_of_replicas": "0", + "number_of_shards": "1" + } + } + } +} \ No newline at end of file diff --git a/x-pack/test/functional/es_archives/ml/ihp_outlier/data.json.gz b/x-pack/test/functional/es_archives/ml/ihp_outlier/data.json.gz new file mode 100644 index 0000000000000..de0d2d6dd4ccc Binary files /dev/null and b/x-pack/test/functional/es_archives/ml/ihp_outlier/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/ihp_outlier/mappings.json b/x-pack/test/functional/es_archives/ml/ihp_outlier/mappings.json new file mode 100644 index 0000000000000..f90c6e67daac4 --- /dev/null +++ b/x-pack/test/functional/es_archives/ml/ihp_outlier/mappings.json @@ -0,0 +1,1503 @@ +{ + "type": "index", + "value": { + "aliases": { + }, + "index": "ihp_outlier", + "mappings": { + "properties": { + "1stFlrSF": { + "type": "integer" + }, + "BsmtFinSF1": { + "type": "integer" + }, + "BsmtQual": { + "type": "integer" + }, + "CentralAir": { + "type": "keyword" + }, + "Condition2": { + "type": "keyword" + }, + "Electrical": { + "type": "keyword" + }, + "ExterQual": { + "type": "integer" + }, + "Exterior1st": { + "type": "keyword" + }, + "Exterior2nd": { + "type": "keyword" + }, + "Fireplaces": { + "type": "integer" + }, + "FullBath": { + "type": "integer" + }, + "GarageArea": { + "type": "integer" + }, + "GarageCars": { + "type": "integer" + }, + "GarageFinish": { + "type": "keyword" + }, + "GarageType": { + "type": "keyword" + }, + "GrLivArea": { + "type": "integer" + }, + "Heating": { + "type": "keyword" + }, + "HeatingQC": { + "type": "integer" + }, + "KitchenQual": { + "type": "integer" + }, + "MasVnrArea": { + "type": "integer" + }, + "Neighborhood": { + "type": "keyword" + }, + "OverallQual": { + "type": "integer" + }, + "PoolQC": { + "type": "integer" + }, + "RoofMatl": { + "type": "keyword" + }, + "SaleCondition": { + "type": "keyword" + }, + "SalePrice": { + "type": "float" + }, + "SaleType": { + "type": "keyword" + }, + "TotRmsAbvGrd": { + "type": "integer" + }, + "TotalBsmtSF": { + "type": "integer" + }, + "YearBuilt": { + "type": "integer" + }, + "YearRemodAdd": { + "type": "integer" + } + } + }, + "settings": { + "index": { + "number_of_replicas": "1", + "number_of_shards": "1" + } + } + } +} + +{ + "type": "index", + "value": { + "aliases": { + ".kibana": { + } + }, + "index": ".kibana_1", + "mappings": { + "_meta": { + "migrationMappingPropertyHashes": { + "action": "ecc01e367a369542bc2b15dae1fb1773", + "action_task_params": "a9d49f184ee89641044be0ca2950fa3a", + "alert": "3cdf52bff6f482e53b825b45686604db", + "apm-indices": "9bb9b2bf1fa636ed8619cbab5ce6a1dd", + "apm-services-telemetry": "07ee1939fa4302c62ddc052ec03fed90", + "canvas-element": "7390014e1091044523666d97247392fc", + "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", + "config": "87aca8fdb053154f11383fce3dbf3edf", + "dashboard": "d00f614b29a80360e1190193fd333bab", + "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", + "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", + "index-pattern": "66eccb05066c5a89924f48a9e9736499", + "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", + "inventory-view": "84b320fd67209906333ffce261128462", + "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", + "lens": "21c3ea0763beb1ecb0162529706b88c5", + "lens-ui-telemetry": "509bfa5978586998e05f9e303c07a327", + "map": "23d7aa4a720d4938ccde3983f87bd58d", + "maps-telemetry": "a4229f8b16a6820c6d724b7e0c1f729d", + "metrics-explorer-view": "53c5365793677328df0ccb6138bf3cdd", + "migrationVersion": "4a1746014a75ade3a714e1db5763276f", + "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", + "namespace": "2f4316de49999235636386fe51dc06c1", + "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", + "references": "7997cf5a56cc02bdc9c93361bde732b0", + "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", + "search": "181661168bbadd1eff5902361e2a0d5c", + "server": "ec97f1c5da1a19609a60874e5af1100c", + "siem-ui-timeline": "6485ab095be8d15246667b98a1a34295", + "siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084", + "siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29", + "space": "c5ca8acafa0beaa4d08d014a97b6bc6b", + "telemetry": "358ffaa88ba34a97d55af0933a117de4", + "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", + "type": "2f4316de49999235636386fe51dc06c1", + "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", + "updated_at": "00da57df13e94e9d98437d13ace4bfe0", + "upgrade-assistant-reindex-operation": "a53a20fe086b72c9a86da3cc12dad8a6", + "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", + "url": "c7f66a0df8b1b52f17c28c4adb111105", + "visualization": "52d7a13ad68a150c4525b292d23e12cc" + } + }, + "dynamic": "strict", + "properties": { + "action": { + "properties": { + "actionTypeId": { + "type": "keyword" + }, + "config": { + "enabled": false, + "type": "object" + }, + "description": { + "type": "text" + }, + "secrets": { + "type": "binary" + } + } + }, + "action_task_params": { + "properties": { + "actionId": { + "type": "keyword" + }, + "apiKey": { + "type": "binary" + }, + "params": { + "enabled": false, + "type": "object" + } + } + }, + "alert": { + "properties": { + "actions": { + "properties": { + "actionRef": { + "type": "keyword" + }, + "group": { + "type": "keyword" + }, + "params": { + "enabled": false, + "type": "object" + } + }, + "type": "nested" + }, + "alertTypeId": { + "type": "keyword" + }, + "apiKey": { + "type": "binary" + }, + "apiKeyOwner": { + "type": "keyword" + }, + "createdBy": { + "type": "keyword" + }, + "enabled": { + "type": "boolean" + }, + "interval": { + "type": "keyword" + }, + "muteAll": { + "type": "boolean" + }, + "mutedInstanceIds": { + "type": "keyword" + }, + "name": { + "type": "text" + }, + "params": { + "enabled": false, + "type": "object" + }, + "scheduledTaskId": { + "type": "keyword" + }, + "tags": { + "type": "keyword" + }, + "throttle": { + "type": "keyword" + }, + "updatedBy": { + "type": "keyword" + } + } + }, + "apm-indices": { + "properties": { + "apm_oss": { + "properties": { + "errorIndices": { + "type": "keyword" + }, + "metricsIndices": { + "type": "keyword" + }, + "onboardingIndices": { + "type": "keyword" + }, + "sourcemapIndices": { + "type": "keyword" + }, + "spanIndices": { + "type": "keyword" + }, + "transactionIndices": { + "type": "keyword" + } + } + } + } + }, + "apm-services-telemetry": { + "properties": { + "has_any_services": { + "type": "boolean" + }, + "services_per_agent": { + "properties": { + "dotnet": { + "null_value": 0, + "type": "long" + }, + "go": { + "null_value": 0, + "type": "long" + }, + "java": { + "null_value": 0, + "type": "long" + }, + "js-base": { + "null_value": 0, + "type": "long" + }, + "nodejs": { + "null_value": 0, + "type": "long" + }, + "python": { + "null_value": 0, + "type": "long" + }, + "ruby": { + "null_value": 0, + "type": "long" + }, + "rum-js": { + "null_value": 0, + "type": "long" + } + } + } + } + }, + "canvas-element": { + "dynamic": "false", + "properties": { + "@created": { + "type": "date" + }, + "@timestamp": { + "type": "date" + }, + "content": { + "type": "text" + }, + "help": { + "type": "text" + }, + "image": { + "type": "text" + }, + "name": { + "fields": { + "keyword": { + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "canvas-workpad": { + "dynamic": "false", + "properties": { + "@created": { + "type": "date" + }, + "@timestamp": { + "type": "date" + }, + "name": { + "fields": { + "keyword": { + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "config": { + "dynamic": "true", + "properties": { + "buildNum": { + "type": "keyword" + }, + "dateFormat:tz": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "defaultIndex": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "dashboard": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "optionsJSON": { + "type": "text" + }, + "panelsJSON": { + "type": "text" + }, + "refreshInterval": { + "properties": { + "display": { + "type": "keyword" + }, + "pause": { + "type": "boolean" + }, + "section": { + "type": "integer" + }, + "value": { + "type": "integer" + } + } + }, + "timeFrom": { + "type": "keyword" + }, + "timeRestore": { + "type": "boolean" + }, + "timeTo": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "file-upload-telemetry": { + "properties": { + "filesUploadedTotalCount": { + "type": "long" + } + } + }, + "graph-workspace": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "numLinks": { + "type": "integer" + }, + "numVertices": { + "type": "integer" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "wsState": { + "type": "text" + } + } + }, + "index-pattern": { + "properties": { + "fieldFormatMap": { + "type": "text" + }, + "fields": { + "type": "text" + }, + "intervalName": { + "type": "keyword" + }, + "notExpandable": { + "type": "boolean" + }, + "sourceFilters": { + "type": "text" + }, + "timeFieldName": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "type": { + "type": "keyword" + }, + "typeMeta": { + "type": "keyword" + } + } + }, + "infrastructure-ui-source": { + "properties": { + "description": { + "type": "text" + }, + "fields": { + "properties": { + "container": { + "type": "keyword" + }, + "host": { + "type": "keyword" + }, + "pod": { + "type": "keyword" + }, + "tiebreaker": { + "type": "keyword" + }, + "timestamp": { + "type": "keyword" + } + } + }, + "logAlias": { + "type": "keyword" + }, + "logColumns": { + "properties": { + "fieldColumn": { + "properties": { + "field": { + "type": "keyword" + }, + "id": { + "type": "keyword" + } + } + }, + "messageColumn": { + "properties": { + "id": { + "type": "keyword" + } + } + }, + "timestampColumn": { + "properties": { + "id": { + "type": "keyword" + } + } + } + }, + "type": "nested" + }, + "metricAlias": { + "type": "keyword" + }, + "name": { + "type": "text" + } + } + }, + "inventory-view": { + "properties": { + "autoBounds": { + "type": "boolean" + }, + "autoReload": { + "type": "boolean" + }, + "boundsOverride": { + "properties": { + "max": { + "type": "integer" + }, + "min": { + "type": "integer" + } + } + }, + "customOptions": { + "properties": { + "field": { + "type": "keyword" + }, + "text": { + "type": "keyword" + } + }, + "type": "nested" + }, + "filterQuery": { + "properties": { + "expression": { + "type": "keyword" + }, + "kind": { + "type": "keyword" + } + } + }, + "groupBy": { + "properties": { + "field": { + "type": "keyword" + }, + "label": { + "type": "keyword" + } + }, + "type": "nested" + }, + "metric": { + "properties": { + "type": { + "type": "keyword" + } + } + }, + "name": { + "type": "keyword" + }, + "nodeType": { + "type": "keyword" + }, + "time": { + "type": "integer" + }, + "view": { + "type": "keyword" + } + } + }, + "kql-telemetry": { + "properties": { + "optInCount": { + "type": "long" + }, + "optOutCount": { + "type": "long" + } + } + }, + "lens": { + "properties": { + "expression": { + "index": false, + "type": "keyword" + }, + "state": { + "type": "flattened" + }, + "title": { + "type": "text" + }, + "visualizationType": { + "type": "keyword" + } + } + }, + "lens-ui-telemetry": { + "properties": { + "count": { + "type": "integer" + }, + "date": { + "type": "date" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + } + }, + "map": { + "properties": { + "bounds": { + "type": "geo_shape" + }, + "description": { + "type": "text" + }, + "layerListJSON": { + "type": "text" + }, + "mapStateJSON": { + "type": "text" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "maps-telemetry": { + "properties": { + "attributesPerMap": { + "properties": { + "dataSourcesCount": { + "properties": { + "avg": { + "type": "long" + }, + "max": { + "type": "long" + }, + "min": { + "type": "long" + } + } + }, + "emsVectorLayersCount": { + "dynamic": "true", + "type": "object" + }, + "layerTypesCount": { + "dynamic": "true", + "type": "object" + }, + "layersCount": { + "properties": { + "avg": { + "type": "long" + }, + "max": { + "type": "long" + }, + "min": { + "type": "long" + } + } + } + } + }, + "mapsTotalCount": { + "type": "long" + }, + "timeCaptured": { + "type": "date" + } + } + }, + "metrics-explorer-view": { + "properties": { + "chartOptions": { + "properties": { + "stack": { + "type": "boolean" + }, + "type": { + "type": "keyword" + }, + "yAxisMode": { + "type": "keyword" + } + } + }, + "currentTimerange": { + "properties": { + "from": { + "type": "keyword" + }, + "interval": { + "type": "keyword" + }, + "to": { + "type": "keyword" + } + } + }, + "name": { + "type": "keyword" + }, + "options": { + "properties": { + "aggregation": { + "type": "keyword" + }, + "filterQuery": { + "type": "keyword" + }, + "groupBy": { + "type": "keyword" + }, + "limit": { + "type": "integer" + }, + "metrics": { + "properties": { + "aggregation": { + "type": "keyword" + }, + "color": { + "type": "keyword" + }, + "field": { + "type": "keyword" + }, + "label": { + "type": "keyword" + } + }, + "type": "nested" + } + } + } + } + }, + "migrationVersion": { + "dynamic": "true", + "properties": { + "index-pattern": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + }, + "space": { + "fields": { + "keyword": { + "ignore_above": 256, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "ml-telemetry": { + "properties": { + "file_data_visualizer": { + "properties": { + "index_creation_count": { + "type": "long" + } + } + } + } + }, + "namespace": { + "type": "keyword" + }, + "query": { + "properties": { + "description": { + "type": "text" + }, + "filters": { + "enabled": false, + "type": "object" + }, + "query": { + "properties": { + "language": { + "type": "keyword" + }, + "query": { + "index": false, + "type": "keyword" + } + } + }, + "timefilter": { + "enabled": false, + "type": "object" + }, + "title": { + "type": "text" + } + } + }, + "references": { + "properties": { + "id": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + } + }, + "type": "nested" + }, + "sample-data-telemetry": { + "properties": { + "installCount": { + "type": "long" + }, + "unInstallCount": { + "type": "long" + } + } + }, + "search": { + "properties": { + "columns": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "sort": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "server": { + "properties": { + "uuid": { + "type": "keyword" + } + } + }, + "siem-ui-timeline": { + "properties": { + "columns": { + "properties": { + "aggregatable": { + "type": "boolean" + }, + "category": { + "type": "keyword" + }, + "columnHeaderType": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "example": { + "type": "text" + }, + "id": { + "type": "keyword" + }, + "indexes": { + "type": "keyword" + }, + "name": { + "type": "text" + }, + "placeholder": { + "type": "text" + }, + "searchable": { + "type": "boolean" + }, + "type": { + "type": "keyword" + } + } + }, + "created": { + "type": "date" + }, + "createdBy": { + "type": "text" + }, + "dataProviders": { + "properties": { + "and": { + "properties": { + "enabled": { + "type": "boolean" + }, + "excluded": { + "type": "boolean" + }, + "id": { + "type": "keyword" + }, + "kqlQuery": { + "type": "text" + }, + "name": { + "type": "text" + }, + "queryMatch": { + "properties": { + "displayField": { + "type": "text" + }, + "displayValue": { + "type": "text" + }, + "field": { + "type": "text" + }, + "operator": { + "type": "text" + }, + "value": { + "type": "text" + } + } + } + } + }, + "enabled": { + "type": "boolean" + }, + "excluded": { + "type": "boolean" + }, + "id": { + "type": "keyword" + }, + "kqlQuery": { + "type": "text" + }, + "name": { + "type": "text" + }, + "queryMatch": { + "properties": { + "displayField": { + "type": "text" + }, + "displayValue": { + "type": "text" + }, + "field": { + "type": "text" + }, + "operator": { + "type": "text" + }, + "value": { + "type": "text" + } + } + } + } + }, + "dateRange": { + "properties": { + "end": { + "type": "date" + }, + "start": { + "type": "date" + } + } + }, + "description": { + "type": "text" + }, + "favorite": { + "properties": { + "favoriteDate": { + "type": "date" + }, + "fullName": { + "type": "text" + }, + "keySearch": { + "type": "text" + }, + "userName": { + "type": "text" + } + } + }, + "filters": { + "properties": { + "exists": { + "type": "text" + }, + "match_all": { + "type": "text" + }, + "meta": { + "properties": { + "alias": { + "type": "text" + }, + "controlledBy": { + "type": "text" + }, + "disabled": { + "type": "boolean" + }, + "field": { + "type": "text" + }, + "formattedValue": { + "type": "text" + }, + "index": { + "type": "keyword" + }, + "key": { + "type": "keyword" + }, + "negate": { + "type": "boolean" + }, + "params": { + "type": "text" + }, + "type": { + "type": "keyword" + }, + "value": { + "type": "text" + } + } + }, + "missing": { + "type": "text" + }, + "query": { + "type": "text" + }, + "range": { + "type": "text" + }, + "script": { + "type": "text" + } + } + }, + "kqlMode": { + "type": "keyword" + }, + "kqlQuery": { + "properties": { + "filterQuery": { + "properties": { + "kuery": { + "properties": { + "expression": { + "type": "text" + }, + "kind": { + "type": "keyword" + } + } + }, + "serializedQuery": { + "type": "text" + } + } + } + } + }, + "savedQueryId": { + "type": "keyword" + }, + "sort": { + "properties": { + "columnId": { + "type": "keyword" + }, + "sortDirection": { + "type": "keyword" + } + } + }, + "title": { + "type": "text" + }, + "updated": { + "type": "date" + }, + "updatedBy": { + "type": "text" + } + } + }, + "siem-ui-timeline-note": { + "properties": { + "created": { + "type": "date" + }, + "createdBy": { + "type": "text" + }, + "eventId": { + "type": "keyword" + }, + "note": { + "type": "text" + }, + "timelineId": { + "type": "keyword" + }, + "updated": { + "type": "date" + }, + "updatedBy": { + "type": "text" + } + } + }, + "siem-ui-timeline-pinned-event": { + "properties": { + "created": { + "type": "date" + }, + "createdBy": { + "type": "text" + }, + "eventId": { + "type": "keyword" + }, + "timelineId": { + "type": "keyword" + }, + "updated": { + "type": "date" + }, + "updatedBy": { + "type": "text" + } + } + }, + "space": { + "properties": { + "_reserved": { + "type": "boolean" + }, + "color": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "disabledFeatures": { + "type": "keyword" + }, + "imageUrl": { + "index": false, + "type": "text" + }, + "initials": { + "type": "keyword" + }, + "name": { + "fields": { + "keyword": { + "ignore_above": 2048, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "telemetry": { + "properties": { + "enabled": { + "type": "boolean" + }, + "lastReported": { + "type": "date" + }, + "lastVersionChecked": { + "ignore_above": 256, + "type": "keyword" + }, + "sendUsageFrom": { + "ignore_above": 256, + "type": "keyword" + }, + "userHasSeenNotice": { + "type": "boolean" + } + } + }, + "timelion-sheet": { + "properties": { + "description": { + "type": "text" + }, + "hits": { + "type": "integer" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "timelion_chart_height": { + "type": "integer" + }, + "timelion_columns": { + "type": "integer" + }, + "timelion_interval": { + "type": "keyword" + }, + "timelion_other_interval": { + "type": "keyword" + }, + "timelion_rows": { + "type": "integer" + }, + "timelion_sheet": { + "type": "text" + }, + "title": { + "type": "text" + }, + "version": { + "type": "integer" + } + } + }, + "type": { + "type": "keyword" + }, + "ui-metric": { + "properties": { + "count": { + "type": "integer" + } + } + }, + "updated_at": { + "type": "date" + }, + "upgrade-assistant-reindex-operation": { + "dynamic": "true", + "properties": { + "indexName": { + "type": "keyword" + }, + "status": { + "type": "integer" + } + } + }, + "upgrade-assistant-telemetry": { + "properties": { + "features": { + "properties": { + "deprecation_logging": { + "properties": { + "enabled": { + "null_value": true, + "type": "boolean" + } + } + } + } + }, + "ui_open": { + "properties": { + "cluster": { + "null_value": 0, + "type": "long" + }, + "indices": { + "null_value": 0, + "type": "long" + }, + "overview": { + "null_value": 0, + "type": "long" + } + } + }, + "ui_reindex": { + "properties": { + "close": { + "null_value": 0, + "type": "long" + }, + "open": { + "null_value": 0, + "type": "long" + }, + "start": { + "null_value": 0, + "type": "long" + }, + "stop": { + "null_value": 0, + "type": "long" + } + } + } + } + }, + "url": { + "properties": { + "accessCount": { + "type": "long" + }, + "accessDate": { + "type": "date" + }, + "createDate": { + "type": "date" + }, + "url": { + "fields": { + "keyword": { + "ignore_above": 2048, + "type": "keyword" + } + }, + "type": "text" + } + } + }, + "visualization": { + "properties": { + "description": { + "type": "text" + }, + "kibanaSavedObjectMeta": { + "properties": { + "searchSourceJSON": { + "type": "text" + } + } + }, + "savedSearchRefName": { + "type": "keyword" + }, + "title": { + "type": "text" + }, + "uiStateJSON": { + "type": "text" + }, + "version": { + "type": "integer" + }, + "visState": { + "type": "text" + } + } + } + } + }, + "settings": { + "index": { + "auto_expand_replicas": "0-1", + "number_of_replicas": "0", + "number_of_shards": "1" + } + } + } +} \ No newline at end of file diff --git a/x-pack/test/functional/services/machine_learning/api.ts b/x-pack/test/functional/services/machine_learning/api.ts index 2fc027a81ea8c..be65896950cfc 100644 --- a/x-pack/test/functional/services/machine_learning/api.ts +++ b/x-pack/test/functional/services/machine_learning/api.ts @@ -5,10 +5,10 @@ */ import expect from '@kbn/expect'; -import { isEmpty } from 'lodash'; import { FtrProviderContext } from '../../ftr_provider_context'; import { JOB_STATE, DATAFEED_STATE } from '../../../../legacy/plugins/ml/common/constants/states'; +import { DATA_FRAME_TASK_STATE } from '../../../../legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/common'; export function MachineLearningAPIProvider({ getService }: FtrProviderContext) { const es = getService('legacyEs'); @@ -107,19 +107,20 @@ export function MachineLearningAPIProvider({ getService }: FtrProviderContext) { async deleteIndices(indices: string) { log.debug(`Deleting indices: '${indices}'...`); + if ((await es.indices.exists({ index: indices, allowNoIndices: false })) === false) { + log.debug(`Indices '${indices}' don't exist. Nothing to delete.`); + return; + } + const deleteResponse = await es.indices.delete({ index: indices, }); expect(deleteResponse) .to.have.property('acknowledged') - .eql(true); + .eql(true, 'Response for delete request should be acknowledged'); await retry.waitForWithTimeout(`'${indices}' indices to be deleted`, 30 * 1000, async () => { - const getRepsonse = await es.indices.get({ - index: indices, - }); - - if (isEmpty(getRepsonse)) { + if ((await es.indices.exists({ index: indices, allowNoIndices: false })) === false) { return true; } else { throw new Error(`expected indices '${indices}' to be deleted`); @@ -186,5 +187,65 @@ export function MachineLearningAPIProvider({ getService }: FtrProviderContext) { } ); }, + + async getAnalyticsState(analyticsId: string): Promise { + log.debug(`Fetching analytics state for job ${analyticsId}`); + const analyticsStats = await esSupertest + .get(`/_ml/data_frame/analytics/${analyticsId}/_stats`) + .expect(200) + .then((res: any) => res.body); + + expect(analyticsStats.data_frame_analytics).to.have.length(1); + const state: DATA_FRAME_TASK_STATE = analyticsStats.data_frame_analytics[0].state; + + return state; + }, + + async waitForAnalyticsState( + analyticsId: string, + expectedAnalyticsState: DATA_FRAME_TASK_STATE + ) { + await retry.waitForWithTimeout( + `analytics state to be ${expectedAnalyticsState}`, + 2 * 60 * 1000, + async () => { + const state = await this.getAnalyticsState(analyticsId); + if (state === expectedAnalyticsState) { + return true; + } else { + throw new Error( + `expected analytics state to be ${expectedAnalyticsState} but got ${state}` + ); + } + } + ); + }, + + async assertIndicesExist(indices: string) { + await retry.tryForTime(30 * 1000, async () => { + if ((await es.indices.exists({ index: indices, allowNoIndices: false })) === true) { + return true; + } else { + throw new Error(`indices '${indices}' should exist`); + } + }); + }, + + async assertIndicesNotEmpty(indices: string) { + await retry.tryForTime(30 * 1000, async () => { + const response = await es.search({ + index: indices, + body: { + size: 1, + }, + }); + + if (response.hits.hits.length > 0) { + return true; + } else { + throw new Error(`indices '${indices}' should not be empty`); + } + }); + }, }; } diff --git a/x-pack/test/functional/services/machine_learning/data_frame_analytics.ts b/x-pack/test/functional/services/machine_learning/data_frame_analytics.ts index fe7f16eea642d..163c3c60ffdab 100644 --- a/x-pack/test/functional/services/machine_learning/data_frame_analytics.ts +++ b/x-pack/test/functional/services/machine_learning/data_frame_analytics.ts @@ -3,15 +3,51 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import { ProvidedType } from '@kbn/test/types/ftr'; import { FtrProviderContext } from '../../ftr_provider_context'; +import { MachineLearningAPIProvider } from './api'; -export function MachineLearningDataFrameAnalyticsProvider({ getService }: FtrProviderContext) { +import { DATA_FRAME_TASK_STATE } from '../../../../legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/common'; + +export function MachineLearningDataFrameAnalyticsProvider( + { getService }: FtrProviderContext, + mlApi: ProvidedType +) { const testSubjects = getService('testSubjects'); return { + async assertAnalyticsListPageExists() { + await testSubjects.existOrFail('mlPageDataFrameAnalytics'); + }, + async assertEmptyListMessageExists() { await testSubjects.existOrFail('mlNoDataFrameAnalyticsFound'); }, + + async assertAnalyticsTableExists() { + await testSubjects.existOrFail('~mlAnalyticsTable'); + }, + + async assertCreateNewAnalyticsButtonExists() { + await testSubjects.existOrFail('mlAnalyticsButtonCreate'); + }, + + async assertAnalyticsStatsBarExists() { + await testSubjects.existOrFail('mlAnalyticsStatsBar'); + }, + + async startAnalyticsCreation() { + if (await testSubjects.exists('mlNoDataFrameAnalyticsFound')) { + await testSubjects.click('mlAnalyticsCreateFirstButton'); + } else { + await testSubjects.click('mlAnalyticsButtonCreate'); + } + await testSubjects.existOrFail('mlAnalyticsCreateJobFlyout'); + }, + + async waitForAnalyticsCompletion(analyticsId: string) { + await mlApi.waitForAnalyticsState(analyticsId, DATA_FRAME_TASK_STATE.STOPPED); + }, }; } diff --git a/x-pack/test/functional/services/machine_learning/data_frame_analytics_creation.ts b/x-pack/test/functional/services/machine_learning/data_frame_analytics_creation.ts new file mode 100644 index 0000000000000..6531ca04f22b0 --- /dev/null +++ b/x-pack/test/functional/services/machine_learning/data_frame_analytics_creation.ts @@ -0,0 +1,307 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import expect from '@kbn/expect'; + +import { FtrProviderContext } from '../../ftr_provider_context'; + +export function MachineLearningDataFrameAnalyticsCreationProvider({ + getService, +}: FtrProviderContext) { + const testSubjects = getService('testSubjects'); + const comboBox = getService('comboBox'); + const retry = getService('retry'); + const browser = getService('browser'); + + return { + async assertJobTypeSelectExists() { + await testSubjects.existOrFail('mlAnalyticsCreateJobFlyoutJobTypeSelect'); + }, + + async assertJobTypeSelection(expectedSelection: string) { + const actualSelection = await testSubjects.getAttribute( + 'mlAnalyticsCreateJobFlyoutJobTypeSelect', + 'value' + ); + expect(actualSelection).to.eql( + expectedSelection, + `Job type selection should be '${expectedSelection}' (got '${actualSelection}')` + ); + }, + + async selectJobType(jobType: string) { + await testSubjects.selectValue('mlAnalyticsCreateJobFlyoutJobTypeSelect', jobType); + await this.assertJobTypeSelection(jobType); + }, + + async assertAdvancedEditorSwitchExists() { + await testSubjects.existOrFail(`mlAnalyticsCreateJobFlyoutAdvancedEditorSwitch`, { + allowHidden: true, + }); + }, + + async assertAdvancedEditorSwitchCheckState(expectedCheckState: boolean) { + const actualCheckState = + (await testSubjects.getAttribute( + 'mlAnalyticsCreateJobFlyoutAdvancedEditorSwitch', + 'aria-checked' + )) === 'true'; + expect(actualCheckState).to.eql( + expectedCheckState, + `Advanced editor switch check state should be ${expectedCheckState} (got ${actualCheckState})` + ); + }, + + async assertJobIdInputExists() { + await testSubjects.existOrFail('mlAnalyticsCreateJobFlyoutJobIdInput'); + }, + + async assertJobIdValue(expectedValue: string) { + const actualJobId = await testSubjects.getAttribute( + 'mlAnalyticsCreateJobFlyoutJobIdInput', + 'value' + ); + expect(actualJobId).to.eql( + expectedValue, + `Job id should be '${expectedValue}' (got '${actualJobId}')` + ); + }, + + async setJobId(jobId: string) { + await testSubjects.setValue('mlAnalyticsCreateJobFlyoutJobIdInput', jobId, { + clearWithKeyboard: true, + }); + await this.assertJobIdValue(jobId); + }, + + async assertSourceIndexInputExists() { + await testSubjects.existOrFail('mlAnalyticsCreateJobFlyoutSourceIndexSelect > comboBoxInput'); + }, + + async assertSourceIndexSelection(expectedSelection: string[]) { + const actualSelection = await comboBox.getComboBoxSelectedOptions( + 'mlAnalyticsCreateJobFlyoutSourceIndexSelect > comboBoxInput' + ); + expect(actualSelection).to.eql( + expectedSelection, + `Source index should be '${expectedSelection}' (got '${actualSelection}')` + ); + }, + + async selectSourceIndex(sourceIndex: string) { + await comboBox.set( + 'mlAnalyticsCreateJobFlyoutSourceIndexSelect > comboBoxInput', + sourceIndex + ); + await this.assertSourceIndexSelection([sourceIndex]); + }, + + async assertDestIndexInputExists() { + await testSubjects.existOrFail('mlAnalyticsCreateJobFlyoutDestinationIndexInput'); + }, + + async assertDestIndexValue(expectedValue: string) { + const actualDestIndex = await testSubjects.getAttribute( + 'mlAnalyticsCreateJobFlyoutDestinationIndexInput', + 'value' + ); + expect(actualDestIndex).to.eql( + expectedValue, + `Destination index should be '${expectedValue}' (got '${actualDestIndex}')` + ); + }, + + async setDestIndex(destIndex: string) { + await testSubjects.setValue('mlAnalyticsCreateJobFlyoutDestinationIndexInput', destIndex, { + clearWithKeyboard: true, + }); + await this.assertDestIndexValue(destIndex); + }, + + async assertDependentVariableInputExists() { + await testSubjects.existOrFail( + 'mlAnalyticsCreateJobFlyoutDependentVariableSelect > comboBoxInput' + ); + }, + + async assertDependentVariableInputMissing() { + await testSubjects.missingOrFail( + 'mlAnalyticsCreateJobFlyoutDependentVariableSelect > comboBoxInput' + ); + }, + + async assertDependentVariableSelection(expectedSelection: string[]) { + const actualSelection = await comboBox.getComboBoxSelectedOptions( + 'mlAnalyticsCreateJobFlyoutDependentVariableSelect > comboBoxInput' + ); + expect(actualSelection).to.eql( + expectedSelection, + `Dependent variable should be '${expectedSelection}' (got '${actualSelection}')` + ); + }, + + async selectDependentVariable(dependentVariable: string) { + await comboBox.set( + 'mlAnalyticsCreateJobFlyoutDependentVariableSelect > comboBoxInput', + dependentVariable + ); + await this.assertDependentVariableSelection([dependentVariable]); + }, + + async assertTrainingPercentInputExists() { + await testSubjects.existOrFail('mlAnalyticsCreateJobFlyoutTrainingPercentSlider'); + }, + + async assertTrainingPercentInputMissing() { + await testSubjects.missingOrFail('mlAnalyticsCreateJobFlyoutTrainingPercentSlider'); + }, + + async assertTrainingPercentValue(expectedValue: string) { + const actualTrainingPercent = await testSubjects.getAttribute( + 'mlAnalyticsCreateJobFlyoutTrainingPercentSlider', + 'value' + ); + expect(actualTrainingPercent).to.eql( + expectedValue, + `Training percent should be '${expectedValue}' (got '${actualTrainingPercent}')` + ); + }, + + async setTrainingPercent(trainingPercent: string) { + const slider = await testSubjects.find('mlAnalyticsCreateJobFlyoutTrainingPercentSlider'); + + let currentValue = await slider.getAttribute('value'); + let currentDiff = +currentValue - +trainingPercent; + + await retry.tryForTime(60 * 1000, async () => { + if (currentDiff === 0) { + return true; + } else { + if (currentDiff > 0) { + if (Math.abs(currentDiff) >= 10) { + slider.type(browser.keys.PAGE_DOWN); + } else { + slider.type(browser.keys.ARROW_LEFT); + } + } else { + if (Math.abs(currentDiff) >= 10) { + slider.type(browser.keys.PAGE_UP); + } else { + slider.type(browser.keys.ARROW_RIGHT); + } + } + await retry.tryForTime(1000, async () => { + const newValue = await slider.getAttribute('value'); + if (newValue !== currentValue) { + currentValue = newValue; + currentDiff = +currentValue - +trainingPercent; + return true; + } else { + throw new Error(`slider value should have changed, but is still ${currentValue}`); + } + }); + + throw new Error(`slider value should be '${trainingPercent}' (got '${currentValue}')`); + } + }); + + await this.assertTrainingPercentValue(trainingPercent); + }, + + async assertModelMemoryInputExists() { + await testSubjects.existOrFail('mlAnalyticsCreateJobFlyoutModelMemoryInput'); + }, + + async assertModelMemoryValue(expectedValue: string) { + const actualModelMemory = await testSubjects.getAttribute( + 'mlAnalyticsCreateJobFlyoutModelMemoryInput', + 'value' + ); + expect(actualModelMemory).to.eql( + expectedValue, + `Model memory limit should be '${expectedValue}' (got '${actualModelMemory}')` + ); + }, + + async setModelMemory(modelMemory: string) { + await testSubjects.setValue('mlAnalyticsCreateJobFlyoutModelMemoryInput', modelMemory, { + clearWithKeyboard: true, + }); + await this.assertModelMemoryValue(modelMemory); + }, + + async assertCreateIndexPatternSwitchExists() { + await testSubjects.existOrFail(`mlAnalyticsCreateJobFlyoutCreateIndexPatternSwitch`, { + allowHidden: true, + }); + }, + + async getCreateIndexPatternSwitchCheckState(): Promise { + const state = await testSubjects.getAttribute( + 'mlAnalyticsCreateJobFlyoutCreateIndexPatternSwitch', + 'aria-checked' + ); + return state === 'true'; + }, + + async assertCreateIndexPatternSwitchCheckState(expectedCheckState: boolean) { + const actualCheckState = await this.getCreateIndexPatternSwitchCheckState(); + expect(actualCheckState).to.eql( + expectedCheckState, + `Create index pattern switch check state should be ${expectedCheckState} (got ${actualCheckState})` + ); + }, + + async setCreateIndexPatternSwitchState(checkState: boolean) { + if ((await this.getCreateIndexPatternSwitchCheckState()) !== checkState) { + await testSubjects.click('mlAnalyticsCreateJobFlyoutCreateIndexPatternSwitch'); + } + await this.assertCreateIndexPatternSwitchCheckState(checkState); + }, + + async assertCreateButtonExists() { + await testSubjects.existOrFail('mlAnalyticsCreateJobFlyoutCreateButton'); + }, + + async assertCreateButtonMissing() { + await testSubjects.missingOrFail('mlAnalyticsCreateJobFlyoutCreateButton'); + }, + + async createAnalyticsJob() { + await testSubjects.click('mlAnalyticsCreateJobFlyoutCreateButton'); + await retry.tryForTime(5000, async () => { + await this.assertCreateButtonMissing(); + await this.assertStartButtonExists(); + }); + }, + + async assertStartButtonExists() { + await testSubjects.existOrFail('mlAnalyticsCreateJobFlyoutStartButton'); + }, + + async assertStartButtonMissing() { + await testSubjects.missingOrFail('mlAnalyticsCreateJobFlyoutStartButton'); + }, + + async startAnalyticsJob() { + await testSubjects.click('mlAnalyticsCreateJobFlyoutStartButton'); + await retry.tryForTime(5000, async () => { + await this.assertStartButtonMissing(); + await this.assertCloseButtonExists(); + }); + }, + + async assertCloseButtonExists() { + await testSubjects.existOrFail('mlAnalyticsCreateJobFlyoutCloseButton'); + }, + + async closeCreateAnalyticsJobFlyout() { + await testSubjects.click('mlAnalyticsCreateJobFlyoutCloseButton'); + await retry.tryForTime(5000, async () => { + await testSubjects.missingOrFail('mlAnalyticsCreateJobFlyout'); + }); + }, + }; +} diff --git a/x-pack/test/functional/services/machine_learning/data_frame_analytics_table.ts b/x-pack/test/functional/services/machine_learning/data_frame_analytics_table.ts new file mode 100644 index 0000000000000..17a7cfd4775eb --- /dev/null +++ b/x-pack/test/functional/services/machine_learning/data_frame_analytics_table.ts @@ -0,0 +1,97 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import expect from '@kbn/expect'; + +import { WebElementWrapper } from 'test/functional/services/lib/web_element_wrapper'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export function MachineLearningDataFrameAnalyticsTableProvider({ getService }: FtrProviderContext) { + const testSubjects = getService('testSubjects'); + + return new (class AnalyticsTable { + public async parseAnalyticsTable() { + const table = await testSubjects.find('~mlAnalyticsTable'); + const $ = await table.parseDomContent(); + const rows = []; + + for (const tr of $.findTestSubjects('~mlAnalyticsTableRow').toArray()) { + const $tr = $(tr); + + rows.push({ + id: $tr + .findTestSubject('mlAnalyticsTableColumnId') + .find('.euiTableCellContent') + .text() + .trim(), + sourceIndex: $tr + .findTestSubject('mlAnalyticsTableColumnSourceIndex') + .find('.euiTableCellContent') + .text() + .trim(), + destinationIndex: $tr + .findTestSubject('mlAnalyticsTableColumnDestIndex') + .find('.euiTableCellContent') + .text() + .trim(), + type: $tr + .findTestSubject('mlAnalyticsTableColumnType') + .find('.euiTableCellContent') + .text() + .trim(), + status: $tr + .findTestSubject('mlAnalyticsTableColumnStatus') + .find('.euiTableCellContent') + .text() + .trim(), + progress: $tr + .findTestSubject('mlAnalyticsTableColumnProgress') + .findTestSubject('mlAnalyticsTableProgress') + .attr('value'), + }); + } + + return rows; + } + + public async refreshAnalyticsTable() { + await testSubjects.click('mlAnalyticsRefreshListButton'); + await this.waitForAnalyticsToLoad(); + } + + public async waitForAnalyticsToLoad() { + await testSubjects.existOrFail('~mlAnalyticsTable', { timeout: 60 * 1000 }); + await testSubjects.existOrFail('mlAnalyticsTable loaded', { timeout: 30 * 1000 }); + } + + async getAnalyticsSearchInput(): Promise { + const tableListContainer = await testSubjects.find('mlAnalyticsTableContainer'); + return await tableListContainer.findByClassName('euiFieldSearch'); + } + + async assertAnalyticsSearchInputValue(expectedSearchValue: string) { + const searchBarInput = await this.getAnalyticsSearchInput(); + const actualSearchValue = await searchBarInput.getAttribute('value'); + expect(actualSearchValue).to.eql( + expectedSearchValue, + `Analytics search input value should be '${expectedSearchValue}' (got '${actualSearchValue}')` + ); + } + + public async filterWithSearchString(filter: string) { + await this.waitForAnalyticsToLoad(); + const searchBarInput = await this.getAnalyticsSearchInput(); + await searchBarInput.clearValueWithKeyboard(); + await searchBarInput.type(filter); + await this.assertAnalyticsSearchInputValue(filter); + } + + public async assertAnalyticsRowFields(analyticsId: string, expectedRow: object) { + const rows = await this.parseAnalyticsTable(); + const analyticsRow = rows.filter(row => row.id === analyticsId)[0]; + expect(analyticsRow).to.eql(expectedRow); + } + })(); +} diff --git a/x-pack/test/functional/services/machine_learning/index.ts b/x-pack/test/functional/services/machine_learning/index.ts index f0ec101289362..c62b714f566e9 100644 --- a/x-pack/test/functional/services/machine_learning/index.ts +++ b/x-pack/test/functional/services/machine_learning/index.ts @@ -7,6 +7,8 @@ export { MachineLearningAnomalyExplorerProvider } from './anomaly_explorer'; export { MachineLearningAPIProvider } from './api'; export { MachineLearningDataFrameAnalyticsProvider } from './data_frame_analytics'; +export { MachineLearningDataFrameAnalyticsCreationProvider } from './data_frame_analytics_creation'; +export { MachineLearningDataFrameAnalyticsTableProvider } from './data_frame_analytics_table'; export { MachineLearningDataVisualizerProvider } from './data_visualizer'; export { MachineLearningDataVisualizerIndexBasedProvider } from './data_visualizer_index_based'; export { MachineLearningJobManagementProvider } from './job_management'; diff --git a/x-pack/test/functional/services/machine_learning/job_wizard_advanced.ts b/x-pack/test/functional/services/machine_learning/job_wizard_advanced.ts index ec1c003653522..27768f784b1c5 100644 --- a/x-pack/test/functional/services/machine_learning/job_wizard_advanced.ts +++ b/x-pack/test/functional/services/machine_learning/job_wizard_advanced.ts @@ -7,10 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; -export function MachineLearningJobWizardAdvancedProvider({ - getService, - getPageObjects, -}: FtrProviderContext) { +export function MachineLearningJobWizardAdvancedProvider({ getService }: FtrProviderContext) { const comboBox = getService('comboBox'); const testSubjects = getService('testSubjects'); const retry = getService('retry'); diff --git a/x-pack/test/functional/services/ml.ts b/x-pack/test/functional/services/ml.ts index 5851d2b9b116c..86967dfd1e273 100644 --- a/x-pack/test/functional/services/ml.ts +++ b/x-pack/test/functional/services/ml.ts @@ -10,6 +10,8 @@ import { MachineLearningAnomalyExplorerProvider, MachineLearningAPIProvider, MachineLearningDataFrameAnalyticsProvider, + MachineLearningDataFrameAnalyticsCreationProvider, + MachineLearningDataFrameAnalyticsTableProvider, MachineLearningDataVisualizerProvider, MachineLearningDataVisualizerIndexBasedProvider, MachineLearningJobManagementProvider, @@ -28,7 +30,9 @@ import { export function MachineLearningProvider(context: FtrProviderContext) { const anomalyExplorer = MachineLearningAnomalyExplorerProvider(context); const api = MachineLearningAPIProvider(context); - const dataFrameAnalytics = MachineLearningDataFrameAnalyticsProvider(context); + const dataFrameAnalytics = MachineLearningDataFrameAnalyticsProvider(context, api); + const dataFrameAnalyticsCreation = MachineLearningDataFrameAnalyticsCreationProvider(context); + const dataFrameAnalyticsTable = MachineLearningDataFrameAnalyticsTableProvider(context); const dataVisualizer = MachineLearningDataVisualizerProvider(context); const dataVisualizerIndexBased = MachineLearningDataVisualizerIndexBasedProvider(context); const jobManagement = MachineLearningJobManagementProvider(context, api); @@ -47,6 +51,8 @@ export function MachineLearningProvider(context: FtrProviderContext) { anomalyExplorer, api, dataFrameAnalytics, + dataFrameAnalyticsCreation, + dataFrameAnalyticsTable, dataVisualizer, dataVisualizerIndexBased, jobManagement, diff --git a/x-pack/test/typings/encode_uri_query.d.ts b/x-pack/test/typings/encode_uri_query.d.ts new file mode 100644 index 0000000000000..e1ab5f4a70abf --- /dev/null +++ b/x-pack/test/typings/encode_uri_query.d.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +declare module 'encode-uri-query' { + function encodeUriQuery(query: string, usePercentageSpace?: boolean): string; + // eslint-disable-next-line import/no-default-export + export default encodeUriQuery; +} diff --git a/x-pack/test/typings/rison_node.d.ts b/x-pack/test/typings/rison_node.d.ts new file mode 100644 index 0000000000000..ec8e5c1f407ad --- /dev/null +++ b/x-pack/test/typings/rison_node.d.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +declare module 'rison-node' { + export type RisonValue = null | boolean | number | string | RisonObject | RisonArray; + + // eslint-disable-next-line @typescript-eslint/no-empty-interface + export interface RisonArray extends Array {} + + export interface RisonObject { + [key: string]: RisonValue; + } + + export const decode: (input: string) => RisonValue; + + // eslint-disable-next-line @typescript-eslint/camelcase + export const decode_object: (input: string) => RisonObject; + + export const encode: (input: Input) => string; + + // eslint-disable-next-line @typescript-eslint/camelcase + export const encode_object: (input: Input) => string; +}