From 72ac7413c920a0b2f631dc5beee4f04a12c66565 Mon Sep 17 00:00:00 2001 From: "Quynh Nguyen (Quinn)" <43350163+qn895@users.noreply.github.com> Date: Fri, 3 May 2024 11:08:37 -0500 Subject: [PATCH] [ML] Adds serverless functional test for Frozen data tier control and ES|QL data visualizer links (#181193) ## Summary This PR adds functional test for Frozen data tier control in serverless (observability and security). It also asserts ES|QL data visualizer links do not show in serverless projects. ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../components/full_time_range_selector.tsx | 1 + .../index_data_visualizer_esql.tsx | 1 + .../esql/use_data_visualizer_esql_data.tsx | 37 ++++++++++--------- .../hooks/esql/use_esql_overall_stats_data.ts | 3 +- .../categorization_job.ts | 1 + .../convert_jobs_to_advanced_job.ts | 1 + .../multi_metric_job.ts | 1 + .../anomaly_detection_jobs/population_job.ts | 1 + .../saved_search_job.ts | 1 + .../single_metric_job.ts | 1 + ...ingle_metric_job_without_datafeed_start.ts | 1 + ...ex_data_visualizer_data_view_management.ts | 1 + .../index_pattern/creation_index_pattern.ts | 1 + .../test/functional/services/ml/common_ui.ts | 9 +++++ .../services/ml/job_wizard_common.ts | 9 +++++ .../services/transform/date_picker.ts | 17 +++++++++ .../management/transforms/transform_list.ts | 22 ++++++++++- .../ml/anomaly_detection_jobs_list.ts | 24 ++++++++++++ .../observability/ml/search_bar_features.ts | 1 + .../search/ml/search_bar_features.ts | 1 + .../ml/anomaly_detection_jobs_list.ts | 25 ++++++++++++- .../security/ml/search_bar_features.ts | 1 + 22 files changed, 140 insertions(+), 20 deletions(-) diff --git a/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx b/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx index 1549a73c93334..da0740f884ea9 100644 --- a/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx +++ b/x-pack/packages/ml/date_picker/src/components/full_time_range_selector.tsx @@ -239,6 +239,7 @@ export const FullTimeRangeSelector: FC = (props) => id={'mlFullTimeRangeSelectorOption'} button={ = (dataVi setLocalQuery(q); } }, []); + return ( { - // When user submits a new query - // resets all current requests and other data - if (cancelOverallStatsRequest) { - cancelOverallStatsRequest(); - } - if (cancelFieldStatsRequest) { - cancelFieldStatsRequest(); - } - // Reset field stats to fetch state - setFieldStatFieldsToFetch(undefined); - setMetricConfigs(defaults.metricConfigs); - setNonMetricConfigs(defaults.nonMetricConfigs); - if (isESQLQuery(q) && setQuery) { - setQuery(q); - } - }; + const onQueryUpdate = useCallback( + async (q?: AggregateQuery) => { + // When user submits a new query + // resets all current requests and other data + if (cancelOverallStatsRequest) { + cancelOverallStatsRequest(); + } + if (cancelFieldStatsRequest) { + cancelFieldStatsRequest(); + } + // Reset field stats to fetch state + setFieldStatFieldsToFetch(undefined); + setMetricConfigs(defaults.metricConfigs); + setNonMetricConfigs(defaults.nonMetricConfigs); + if (isESQLQuery(q) && setQuery) { + setQuery(q); + } + }, + [cancelFieldStatsRequest, cancelOverallStatsRequest, setQuery] + ); return { totalCount, diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/esql/use_esql_overall_stats_data.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/esql/use_esql_overall_stats_data.ts index 165e00624489b..0ab96e4450424 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/esql/use_esql_overall_stats_data.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/esql/use_esql_overall_stats_data.ts @@ -455,13 +455,14 @@ export const useESQLOverallStatsData = ( title: fieldStatsErrorTitle, }); } + setQueryHistoryStatus(false); // Log error to console for better debugging // eslint-disable-next-line no-console console.error(`${fieldStatsErrorTitle}: fetchOverallStats`, error); } }, // eslint-disable-next-line react-hooks/exhaustive-deps - [runRequest, toasts, JSON.stringify({ fieldStatsRequest }), onError] + [JSON.stringify({ fieldStatsRequest })] ); // auto-update diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/categorization_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/categorization_job.ts index cbdc873286f07..07929a8f9b6f9 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/categorization_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/categorization_job.ts @@ -117,6 +117,7 @@ export default function ({ getService }: FtrProviderContext) { it('job creation navigates through the categorization wizard and sets all needed fields', async () => { await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); + await ml.commonUI.assertDatePickerDataTierOptionsVisible(true); await ml.testExecution.logTestStep('job creation sets the time range'); await ml.jobWizardCommon.clickUseFullDataButton( diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/convert_jobs_to_advanced_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/convert_jobs_to_advanced_job.ts index 4ca0079a0e438..74ac24987926d 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/convert_jobs_to_advanced_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/convert_jobs_to_advanced_job.ts @@ -280,6 +280,7 @@ export default function ({ getService }: FtrProviderContext) { it('multi-metric job creation navigates through the multi-metric job wizard and sets all needed fields', async () => { await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); + await ml.commonUI.assertDatePickerDataTierOptionsVisible(true); await ml.testExecution.logTestStep('job creation sets the time range'); await ml.jobWizardCommon.clickUseFullDataButton( diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/multi_metric_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/multi_metric_job.ts index fa2e5d11eca0e..24f385704bd71 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/multi_metric_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/multi_metric_job.ts @@ -114,6 +114,7 @@ export default function ({ getService }: FtrProviderContext) { it('job creation navigates through the multi metric wizard and sets all needed fields', async () => { await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); + await ml.commonUI.assertDatePickerDataTierOptionsVisible(true); await ml.testExecution.logTestStep('job creation sets the time range'); await ml.jobWizardCommon.clickUseFullDataButton( diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/population_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/population_job.ts index 5451ea16d8e4c..3095f49d2d7c5 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/population_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/population_job.ts @@ -128,6 +128,7 @@ export default function ({ getService }: FtrProviderContext) { it('job creation navigates through the population wizard and sets all needed fields', async () => { await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); + await ml.commonUI.assertDatePickerDataTierOptionsVisible(true); await ml.testExecution.logTestStep('job creation sets the time range'); await ml.jobWizardCommon.clickUseFullDataButton( diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/saved_search_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/saved_search_job.ts index b8493e2daa1b6..414230b0b73a1 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/saved_search_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/saved_search_job.ts @@ -308,6 +308,7 @@ export default function ({ getService }: FtrProviderContext) { it('job creation navigates through the multi metric wizard and sets all needed fields', async () => { await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); + await ml.commonUI.assertDatePickerDataTierOptionsVisible(true); await ml.testExecution.logTestStep('job creation sets the time range'); await ml.jobWizardCommon.clickUseFullDataButton( diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_metric_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_metric_job.ts index 7ce5d1838a1a5..8b29adf3d5384 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_metric_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_metric_job.ts @@ -122,6 +122,7 @@ export default function ({ getService }: FtrProviderContext) { it('job creation navigates through the single metric wizard and sets all needed fields', async () => { await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); + await ml.commonUI.assertDatePickerDataTierOptionsVisible(true); await ml.testExecution.logTestStep('job creation sets the time range'); await ml.jobWizardCommon.clickUseFullDataButton( diff --git a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_metric_job_without_datafeed_start.ts b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_metric_job_without_datafeed_start.ts index 7d1724fbd0181..e137f366628e7 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_metric_job_without_datafeed_start.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection_jobs/single_metric_job_without_datafeed_start.ts @@ -89,6 +89,7 @@ export default function ({ getService }: FtrProviderContext) { it('job creation navigates through the single metric wizard and sets all needed fields', async () => { await ml.testExecution.logTestStep('job creation displays the time range step'); await ml.jobWizardCommon.assertTimeRangeSectionExists(); + await ml.commonUI.assertDatePickerDataTierOptionsVisible(true); await ml.testExecution.logTestStep('job creation sets the time range'); await ml.jobWizardCommon.clickUseFullDataButton( diff --git a/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_data_view_management.ts b/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_data_view_management.ts index 28611dbcb8a1b..01ce91b96a760 100644 --- a/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_data_view_management.ts +++ b/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_data_view_management.ts @@ -134,6 +134,7 @@ export default function ({ getService }: FtrProviderContext) { await ml.dataVisualizerIndexBased.clickUseFullDataButton( testData.expected.totalDocCountFormatted ); + await ml.commonUI.assertDatePickerDataTierOptionsVisible(true); } async function checkPageDetails(testData: TestData) { diff --git a/x-pack/test/functional/apps/transform/creation/index_pattern/creation_index_pattern.ts b/x-pack/test/functional/apps/transform/creation/index_pattern/creation_index_pattern.ts index 93e2fe767bdd6..f72e3f666c362 100644 --- a/x-pack/test/functional/apps/transform/creation/index_pattern/creation_index_pattern.ts +++ b/x-pack/test/functional/apps/transform/creation/index_pattern/creation_index_pattern.ts @@ -561,6 +561,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await transform.testExecution.logTestStep('again displays an empty index preview'); await transform.wizard.assertIndexPreviewEmpty(); + await transform.datePicker.assertDatePickerDataTierOptionsVisible(true); await transform.testExecution.logTestStep( `clicks the 'Use full data' button to auto-select time range` diff --git a/x-pack/test/functional/services/ml/common_ui.ts b/x-pack/test/functional/services/ml/common_ui.ts index 9183cf42ab041..ef2605a716dbf 100644 --- a/x-pack/test/functional/services/ml/common_ui.ts +++ b/x-pack/test/functional/services/ml/common_ui.ts @@ -438,5 +438,14 @@ export function MachineLearningCommonUIProvider({ } }); }, + + async assertDatePickerDataTierOptionsVisible(shouldBeVisible: boolean) { + const selector = 'mlDatePickerButtonDataTierOptions'; + if (shouldBeVisible === true) { + await testSubjects.existOrFail(selector); + } else { + await testSubjects.missingOrFail(selector); + } + }, }; } diff --git a/x-pack/test/functional/services/ml/job_wizard_common.ts b/x-pack/test/functional/services/ml/job_wizard_common.ts index 9d9c91f500456..e1e5b4ea0d45b 100644 --- a/x-pack/test/functional/services/ml/job_wizard_common.ts +++ b/x-pack/test/functional/services/ml/job_wizard_common.ts @@ -534,6 +534,15 @@ export function MachineLearningJobWizardCommonProvider( }); }, + async assertUseFullDataButtonVisible(shouldBeVisible: boolean) { + const selector = 'mlDatePickerButtonUseFullData'; + if (shouldBeVisible === true) { + await testSubjects.existOrFail(selector); + } else { + await testSubjects.missingOrFail(selector); + } + }, + async clickUseFullDataButton(expectedStartDate: string, expectedEndDate: string) { await testSubjects.clickWhenNotDisabledWithoutRetry('mlDatePickerButtonUseFullData'); await this.assertDateRangeSelection(expectedStartDate, expectedEndDate); diff --git a/x-pack/test/functional/services/transform/date_picker.ts b/x-pack/test/functional/services/transform/date_picker.ts index c872c431a5d2b..8752a398c2276 100644 --- a/x-pack/test/functional/services/transform/date_picker.ts +++ b/x-pack/test/functional/services/transform/date_picker.ts @@ -49,6 +49,23 @@ export function TransformDatePickerProvider({ getService, getPageObjects }: FtrP await pageObjects.timePicker.setAbsoluteRange(fromTime, toTime); }, + async assertUseFullDataButtonVisible(shouldBeVisible: boolean) { + const selector = 'mlDatePickerButtonUseFullData'; + if (shouldBeVisible === true) { + await testSubjects.existOrFail(selector); + } else { + await testSubjects.missingOrFail(selector); + } + }, + async assertDatePickerDataTierOptionsVisible(shouldBeVisible: boolean) { + const selector = 'mlDatePickerButtonDataTierOptions'; + if (shouldBeVisible === true) { + await testSubjects.existOrFail(selector); + } else { + await testSubjects.missingOrFail(selector); + } + }, + async clickUseFullDataButton(expectedTimeConfig: { start: string; end: string }) { await testSubjects.existOrFail('mlDatePickerButtonUseFullData'); await testSubjects.clickWhenNotDisabledWithoutRetry('mlDatePickerButtonUseFullData'); diff --git a/x-pack/test_serverless/functional/test_suites/common/management/transforms/transform_list.ts b/x-pack/test_serverless/functional/test_suites/common/management/transforms/transform_list.ts index a7b0a83d56af2..8929887d2ca86 100644 --- a/x-pack/test_serverless/functional/test_suites/common/management/transforms/transform_list.ts +++ b/x-pack/test_serverless/functional/test_suites/common/management/transforms/transform_list.ts @@ -13,17 +13,30 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const browser = getService('browser'); const security = getService('security'); const transform = getService('transform'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); describe('Transform List', function () { before(async () => { await security.testUser.setRoles(['transform_user']); await pageObjects.svlCommonPage.loginAsAdmin(); + // Load logstash* data and create dataview for logstash*, logstash-2015.09.22 + await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional'); + await kibanaServer.importExport.load( + 'x-pack/test/functional/fixtures/kbn_archiver/visualize/default' + ); + // For this test to work, make sure there are no pre-existing transform present. // For example, solutions might set up transforms automatically. await transform.api.cleanTransformIndices(); }); + after(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/logstash_functional'); + await kibanaServer.savedObjects.cleanStandardList(); + }); + it('renders the transform list', async () => { await transform.testExecution.logTestStep('should load the Transform list page'); await transform.navigation.navigateTo(); @@ -39,10 +52,17 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await transform.management.assertNoTransformsFoundMessageExists(); await transform.testExecution.logTestStep( - 'should display a disabled "Create first transform" button' + 'should display an enabled "Create first transform" button' ); await transform.management.assertCreateFirstTransformButtonExists(); await transform.management.assertCreateFirstTransformButtonEnabled(true); }); + + it('opens transform creation wizard', async () => { + await transform.management.startTransformCreation(); + await transform.sourceSelection.selectSource('logstash-2015.09.22'); + await transform.datePicker.assertUseFullDataButtonVisible(true); + await transform.datePicker.assertDatePickerDataTierOptionsVisible(false); + }); }); }; diff --git a/x-pack/test_serverless/functional/test_suites/observability/ml/anomaly_detection_jobs_list.ts b/x-pack/test_serverless/functional/test_suites/observability/ml/anomaly_detection_jobs_list.ts index 05382e03f78d0..f4d0077f6b73c 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/ml/anomaly_detection_jobs_list.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/ml/anomaly_detection_jobs_list.ts @@ -12,6 +12,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const svlMl = getService('svlMl'); const PageObjects = getPageObjects(['svlCommonPage']); const adJobId = 'fq_single_permission'; + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); describe('Anomaly detection jobs list', function () { // Error: Failed to delete all indices with pattern [.ml-*] @@ -19,6 +21,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { before(async () => { await PageObjects.svlCommonPage.login(); + // Load logstash* data and create dataview for logstash*, logstash-2015.09.22 + await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional'); + await kibanaServer.importExport.load( + 'x-pack/test/functional/fixtures/kbn_archiver/visualize/default' + ); + await ml.api.createAnomalyDetectionJob(ml.commonConfig.getADFqMultiMetricJobConfig(adJobId)); }); @@ -26,6 +34,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.svlCommonPage.forceLogout(); await ml.api.cleanMlIndices(); await ml.testResources.cleanMLSavedObjects(); + await esArchiver.unload('x-pack/test/functional/es_archives/logstash_functional'); + await kibanaServer.savedObjects.cleanStandardList(); }); describe('page navigation', () => { @@ -49,6 +59,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await ml.jobTable.assertJobActionSingleMetricViewerButtonEnabled(adJobId, true); await ml.jobTable.assertJobActionAnomalyExplorerButtonEnabled(adJobId, true); }); + describe('job creation', () => { + it('does not show exclude frozen data tier control in wizard', async () => { + await ml.testExecution.logTestStep('loads the anomaly detection creation wizard'); + await ml.navigation.navigateToMl(); + await svlMl.navigation.observability.navigateToAnomalyDetection(); + await ml.jobManagement.navigateToNewJobSourceSelection(); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('logstash-2015.09.22'); + await ml.jobTypeSelection.selectCategorizationJob(); + + await ml.testExecution.logTestStep('shows full data button, but not data tier control'); + await ml.jobWizardCommon.assertUseFullDataButtonVisible(true); + await ml.commonUI.assertDatePickerDataTierOptionsVisible(false); + }); + }); }); }); } diff --git a/x-pack/test_serverless/functional/test_suites/observability/ml/search_bar_features.ts b/x-pack/test_serverless/functional/test_suites/observability/ml/search_bar_features.ts index 0ac2e4e09bc39..fec1fbd9d3646 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/ml/search_bar_features.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/ml/search_bar_features.ts @@ -34,6 +34,7 @@ export default function ({ getPageObjects }: FtrProviderContext) { { label: 'Machine Learning / Data Visualizer', expected: true }, { label: 'Machine Learning / File Upload', expected: true }, { label: 'Machine Learning / Index Data Visualizer', expected: true }, + { label: 'Machine Learning / ES|QL Data Visualizer', expected: true }, { label: 'Machine Learning / Data Drift', expected: true }, { label: 'Alerts and Insights / Machine Learning', expected: true }, ]; diff --git a/x-pack/test_serverless/functional/test_suites/search/ml/search_bar_features.ts b/x-pack/test_serverless/functional/test_suites/search/ml/search_bar_features.ts index cdedf3248c191..177174b4675e4 100644 --- a/x-pack/test_serverless/functional/test_suites/search/ml/search_bar_features.ts +++ b/x-pack/test_serverless/functional/test_suites/search/ml/search_bar_features.ts @@ -34,6 +34,7 @@ export default function ({ getPageObjects }: FtrProviderContext) { { label: 'Machine Learning / Data Visualizer', expected: true }, { label: 'Machine Learning / File Upload', expected: true }, { label: 'Machine Learning / Index Data Visualizer', expected: true }, + { label: 'Machine Learning / ES|QL Data Visualizer', expected: true }, { label: 'Machine Learning / Data Drift', expected: true }, { label: 'Alerts and Insights / Machine Learning', expected: true }, ]; diff --git a/x-pack/test_serverless/functional/test_suites/security/ml/anomaly_detection_jobs_list.ts b/x-pack/test_serverless/functional/test_suites/security/ml/anomaly_detection_jobs_list.ts index b2257fc68e135..f73703010b877 100644 --- a/x-pack/test_serverless/functional/test_suites/security/ml/anomaly_detection_jobs_list.ts +++ b/x-pack/test_serverless/functional/test_suites/security/ml/anomaly_detection_jobs_list.ts @@ -11,13 +11,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const svlMl = getService('svlMl'); const PageObjects = getPageObjects(['svlCommonPage']); const adJobId = 'fq_single_permission'; + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); describe('Anomaly detection jobs list', function () { // Error: Failed to delete all indices with pattern [.ml-*] this.tags(['failsOnMKI']); before(async () => { await PageObjects.svlCommonPage.login(); - + // Load logstash* data and create dataview for logstash*, logstash-2015.09.22 + await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional'); + await kibanaServer.importExport.load( + 'x-pack/test/functional/fixtures/kbn_archiver/visualize/default' + ); await ml.api.createAnomalyDetectionJob(ml.commonConfig.getADFqMultiMetricJobConfig(adJobId)); }); @@ -25,6 +31,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.svlCommonPage.forceLogout(); await ml.api.cleanMlIndices(); await ml.testResources.cleanMLSavedObjects(); + await esArchiver.unload('x-pack/test/functional/es_archives/logstash_functional'); + await kibanaServer.savedObjects.cleanStandardList(); }); describe('page navigation', () => { @@ -50,5 +58,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await ml.jobTable.assertJobActionAnomalyExplorerButtonEnabled(adJobId, true); }); }); + + describe('job creation', () => { + it('does not show exclude frozen data tier control in wizard', async () => { + await ml.testExecution.logTestStep('loads the anomaly detection creation wizard'); + await ml.navigation.navigateToMl(); + await svlMl.navigation.security.navigateToAnomalyDetection(); + await ml.jobManagement.navigateToNewJobSourceSelection(); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('logstash-2015.09.22'); + await ml.jobTypeSelection.selectSingleMetricJob(); + + await ml.testExecution.logTestStep('shows full data button, but not data tier control'); + await ml.jobWizardCommon.assertUseFullDataButtonVisible(true); + await ml.commonUI.assertDatePickerDataTierOptionsVisible(false); + }); + }); }); } diff --git a/x-pack/test_serverless/functional/test_suites/security/ml/search_bar_features.ts b/x-pack/test_serverless/functional/test_suites/security/ml/search_bar_features.ts index 8d48ba2632731..35075b9f0da41 100644 --- a/x-pack/test_serverless/functional/test_suites/security/ml/search_bar_features.ts +++ b/x-pack/test_serverless/functional/test_suites/security/ml/search_bar_features.ts @@ -34,6 +34,7 @@ export default function ({ getPageObjects }: FtrProviderContext) { { label: 'Machine Learning / Data Visualizer', expected: true }, { label: 'Machine Learning / File Upload', expected: true }, { label: 'Machine Learning / Index Data Visualizer', expected: true }, + { label: 'Machine Learning / ES|QL Data Visualizer', expected: true }, { label: 'Machine Learning / Data Drift', expected: true }, { label: 'Alerts and Insights / Machine Learning', expected: true }, ];