-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async Discover search test #64388
Async Discover search test #64388
Conversation
ACK & THX @LeeDr, will review it tomorrow |
Results of the 2 new tests;
|
@elasticmachine merge upstream |
started a flaky test runner for it, looks stable: https://kibana-ci.elastic.co/job/kibana+flaky-test-suite-runner/424/ |
Pinging @elastic/kibana-app (Team:KibanaApp) |
I ran the new test 42 times on the flaky test runner and all passed. |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Last Jenkins job test failure indicates some problem loading data;
|
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@kertal remember this PR? :-) It fell out of date but I've got it up and passing again if you have a chance to review it. |
@LeeDr thx, sure, how could I forget :), will review it |
// changing the timepicker default here saves us from having to set it in Discover (~8s) | ||
await kibanaServer.uiSettings.update({ | ||
'timepicker:timeDefaults': | ||
'{ "from": "Sep 18, 2015 @ 19:37:13.000", "to": "Sep 23, 2015 @ 02:30:09.000"}', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is nice, imagine how much time would be saved if we regularly do it that way. which reminds me, I recently created a helper for that, in the TimePickerProvider, but it's using a different start, end time
async setDefaultAbsoluteRangeViaUiSettings() { |
await kibanaServer.uiSettings.replace({}); | ||
await kibanaServer.uiSettings.update({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a question, there is no way to replace a single uiSetting ? just asking because of
async resetDefaultAbsoluteRangeViaUiSettings() { |
/* If you had to modify the scripted fields, you could un-comment all this, run it, use es_archiver to update 'kibana_scripted_fields_on_logstash' | ||
*/ | ||
|
||
// await PageObjects.settings.navigateTo(); | ||
// await PageObjects.settings.clickKibanaIndexPatterns(); | ||
// await PageObjects.settings.createIndexPattern('logsta'); | ||
// await PageObjects.settings.clickScriptedFieldsTab(); | ||
// await log.debug('add scripted field'); | ||
// await PageObjects.settings.addScriptedField( | ||
// 'sharedFail', | ||
// 'painless', | ||
// 'string', | ||
// null, | ||
// '1', | ||
// // Scripted field below with multiple string checking actually should cause share failure message | ||
// // bcause it's not checking if all the fields it uses exist in each doc (and they don't) | ||
// "if (doc['response.raw'].value == '200') { return 'good ' + doc['url.raw'].value } else { return 'bad ' + doc['machine.os.raw'].value } " | ||
// ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, makes sense to keeps this here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, minor remarks and questions added, maybe a final flaky test suite linked in the description of this PR. Crazy how much time it took the reproduce this problem once, and it's now done in a few lines of code 👍
// the commented-out steps below were used to create the scripted fields in the logstash-* index pattern | ||
// which are now saved in the esArchive. | ||
|
||
// await PageObjects.settings.navigateTo(); | ||
// await PageObjects.settings.clickKibanaIndexPatterns(); | ||
// await PageObjects.settings.clickIndexPatternLogstash(); | ||
// const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount()); | ||
// await PageObjects.settings.clickScriptedFieldsTab(); | ||
// await log.debug('add scripted field'); | ||
// await PageObjects.settings.addScriptedField( | ||
// 'goodScript', | ||
// 'painless', | ||
// 'string', | ||
// null, | ||
// '1', | ||
// // Scripted field below with should work | ||
// "if (doc['response.raw'].value == '200') { if (doc['url.raw'].size() > 0) { return 'good ' + doc['url.raw'].value } else { return 'good' } } else { if (doc['machine.os.raw'].size() > 0) { return 'bad ' + doc['machine.os.raw'].value } else { return 'bad' } }" | ||
// ); | ||
// await retry.try(async function() { | ||
// expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount())).to.be( | ||
// startingCount + 1 | ||
// ); | ||
// }); | ||
|
||
// await PageObjects.settings.addScriptedField( | ||
// 'goodScript2', | ||
// 'painless', | ||
// 'string', | ||
// null, | ||
// '1', | ||
// // Scripted field below which should work | ||
// "if (doc['url.raw'].size() > 0) { String tempString = \"\"; for ( int i = (doc['url.raw'].value.length() - 1); i >= 0 ; i--) { tempString = tempString + (doc['url.raw'].value).charAt(i); } return tempString; } else { return \"emptyUrl\"; }" | ||
// ); | ||
// await retry.try(async function() { | ||
// expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount())).to.be( | ||
// startingCount + 2 | ||
// ); | ||
// }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just wonder if it would make sense, extracting these code into helper functions, uncommenting the usage of those?
@elasticmachine merge upstream |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…ata-streams * 'master' of github.com:elastic/kibana: (50 commits) [Logs UI] [Alerting] "Group by" functionality (elastic#68250) [Discover] Deangularize Skip to bottom button (elastic#69811) Implement recursive plugin discovery (elastic#68811) Use ts-expect-error in platform code (elastic#69883) [SIEM][Detection Engine][Lists] Moves getQueryFilter to common folder for use by both front and backend [Ingest Manager][SECURITY SOLUTION] adjust config reassign link and add roundtrip to Reassignment flow (elastic#70208) [Security][Lists] Add API functions and react hooks for value list APIs (elastic#69603) [ILM] Fix bug when clearing priority field (elastic#70154) [Platform][Security] Updates cluster_manager ignorePaths to include security scripts (elastic#70139) [IngestManager] Allow to filter agent by packages (elastic#69731) [code coverage] exclude folders: test_helpers, tests_bundle (elastic#70199) [Metrics UI] UX improvements for saved views (elastic#69910) [APM] docs: unique transaction troubleshooting (elastic#69831) Cross cluster search functional test with minimun privileges assigned to the test_user (elastic#70007) [Maps] choropleth layer wizard (elastic#69699) Make custom errors by extending Error (elastic#69966) [Ingest Manager] Support updated package output structure (elastic#69864) Resolver test coverage (elastic#70246) Async Discover search test (elastic#64388) [ui-shared-deps] include styled-components (elastic#69322) ... # Conflicts: # x-pack/plugins/snapshot_restore/server/types.ts
…bana into alerting/consumer-based-rbac * 'alerting/consumer-based-rbac' of github.com:gmmorris/kibana: (49 commits) [Discover] Deangularize Skip to bottom button (elastic#69811) Implement recursive plugin discovery (elastic#68811) Use ts-expect-error in platform code (elastic#69883) [SIEM][Detection Engine][Lists] Moves getQueryFilter to common folder for use by both front and backend [Ingest Manager][SECURITY SOLUTION] adjust config reassign link and add roundtrip to Reassignment flow (elastic#70208) [Security][Lists] Add API functions and react hooks for value list APIs (elastic#69603) [ILM] Fix bug when clearing priority field (elastic#70154) [Platform][Security] Updates cluster_manager ignorePaths to include security scripts (elastic#70139) [IngestManager] Allow to filter agent by packages (elastic#69731) [code coverage] exclude folders: test_helpers, tests_bundle (elastic#70199) [Metrics UI] UX improvements for saved views (elastic#69910) [APM] docs: unique transaction troubleshooting (elastic#69831) Cross cluster search functional test with minimun privileges assigned to the test_user (elastic#70007) [Maps] choropleth layer wizard (elastic#69699) Make custom errors by extending Error (elastic#69966) [Ingest Manager] Support updated package output structure (elastic#69864) Resolver test coverage (elastic#70246) Async Discover search test (elastic#64388) [ui-shared-deps] include styled-components (elastic#69322) SECURITY-ENDPOINT: add host properties (elastic#70238) ...
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This PR is for new functional UI tests in x-pack for Discover with async search.
There are currently 2 tests;
query should show failed shards pop up
query return results with valid scripted field
(fails on 7.7.0 BC8)The trick to these tests are in the scripted fields. The test originally started with "empty_kibana" .kibana index and created the index pattern and scripted fields through the UI. But the last commit has that already set in the
kibana_scripted_fields_on_logstash
esArchive to make the test much faster.With a couple of scripted fields that cause Elasticsearch to have to do some work, the initial response from Elasticsearch in that case wasn't being handled properly and would cause the "no results" message to show. With the fixes which are already merged the query returns the expected results.
The first test causes the failed shards popup. A recent fix in Elasticsearch fixed this.
NOTE: One thing unusually about the test file in it's current version is that it has all the steps commented-out which were used to create the scripted fields which are now in the esArchive. I know we don't usually like to leave a bunch of commented-out code in our files but this might be a practice to consider. If someone needed to change what was in the esArchive it would be pretty painful without those steps.
Checklist
Delete any items that are not applicable to this PR.
For maintainers