-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Inference UI] Add scout tests for feature settings page #261790
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
Merged
saikatsarkar056
merged 48 commits into
elastic:main
from
saikatsarkar056:scout-feature-settings-tests
Apr 13, 2026
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
cc8e833
Add scout tests for feature settings page
saikatsarkar056 ca4140d
Refactor code
saikatsarkar056 e30d180
Add tests for add-model
saikatsarkar056 dbd8fb5
Add tests for copy-to
saikatsarkar056 0b689de
Refactor code
saikatsarkar056 a4dd1e4
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 895df27
Refactor code
saikatsarkar056 ad09b7a
Refactor code
saikatsarkar056 9f7d0ac
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 67b38ef
Refactor code
saikatsarkar056 c8cbf22
Refactor code
saikatsarkar056 1cfea43
Refactor code
saikatsarkar056 3cecb11
Refactor code
saikatsarkar056 b0cf116
Refactor code
saikatsarkar056 0e699be
Refactor code
saikatsarkar056 1177a15
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 779c9f5
Merge branch 'main' into scout-feature-settings-tests
saikatsarkar056 77a545e
Add comment for each line of disable next-line
saikatsarkar056 855303e
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 3d7953e
Mock inference api
saikatsarkar056 3daabef
Refactor code
saikatsarkar056 da80fdf
Merge branch 'scout-feature-settings-tests' of github.com:saikatsarka…
saikatsarkar056 064de6d
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 ee311fb
Refactor code
saikatsarkar056 9d9f7d3
Introduce fixture plugin
saikatsarkar056 7b7a520
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 0b008fc
Refactor code
saikatsarkar056 e7f676c
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 b9c0268
Refactor code
saikatsarkar056 14f23ed
Refactor code
saikatsarkar056 70f7ee6
Refactor code
saikatsarkar056 248e78c
Refactor code
saikatsarkar056 29e1843
Refactor code
saikatsarkar056 9dcdde6
Refactor code
saikatsarkar056 c8e8bc4
Refactor code
saikatsarkar056 56748f1
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 030558b
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 6754973
Refactor code
saikatsarkar056 e39a2dc
Skip MKI
saikatsarkar056 ca516e8
Refactor code
saikatsarkar056 8a6506d
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 798d229
Refactor code
saikatsarkar056 c7d85fe
Refactor code
saikatsarkar056 5a7c34f
Refactor code
saikatsarkar056 7deba2d
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 30d464a
Add readonly class fields
saikatsarkar056 f45cd45
Refactor code
saikatsarkar056 7a70e17
Merge branch 'main' of github.com:elastic/kibana into scout-feature-s…
saikatsarkar056 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...out/src/servers/configs/config_sets/inference_test/serverless/search.serverless.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
| * Public License v 1"; you may not use this file except in compliance with, at | ||
| * your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
|
|
||
| import { resolve } from 'path'; | ||
| import { REPO_ROOT } from '@kbn/repo-info'; | ||
| import { servers as defaultConfig } from '../../default/serverless/search.serverless.config'; | ||
| import type { ScoutServerConfig } from '../../../../../types'; | ||
|
|
||
| const pluginPath = `--plugin-path=${resolve( | ||
| REPO_ROOT, | ||
| 'x-pack/platform/test/search_inference_endpoints/plugins/search_inference_endpoints_fixture' | ||
| )}`; | ||
|
|
||
| export const servers: ScoutServerConfig = { | ||
| ...defaultConfig, | ||
| kbnTestServer: { | ||
| ...defaultConfig.kbnTestServer, | ||
| serverArgs: [...defaultConfig.kbnTestServer.serverArgs, pluginPath], | ||
| }, | ||
| }; |
26 changes: 26 additions & 0 deletions
26
...-scout/src/servers/configs/config_sets/inference_test/stateful/classic.stateful.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
| * Public License v 1"; you may not use this file except in compliance with, at | ||
| * your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
| * License v3.0 only", or the "Server Side Public License, v 1". | ||
| */ | ||
|
|
||
| import { resolve } from 'path'; | ||
| import { REPO_ROOT } from '@kbn/repo-info'; | ||
| import type { ScoutServerConfig } from '../../../../../types'; | ||
| import { defaultConfig } from '../../default/stateful/base.config'; | ||
|
|
||
| const pluginPath = `--plugin-path=${resolve( | ||
| REPO_ROOT, | ||
| 'x-pack/platform/test/search_inference_endpoints/plugins/search_inference_endpoints_fixture' | ||
| )}`; | ||
|
|
||
| export const servers: ScoutServerConfig = { | ||
| ...defaultConfig, | ||
| kbnTestServer: { | ||
| ...defaultConfig.kbnTestServer, | ||
| serverArgs: [...defaultConfig.kbnTestServer.serverArgs, pluginPath], | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../plugins/shared/search_inference_endpoints/test/scout_inference_test/ui/fixtures/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * 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 { PageObjects, ScoutTestFixtures, ScoutWorkerFixtures } from '@kbn/scout'; | ||
| import { test as baseTest, createLazyPageObject } from '@kbn/scout'; | ||
| import { FeatureSettingsPage } from './page_objects'; | ||
|
|
||
| export interface ExtScoutTestFixtures extends ScoutTestFixtures { | ||
| pageObjects: PageObjects & { | ||
| featureSettings: FeatureSettingsPage; | ||
| }; | ||
| } | ||
|
|
||
| export const test = baseTest.extend<ExtScoutTestFixtures, ScoutWorkerFixtures>({ | ||
| pageObjects: async ( | ||
| { | ||
| pageObjects, | ||
| page, | ||
| }: { | ||
| pageObjects: ExtScoutTestFixtures['pageObjects']; | ||
| page: ExtScoutTestFixtures['page']; | ||
| }, | ||
| use: (pageObjects: ExtScoutTestFixtures['pageObjects']) => Promise<void> | ||
| ) => { | ||
| const extendedPageObjects = { | ||
| ...pageObjects, | ||
| featureSettings: createLazyPageObject(FeatureSettingsPage, page), | ||
| }; | ||
|
|
||
| await use(extendedPageObjects); | ||
| }, | ||
| }); |
69 changes: 69 additions & 0 deletions
69
...nference_endpoints/test/scout_inference_test/ui/fixtures/mock_data/inference_endpoints.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| export const mockInferenceEndpoints = [ | ||
| { | ||
| inference_id: '.mock-anthropic-claude-3.7-sonnet-chat_completion-a3f1', | ||
| task_type: 'chat_completion', | ||
| service: 'elastic', | ||
| service_settings: { model_id: 'anthropic-claude-3.7-sonnet' }, | ||
| metadata: { | ||
| heuristics: { properties: ['multilingual', 'multimodal'], status: 'ga' }, | ||
| display: { name: 'Anthropic Claude Sonnet 3.7', model_creator: 'Anthropic' }, | ||
| }, | ||
| }, | ||
| { | ||
| inference_id: '.mock-anthropic-claude-3.7-sonnet-completion-b7d2', | ||
| task_type: 'completion', | ||
| service: 'elastic', | ||
| service_settings: { model_id: 'anthropic-claude-3.7-sonnet' }, | ||
| metadata: { | ||
| heuristics: { properties: ['multilingual', 'multimodal'], status: 'ga' }, | ||
| display: { name: 'Anthropic Claude Sonnet 3.7', model_creator: 'Anthropic' }, | ||
| }, | ||
| }, | ||
| { | ||
| inference_id: '.mock-openai-gpt-4.1-chat_completion-c9e4', | ||
| task_type: 'chat_completion', | ||
| service: 'elastic', | ||
| service_settings: { model_id: 'openai-gpt-4.1' }, | ||
| metadata: { | ||
| heuristics: { properties: ['multilingual', 'multimodal'], status: 'ga' }, | ||
| display: { name: 'OpenAI GPT-4.1', model_creator: 'OpenAI' }, | ||
| }, | ||
| }, | ||
| { | ||
| inference_id: '.mock-openai-gpt-4.1-completion-d5f6', | ||
| task_type: 'completion', | ||
| service: 'elastic', | ||
| service_settings: { model_id: 'openai-gpt-4.1' }, | ||
| metadata: { | ||
| heuristics: { properties: ['multilingual', 'multimodal'], status: 'ga' }, | ||
| display: { name: 'OpenAI GPT-4.1', model_creator: 'OpenAI' }, | ||
| }, | ||
| }, | ||
| { | ||
| inference_id: '.mock-google-gemini-2.5-pro-chat_completion-e2a8', | ||
| task_type: 'chat_completion', | ||
| service: 'elastic', | ||
| service_settings: { model_id: 'google-gemini-2.5-pro' }, | ||
| metadata: { | ||
| heuristics: { properties: ['multilingual', 'multimodal'], status: 'ga' }, | ||
| display: { name: 'Google Gemini 2.5 Pro', model_creator: 'Google' }, | ||
| }, | ||
| }, | ||
| { | ||
| inference_id: '.mock-google-gemini-2.5-pro-completion-f1b3', | ||
| task_type: 'completion', | ||
| service: 'elastic', | ||
| service_settings: { model_id: 'google-gemini-2.5-pro' }, | ||
| metadata: { | ||
| heuristics: { properties: ['multilingual', 'multimodal'], status: 'ga' }, | ||
| display: { name: 'Google Gemini 2.5 Pro', model_creator: 'Google' }, | ||
| }, | ||
| }, | ||
| ]; |
60 changes: 60 additions & 0 deletions
60
.../plugins/shared/search_inference_endpoints/test/scout_inference_test/ui/fixtures/mocks.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /* | ||
| * 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 { ScoutPage } from '@kbn/scout'; | ||
|
|
||
| const CONNECTORS_ROUTE = '**/internal/inference/connectors'; | ||
| const ENDPOINTS_ROUTE = '**/internal/inference_endpoints/endpoints'; | ||
|
|
||
| export async function mockConnectors(page: ScoutPage) { | ||
| await page.route(CONNECTORS_ROUTE, async (route) => { | ||
| await route.fulfill({ | ||
| status: 200, | ||
| contentType: 'application/json', | ||
| body: JSON.stringify({ | ||
| connectors: [ | ||
| { | ||
| connectorId: 'mock-connector', | ||
| name: 'Mock Connector', | ||
| type: '.gen-ai', | ||
| config: {}, | ||
| capabilities: {}, | ||
| isPreconfigured: false, | ||
| }, | ||
| ], | ||
| }), | ||
| }); | ||
| }); | ||
| } | ||
|
|
||
| export async function mockEmptyConnectors(page: ScoutPage) { | ||
| await page.route(CONNECTORS_ROUTE, async (route) => { | ||
| await route.fulfill({ | ||
| status: 200, | ||
| contentType: 'application/json', | ||
| body: JSON.stringify({ connectors: [] }), | ||
| }); | ||
| }); | ||
| } | ||
|
|
||
| export async function unmockConnectors(page: ScoutPage) { | ||
| await page.unroute(CONNECTORS_ROUTE); | ||
| } | ||
|
|
||
| export async function mockInferenceEndpoints(page: ScoutPage, endpoints: unknown[]) { | ||
| await page.route(ENDPOINTS_ROUTE, async (route) => { | ||
| await route.fulfill({ | ||
| status: 200, | ||
| contentType: 'application/json', | ||
| body: JSON.stringify({ inference_endpoints: endpoints }), | ||
| }); | ||
| }); | ||
| } | ||
|
|
||
| export async function unmockInferenceEndpoints(page: ScoutPage) { | ||
| await page.unroute(ENDPOINTS_ROUTE); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.