From 1dc26c5a9e35918b2f5306aa242dab1d67732020 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Fri, 5 Nov 2021 10:28:07 +0100 Subject: [PATCH] [ML] Functional tests - stabilize and re-enable feature importance tests (#117503) This PR re-activates and stabilizes the data frame analytics feature importance tests by reducing the job run time. It also scrolls the feature importance section into view during validation so in case of a failure the screenshot shows the relevant part of the screen. --- .../feature_importance.ts | 3 ++ .../ml/data_frame_analytics_results.ts | 29 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/x-pack/test/functional/apps/ml/data_frame_analytics/feature_importance.ts b/x-pack/test/functional/apps/ml/data_frame_analytics/feature_importance.ts index 8561487dff7cb..725030605840c 100644 --- a/x-pack/test/functional/apps/ml/data_frame_analytics/feature_importance.ts +++ b/x-pack/test/functional/apps/ml/data_frame_analytics/feature_importance.ts @@ -63,6 +63,7 @@ export default function ({ getService }: FtrProviderContext) { training_percent: 35, prediction_field_name: 'CentralAir_prediction', num_top_classes: -1, + max_trees: 10, }, }, model_memory_limit: '60mb', @@ -108,6 +109,7 @@ export default function ({ getService }: FtrProviderContext) { training_percent: 35, prediction_field_name: 'heatingqc', num_top_classes: -1, + max_trees: 10, }, }, model_memory_limit: '60mb', @@ -139,6 +141,7 @@ export default function ({ getService }: FtrProviderContext) { dependent_variable: 'stab', num_top_feature_importance_values: 5, training_percent: 35, + max_trees: 10, }, }, analyzed_fields: { diff --git a/x-pack/test/functional/services/ml/data_frame_analytics_results.ts b/x-pack/test/functional/services/ml/data_frame_analytics_results.ts index a1bf8c6a65d70..cf34a1372157c 100644 --- a/x-pack/test/functional/services/ml/data_frame_analytics_results.ts +++ b/x-pack/test/functional/services/ml/data_frame_analytics_results.ts @@ -73,6 +73,7 @@ export function MachineLearningDataFrameAnalyticsResultsProvider( async assertTotalFeatureImportanceEvaluatePanelExists() { await testSubjects.existOrFail('mlDFExpandableSection-FeatureImportanceSummary'); + await this.scrollFeatureImportanceIntoView(); await testSubjects.existOrFail('mlTotalFeatureImportanceChart', { timeout: 30 * 1000 }); }, @@ -213,5 +214,33 @@ export function MachineLearningDataFrameAnalyticsResultsProvider( expect(buttonVisible).to.equal(true, 'Expected data grid cell button to be visible'); }); }, + + async scrollContentSectionIntoView(sectionId: string) { + await testSubjects.scrollIntoView(`mlDFExpandableSection-${sectionId}`); + }, + + async scrollAnalysisIntoView() { + await this.scrollContentSectionIntoView('analysis'); + }, + + async scrollRegressionEvaluationIntoView() { + await this.scrollContentSectionIntoView('RegressionEvaluation'); + }, + + async scrollClassificationEvaluationIntoView() { + await this.scrollContentSectionIntoView('ClassificationEvaluation'); + }, + + async scrollFeatureImportanceIntoView() { + await this.scrollContentSectionIntoView('FeatureImportanceSummary'); + }, + + async scrollScatterplotMatrixIntoView() { + await this.scrollContentSectionIntoView('splom'); + }, + + async scrollResultsIntoView() { + await this.scrollContentSectionIntoView('results'); + }, }; }