Skip to content

Commit

Permalink
[8.17] [Discover] Unskip ES|QL switch modal tests and fix other flaky…
Browse files Browse the repository at this point in the history
… tests in the same suite (#200923) (#201112)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Discover] Unskip ES|QL switch modal tests and fix other flaky tests
in the same suite
(#200923)](#200923)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-21T10:51:12Z","message":"[Discover]
Unskip ES|QL switch modal tests and fix other flaky tests in the same
suite (#200923)\n\n- Closes
https://github.com/elastic/kibana/issues/189636\r\n- Closes
https://github.com/elastic/kibana/issues/200805\r\n- Closes
https://github.com/elastic/kibana/issues/195479\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"65cb53c28ba52e06c7f4dc8d235cbb5778113cc8","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:DataDiscovery","v8.16.0","backport:version","v8.17.0","v8.18.0"],"title":"[Discover]
Unskip ES|QL switch modal tests and fix other flaky tests in the same
suite","number":200923,"url":"https://github.com/elastic/kibana/pull/200923","mergeCommit":{"message":"[Discover]
Unskip ES|QL switch modal tests and fix other flaky tests in the same
suite (#200923)\n\n- Closes
https://github.com/elastic/kibana/issues/189636\r\n- Closes
https://github.com/elastic/kibana/issues/200805\r\n- Closes
https://github.com/elastic/kibana/issues/195479\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"65cb53c28ba52e06c7f4dc8d235cbb5778113cc8"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.17","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200923","number":200923,"mergeCommit":{"message":"[Discover]
Unskip ES|QL switch modal tests and fix other flaky tests in the same
suite (#200923)\n\n- Closes
https://github.com/elastic/kibana/issues/189636\r\n- Closes
https://github.com/elastic/kibana/issues/200805\r\n- Closes
https://github.com/elastic/kibana/issues/195479\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"65cb53c28ba52e06c7f4dc8d235cbb5778113cc8"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <[email protected]>
Co-authored-by: Brad White <[email protected]>
  • Loading branch information
3 people authored Nov 21, 2024
1 parent d5ebf1e commit 07e7e3d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 12 deletions.
17 changes: 14 additions & 3 deletions test/functional/apps/discover/esql/_esql_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

it('should perform test query correctly', async function () {
await timePicker.setDefaultAbsoluteRange();
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
await discover.selectTextBaseLang();
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();

const testQuery = `from logstash-* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
await header.waitUntilLoadingHasFinished();
Expand All @@ -159,7 +163,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

it('should render when switching to a time range with no data, then back to a time range with data', async () => {
await discover.selectTextBaseLang();
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();

const testQuery = `from logstash-* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
await header.waitUntilLoadingHasFinished();
Expand All @@ -182,8 +189,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

it('should query an index pattern that doesnt translate to a dataview correctly', async function () {
await discover.selectTextBaseLang();
const testQuery = `from logstash* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();

const testQuery = `from logstash* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
await header.waitUntilLoadingHasFinished();
Expand Down Expand Up @@ -297,6 +306,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
await discover.saveSearch('esql_test2');
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
const testQuery = 'from logstash-* | limit 100 | drop @timestamp';
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
Expand Down
3 changes: 1 addition & 2 deletions test/functional/page_objects/unified_field_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,9 @@ export class UnifiedFieldListPageObject extends FtrService {

if (!isActive) {
// expand the field to show the "Visualize" button
await field.click();
await this.clickFieldListItem(fieldName);
}

await this.waitUntilFieldPopoverIsOpen();
const visualizeButtonTestSubject = `fieldVisualize-${fieldName}`;
// wrap visualize button click in retry to ensure button is clicked and retry if button click is not registered
await this.retry.try(async () => {
Expand Down
11 changes: 8 additions & 3 deletions x-pack/test/functional/apps/discover/visualize_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,19 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
describe('discover field visualize button', () => {
before(async () => {
await kibanaServer.uiSettings.replace(defaultSettings);
});
beforeEach(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
await kibanaServer.importExport.load(
'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json'
);
});

beforeEach(async () => {
await common.navigateToApp('discover');
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
await setDiscoverTimeRange();
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
});

after(async () => {
Expand All @@ -73,7 +78,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await unifiedFieldList.expectFieldListItemVisualize('bytes');
});

it('visualizes field to Lens and loads fields to the dimesion editor', async () => {
it('visualizes field to Lens and loads fields to the dimension editor', async () => {
await unifiedFieldList.findFieldByName('bytes');
await unifiedFieldList.clickFieldListItemVisualize('bytes');
await header.waitUntilLoadingHasFinished();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

it('should perform test query correctly', async function () {
await PageObjects.timePicker.setDefaultAbsoluteRange();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.selectTextBaseLang();
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
const testQuery = `from logstash-* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;

await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
Expand All @@ -157,7 +161,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

it('should render when switching to a time range with no data, then back to a time range with data', async () => {
await PageObjects.discover.selectTextBaseLang();
const testQuery = `from logstash-* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();

const testQuery = `from logstash-* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
await PageObjects.header.waitUntilLoadingHasFinished();
Expand All @@ -183,7 +190,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();

const testQuery = `from logstash* | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
const testQuery = `from logstash* | sort @timestamp | limit 10 | stats countB = count(bytes) by geo.dest | sort countB`;
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
await PageObjects.header.waitUntilLoadingHasFinished();
Expand Down Expand Up @@ -301,6 +308,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
await PageObjects.discover.saveSearch('esql_test2');
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
const testQuery = 'from logstash-* | limit 100 | drop @timestamp';
await monacoEditor.setCodeEditorValue(testQuery);
await testSubjects.click('querySubmitButton');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

beforeEach(async () => {
await PageObjects.common.navigateToApp('discover');
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
await setDiscoverTimeRange();
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitUntilSearchingHasFinished();
});

after(async () => {
Expand All @@ -64,7 +68,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.unifiedFieldList.expectFieldListItemVisualize('bytes');
});

it('visualizes field to Lens and loads fields to the dimesion editor', async () => {
it('visualizes field to Lens and loads fields to the dimension editor', async () => {
await PageObjects.unifiedFieldList.findFieldByName('bytes');
await PageObjects.unifiedFieldList.clickFieldListItemVisualize('bytes');
await PageObjects.header.waitUntilLoadingHasFinished();
Expand Down

0 comments on commit 07e7e3d

Please sign in to comment.