Skip to content

Commit

Permalink
[ML][AIOPS] Log rate analysis: add basic functional test (elastic#199054
Browse files Browse the repository at this point in the history
)

This PR adds a basic functional test for
[this](elastic#198179) change that adds a
switch to Rerun analysis copy if the search bar search changed.

Flaky test runner:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7344

## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.


### 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
- [ ] [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)

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
2 people authored and mbondyra committed Nov 8, 2024
1 parent 255404d commit 5a56f3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x-pack/test/functional/apps/aiops/log_rate_analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
testData.dataGenerator
);

if (testData.editedQuery && testData.query) {
await aiops.logRateAnalysisPage.setQueryInput(testData.editedQuery);
await aiops.logRateAnalysisPage.assertRerunAnalysisButtonExists(true);
await aiops.logRateAnalysisPage.setQueryInput(testData.query);
}

// At this stage the baseline and deviation brush position should be stored in
// the url state and a full browser refresh should restore the analysis.
await browser.refresh();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const farequoteDataViewTestDataWithQuery: TestData = {
fieldSelectorSearch: 'airline',
fieldSelectorApplyAvailable: true,
query: 'NOT airline:("SWR" OR "ACA" OR "AWE" OR "BAW" OR "JAL" OR "JBU" OR "JZA" OR "KLM")',
editedQuery: 'NOT airline:("SWR")',
expected: {
totalDocCountFormatted: '48,799',
analysisGroupsTable: [
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/functional/apps/aiops/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export interface TestData {
fieldSelectorSearch: string;
fieldSelectorApplyAvailable: boolean;
query?: string;
editedQuery?: string;
action?: TestDataTableActionLogPatternAnalysis;
expected: TestDataExpectedWithSampleProbability | TestDataExpectedWithoutSampleProbability;
}

0 comments on commit 5a56f3a

Please sign in to comment.