From f17ded83618c1406934dd6b69c7890a7c13d2354 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Fri, 25 Oct 2024 12:18:24 +0200 Subject: [PATCH] [ML] AIOps: Fix and reenable functional tests for log rate analysis (#197760) ## Summary Follow up to #189863 and #196585. Related to #176387. This updates asserting the url state for log rate analysis with a query and reenables the functional tests. ### Checklist - [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 - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) (cherry picked from commit 6ef03697460aba0d3774c0c03fb7fb58c76c00bd) --- .../apps/aiops/log_rate_analysis.ts | 3 +- ...arequote_data_view_test_data_with_query.ts | 206 +++++++++--------- 2 files changed, 107 insertions(+), 102 deletions(-) diff --git a/x-pack/test/functional/apps/aiops/log_rate_analysis.ts b/x-pack/test/functional/apps/aiops/log_rate_analysis.ts index 452ba8fad99cb..d6acad691b195 100644 --- a/x-pack/test/functional/apps/aiops/log_rate_analysis.ts +++ b/x-pack/test/functional/apps/aiops/log_rate_analysis.ts @@ -315,8 +315,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); } - // Failing: See https://github.com/elastic/kibana/issues/176387 - describe.skip('log rate analysis', function () { + describe('log rate analysis', function () { for (const testData of logRateAnalysisTestData) { describe(`with '${testData.sourceIndexOrSavedSearch}'`, function () { before(async () => { diff --git a/x-pack/test/functional/apps/aiops/log_rate_analysis/test_data/farequote_data_view_test_data_with_query.ts b/x-pack/test/functional/apps/aiops/log_rate_analysis/test_data/farequote_data_view_test_data_with_query.ts index 31cfcda6924f8..e5a8b4783d7bb 100644 --- a/x-pack/test/functional/apps/aiops/log_rate_analysis/test_data/farequote_data_view_test_data_with_query.ts +++ b/x-pack/test/functional/apps/aiops/log_rate_analysis/test_data/farequote_data_view_test_data_with_query.ts @@ -64,128 +64,134 @@ export const farequoteDataViewTestDataWithQuery: TestData = { filters: [], searchQuery: { bool: { - filter: [], - must_not: [ + filter: [ { bool: { - minimum_should_match: 1, - should: [ - { - bool: { - minimum_should_match: 1, - should: [ - { - term: { - airline: { - value: 'SWR', + must_not: { + bool: { + minimum_should_match: 1, + should: [ + { + bool: { + minimum_should_match: 1, + should: [ + { + term: { + airline: { + value: 'SWR', + }, + }, }, - }, + ], }, - ], - }, - }, - { - bool: { - minimum_should_match: 1, - should: [ - { - term: { - airline: { - value: 'ACA', + }, + { + bool: { + minimum_should_match: 1, + should: [ + { + term: { + airline: { + value: 'ACA', + }, + }, }, - }, + ], }, - ], - }, - }, - { - bool: { - minimum_should_match: 1, - should: [ - { - term: { - airline: { - value: 'AWE', + }, + { + bool: { + minimum_should_match: 1, + should: [ + { + term: { + airline: { + value: 'AWE', + }, + }, }, - }, + ], }, - ], - }, - }, - { - bool: { - minimum_should_match: 1, - should: [ - { - term: { - airline: { - value: 'BAW', + }, + { + bool: { + minimum_should_match: 1, + should: [ + { + term: { + airline: { + value: 'BAW', + }, + }, }, - }, + ], }, - ], - }, - }, - { - bool: { - minimum_should_match: 1, - should: [ - { - term: { - airline: { - value: 'JAL', + }, + { + bool: { + minimum_should_match: 1, + should: [ + { + term: { + airline: { + value: 'JAL', + }, + }, }, - }, + ], }, - ], - }, - }, - { - bool: { - minimum_should_match: 1, - should: [ - { - term: { - airline: { - value: 'JBU', + }, + { + bool: { + minimum_should_match: 1, + should: [ + { + term: { + airline: { + value: 'JBU', + }, + }, }, - }, + ], }, - ], - }, - }, - { - bool: { - minimum_should_match: 1, - should: [ - { - term: { - airline: { - value: 'JZA', + }, + { + bool: { + minimum_should_match: 1, + should: [ + { + term: { + airline: { + value: 'JZA', + }, + }, }, - }, + ], }, - ], - }, - }, - { - bool: { - minimum_should_match: 1, - should: [ - { - term: { - airline: { - value: 'KLM', + }, + { + bool: { + minimum_should_match: 1, + should: [ + { + term: { + airline: { + value: 'KLM', + }, + }, }, - }, + ], }, - ], - }, + }, + ], }, - ], + }, }, }, ], + must: [], + must_not: [], + should: [], }, }, searchQueryLanguage: 'kuery',