-
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
[Search] Inference Management FTR Tests #188438
base: main
Are you sure you want to change the base?
Changes from 10 commits
bcaf6ac
7a5f4ad
ce80b32
66e5608
9dfbc15
540997f
7df0806
0c39594
e27012e
ed476b7
8af9b75
b84aa85
63c3b2a
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 |
---|---|---|
|
@@ -17,17 +17,17 @@ xpack.osquery.enabled: false | |
## Fine-tune the search solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides. | ||
xpack.features.overrides: | ||
### Dashboards feature is moved from Analytics category to the Search one. | ||
dashboard.category: "enterpriseSearch" | ||
dashboard.category: 'enterpriseSearch' | ||
### Dev Tools feature is moved from Analytics category to the Search one. | ||
dev_tools.category: "enterpriseSearch" | ||
dev_tools.category: 'enterpriseSearch' | ||
### Discover feature is moved from Analytics category to the Search one. | ||
discover.category: "enterpriseSearch" | ||
discover.category: 'enterpriseSearch' | ||
### Machine Learning feature is moved from Analytics category to the Management one. | ||
ml.category: "management" | ||
ml.category: 'management' | ||
### Stack Alerts feature is moved from Analytics category to the Search one renamed to simply `Alerts`. | ||
stackAlerts: | ||
name: "Alerts" | ||
category: "enterpriseSearch" | ||
name: 'Alerts' | ||
category: 'enterpriseSearch' | ||
|
||
## Cloud settings | ||
xpack.cloud.serverless.project_type: search | ||
|
@@ -65,7 +65,7 @@ data_visualizer.resultLinks.fileBeat.enabled: false | |
xpack.searchPlayground.ui.enabled: true | ||
|
||
# Search InferenceEndpoints | ||
xpack.searchInferenceEndpoints.ui.enabled: false | ||
xpack.searchInferenceEndpoints.ui.enabled: true | ||
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. Based on the recommendation #5, we may need to hide the Inference Endpoints page in the servereless environment. 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. yes, we will not be merging this PR as the requirements changed 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. @Samiul-TheSoccerFan we can merge this PR, we just need to not enable the FF. instead run the new FTRs in the feature flag config and only enable it there. |
||
|
||
# Search Notebooks | ||
xpack.search.notebooks.catalog.url: https://elastic-enterprise-search.s3.us-east-2.amazonaws.com/serverless/catalog.json | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* 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 { FtrConfigProviderContext } from '@kbn/test'; | ||
|
||
export default async function ({ readConfigFile }: FtrConfigProviderContext) { | ||
const functionalConfig = await readConfigFile(require.resolve('../../config.base.js')); | ||
|
||
return { | ||
...functionalConfig.getAll(), | ||
testFiles: [require.resolve('.')], | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* 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 { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ loadTestFile }: FtrProviderContext) { | ||
describe('inference management', async () => { | ||
loadTestFile(require.resolve('./inference_management.ess.ts')); | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* 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 { ModelConfig } from '@kbn/inference_integration_flyout/types'; | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getPageObjects, getService }: FtrProviderContext) { | ||
const pageObjects = getPageObjects(['common', 'inferenceManagement']); | ||
const browser = getService('browser'); | ||
const ml = getService('ml'); | ||
|
||
/* Due to a race condition between registrating an app and license subscription, | ||
the FTR tests can not access the desired application. | ||
*/ | ||
describe.skip('ESS Inference Management UI', function () { | ||
this.tags('skipMKI'); | ||
|
||
before(async () => { | ||
await pageObjects.common.navigateToApp('home'); | ||
await pageObjects.common.navigateToApp('enterprise_search/overview'); | ||
await pageObjects.common.navigateToApp('inferenceManagement'); | ||
}); | ||
|
||
describe.skip('endpoint empty view', () => { | ||
it('is loaded successfully', async () => { | ||
await pageObjects.inferenceManagement.InferenceEmptyPage.expectComponentsToBeExist(); | ||
}); | ||
it('opens add inference flyout', async () => { | ||
await pageObjects.inferenceManagement.InferenceEmptyPage.expectFlyoutTobeOpened(); | ||
}); | ||
}); | ||
|
||
describe.skip('endpoint tabular view', () => { | ||
before(async () => { | ||
const modelConfig: ModelConfig = { | ||
service: 'elser', | ||
service_settings: { | ||
num_allocations: 1, | ||
num_threads: 1, | ||
}, | ||
}; | ||
await ml.api.createInferenceEndpoint('endpoint-1', 'sparse_embedding', modelConfig); | ||
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. This endpoint was created in the ‘before’ block. We may need to write some cleanup code in the ‘after’ block to delete the endpoint and remove the underlying trained model if it was added during the creation of the endpoint. I’m suggesting this because we previously had a CI/CD failure due to not cleaning up created resources. See this PR as an example of cleanup. 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. At the last test, we removed the 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. Please check whether creation of inference endpoint adds any new trained model. If so, we need to clean up the trained model. |
||
await browser.refresh(); | ||
}); | ||
|
||
it('is loaded successfully', async () => { | ||
await pageObjects.inferenceManagement.InferenceTabularPage.expectHeaderToBeExist(); | ||
await pageObjects.inferenceManagement.InferenceTabularPage.expectTabularViewToBeLoaded(); | ||
}); | ||
|
||
it('can copy an endpoint id', async () => { | ||
await pageObjects.inferenceManagement.InferenceTabularPage.expectToCopyEndpoint(); | ||
}); | ||
|
||
it('can delete an endpoint', async () => { | ||
await pageObjects.inferenceManagement.InferenceTabularPage.expectEndPointTobeDeleted(); | ||
}); | ||
}); | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* 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 expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
export function InferenceManagementPageProvider({ getService }: FtrProviderContext) { | ||
const testSubjects = getService('testSubjects'); | ||
const browser = getService('browser'); | ||
|
||
return { | ||
InferenceEmptyPage: { | ||
async expectComponentsToBeExist() { | ||
const endpointDesc = await testSubjects.find('createFirstInferenceEndpointDescription'); | ||
const endpointDescMsg = await endpointDesc.getVisibleText(); | ||
expect(endpointDescMsg).to.contain( | ||
'Connect to your third-party model provider to create an inference endpoint for semantic search.' | ||
); | ||
await testSubjects.existOrFail('addEndpointButtonForEmptyPrompt'); | ||
await testSubjects.existOrFail('createFirstElserInferenceEndpointDescription'); | ||
await testSubjects.existOrFail('createFirstE5InferenceEndpointDescription'); | ||
}, | ||
|
||
async expectFlyoutTobeOpened() { | ||
await testSubjects.click('addEndpointButtonForEmptyPrompt'); | ||
await testSubjects.existOrFail('addInferenceEndpoint'); | ||
await testSubjects.click('euiFlyoutCloseButton'); | ||
}, | ||
}, | ||
InferenceTabularPage: { | ||
async expectHeaderToBeExist() { | ||
await testSubjects.existOrFail('allInferenceEndpointsPage'); | ||
await testSubjects.existOrFail('addEndpointButtonForAllInferenceEndpoints'); | ||
expect(await testSubjects.isEnabled('addEndpointButtonForAllInferenceEndpoints')).to.be( | ||
true | ||
); | ||
}, | ||
|
||
async expectTabularViewToBeLoaded() { | ||
await testSubjects.existOrFail('inferenceSearchField'); | ||
await testSubjects.existOrFail('inferenceTypeField'); | ||
await testSubjects.existOrFail('inferenceServiceField'); | ||
|
||
const table = await testSubjects.find('inferenceEndpointTable'); | ||
const rows = await table.findAllByClassName('euiTableRow'); | ||
expect(rows.length).to.equal(1); | ||
|
||
await testSubjects.existOrFail('deploymentCell'); | ||
|
||
const endpointCell = await testSubjects.find('endpointCell'); | ||
const endpointName = await endpointCell.getVisibleText(); | ||
expect(endpointName).to.contain('endpoint-1'); | ||
|
||
const providerCell = await testSubjects.find('providerCell'); | ||
const providerName = await providerCell.getVisibleText(); | ||
expect(providerName).to.equal('ELSER'); | ||
|
||
const typeCell = await testSubjects.find('typeCell'); | ||
const typeName = await typeCell.getVisibleText(); | ||
expect(typeName).to.equal('sparse_embedding'); | ||
}, | ||
|
||
async expectEndPointTobeDeleted() { | ||
await testSubjects.click('inference-tableRow-action-button'); | ||
await testSubjects.click('inference-endpoints-action-delete-endpoint'); | ||
await testSubjects.click('confirmModalConfirmButton'); | ||
await testSubjects.missingOrFail('inferenceEndpointTable'); | ||
}, | ||
|
||
async expectToCopyEndpoint() { | ||
await testSubjects.click('inference-tableRow-action-button'); | ||
await testSubjects.click('inference-endpoints-action-copy-id-label'); | ||
|
||
expect((await browser.getClipboardValue()).includes('endpoint-1')).to.be(true); | ||
}, | ||
}, | ||
}; | ||
} |
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.
do we need these quote changes?
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.
We do not need these quote changes. These go added when I rand
lint
command so I assumed something changed with the eslint configuration which forced the file to update.