-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Background search] Enable by default #242105
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
Changes from all commits
c9cdac5
c9ec9d5
588abbe
0e17aa6
1ae284f
c805436
abd7bd7
dc3ee1d
aab7796
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -993,22 +993,34 @@ export default function ({ getService }: FtrProviderContext) { | |
| }); | ||
|
|
||
| describe('available features', function () { | ||
| it('all Dashboard and Discover sub-feature privileges are disabled', async function () { | ||
| it('all Dashboard sub-features privileges are disabled', async function () { | ||
| const { body } = await supertestAdminWithCookieCredentials.get('/api/features').expect(200); | ||
|
|
||
| // We should make sure that neither Discover nor Dashboard displays any sub-feature privileges in Serverless. | ||
| // We should make sure that Dashboard displays any sub-feature privileges in Serverless. | ||
| // If any of these features adds a new sub-feature privilege we should make an explicit decision whether it | ||
| // should be displayed in Serverless. | ||
| const features = body as KibanaFeatureConfig[]; | ||
| for (const featureId of ['discover_v2', 'dashboard_v2']) { | ||
| const feature = features.find((f) => f.id === featureId)!; | ||
| const subFeaturesPrivileges = collectSubFeaturesPrivileges(feature); | ||
| for (const privilege of subFeaturesPrivileges.values()) { | ||
| log.debug( | ||
| `Verifying that ${privilege.id} sub-feature privilege of ${featureId} feature is disabled.` | ||
| ); | ||
| expect(privilege.disabled).toBe(true); | ||
| } | ||
| const feature = features.find((f) => f.id === 'dashboard_v2')!; | ||
| const subFeaturesPrivileges = collectSubFeaturesPrivileges(feature); | ||
| for (const privilege of subFeaturesPrivileges.values()) { | ||
| log.debug( | ||
| `Verifying that ${privilege.id} sub-feature privilege of dashboard_v2 feature is disabled.` | ||
| ); | ||
| if (privilege.id === 'store_search_session') continue; | ||
| expect(privilege.disabled).toBe(true); | ||
| } | ||
| }); | ||
|
|
||
| it('all Discover sub-features except store search session privilege are disabled', async function () { | ||
| const { body } = await supertestAdminWithCookieCredentials.get('/api/features').expect(200); | ||
|
|
||
| const features = body as KibanaFeatureConfig[]; | ||
| const feature = features.find((f) => f.id === 'discover_v2')!; | ||
| const subFeaturesPrivileges = collectSubFeaturesPrivileges(feature); | ||
|
|
||
| for (const privilege of subFeaturesPrivileges.values()) { | ||
| if (privilege.id === 'store_search_session') expect(privilege.disabled).not.toBe(true); | ||
| else expect(privilege.disabled).toBe(true); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this an explicit decision we made to show this privilege? It probably makes sense, just wanted to make sure. |
||
| } | ||
| }); | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
| import type { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
|
||
| export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
| const kibanaServer = getService('kibanaServer'); | ||
| const searchSessions = getService('searchSessions'); | ||
|
|
||
| const { common, unifiedFieldList, svlCommonPage } = getPageObjects([ | ||
| 'common', | ||
| 'unifiedFieldList', | ||
| 'svlCommonPage', | ||
| ]); | ||
|
|
||
| describe('Discover background search', function () { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i can't do a real test of storing/recovering a background search because
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, makes sense... this is a real bummer, maybe we can bring this up to the team and see if there are any options here.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To quickly follow up, we might get support from ES side here, so we should be able to treat serverless and stateful the same way |
||
| before(async () => { | ||
| await kibanaServer.importExport.load( | ||
| 'src/platform/test/functional/fixtures/kbn_archiver/discover' | ||
| ); | ||
| await svlCommonPage.loginAsAdmin(); | ||
|
|
||
| await common.navigateToApp('discover'); | ||
| await unifiedFieldList.waitUntilSidebarHasLoaded(); | ||
| }); | ||
|
|
||
| describe('when in discover', () => { | ||
| it('renders the save to background button', async () => { | ||
| await searchSessions.sendToBackgroundButtonExists(); | ||
| }); | ||
| }); | ||
|
|
||
| describe('when clicking the open background search flyout button', () => { | ||
| it('opens the background search flyout', async () => { | ||
| await searchSessions.openFlyout(); | ||
| await searchSessions.expectManagementTable(); | ||
| }); | ||
| }); | ||
| }); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import type { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
|
||
| export default function ({ loadTestFile }: FtrProviderContext) { | ||
| describe('discover/background_search', function () { | ||
| this.tags(['esGate']); | ||
|
|
||
| loadTestFile(require.resolve('./_exists')); | ||
| }); | ||
| } |
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.
i've moved this from the x-pack functional services folder to the base functional services so I can reuse it in the serverless tests - happy to do it in some other way if this is not ideal