Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .buildkite/ftr_search_serverless_configs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
disabled:
# Base config files, only necessary to inform config finding script
- x-pack/platform/test/serverless/functional/config.search.base.ts
- x-pack/test_serverless/api_integration/test_suites/search/config.ts
- x-pack/test_serverless/api_integration/test_suites/search/config.feature_flags.ts
- x-pack/solutions/search/test/serverless/api_integration/configs/config.ts
- x-pack/solutions/search/test/serverless/api_integration/configs/config.feature_flags.ts
- x-pack/platform/test/serverless/api_integration/configs/search/config.group1.ts
- x-pack/test_serverless/functional/test_suites/search/config.ts
- x-pack/solutions/search/test/serverless/functional/configs/config.ts
- x-pack/platform/test/serverless/functional/configs/search/config.examples.ts
- x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts
- x-pack/test_serverless/functional/test_suites/search/config.screenshots.ts
- x-pack/solutions/search/test/serverless/functional/configs/config.feature_flags.ts
- x-pack/solutions/search/test/serverless/functional/configs/config.screenshots.ts
- x-pack/platform/test/serverless/functional/configs/search/config.saved_objects_management.ts
- x-pack/platform/test/serverless/functional/configs/search/config.context_awareness.ts
- x-pack/platform/test/serverless/functional/configs/search/config.config_compat_mode.ts
Expand Down
16 changes: 8 additions & 8 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ x-pack/solutions/observability/plugins/observability/server/lib/esql_extensions
/src/platform/test/functional/apps/dashboard_elements/ @elastic/kibana-presentation
/src/platform/test/functional/services/dashboard/ @elastic/kibana-presentation
/x-pack/platform/test/functional/apps/canvas/ @elastic/kibana-presentation
/x-pack/test_serverless/functional/test_suites/search/dashboards/ @elastic/kibana-presentation
/x-pack/solutions/search/test/serverless/functional/test_suites/dashboards/ @elastic/kibana-presentation
/src/platform/test/plugin_functional/test_suites/panel_actions @elastic/kibana-presentation
/x-pack/platform/test/fixtures/es_archives/canvas/logstash_lens @elastic/kibana-presentation
#CC# /src/plugins/kibana_react/public/code_editor/ @elastic/kibana-presentation
Expand Down Expand Up @@ -2211,12 +2211,12 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi
/x-pack/solutions/observability/test/api_integration/apis/cases/ @elastic/kibana-cases
/x-pack/solutions/security/test/api_integration/apis/cases/ @elastic/kibana-cases
/x-pack/test_serverless/functional/test_suites/observability/cases @elastic/kibana-cases
/x-pack/test_serverless/functional/test_suites/search/cases/ @elastic/kibana-cases
/x-pack/solutions/search/test/serverless/functional/test_suites/cases/ @elastic/kibana-cases
/x-pack/test_serverless/functional/test_suites/security/ftr/cases/ @elastic/kibana-cases
/x-pack/test_serverless/api_integration/test_suites/search/cases/ @elastic/kibana-cases
/x-pack/solutions/search/test/serverless/api_integration/cases/ @elastic/kibana-cases
/x-pack/test_serverless/api_integration/test_suites/observability/cases/ @elastic/kibana-cases
/x-pack/test_serverless/api_integration/test_suites/security/cases/ @elastic/kibana-cases
/x-pack/test_serverless/functional/test_suites/search/screenshot_creation/response_ops_docs @elastic/response-ops
/x-pack/solutions/search/test/serverless/functional/test_suites/screenshot_creation/response_ops_docs @elastic/response-ops
/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs @elastic/response-ops
/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs @elastic/response-ops
/x-pack/platform/test/serverless/api_integration/test_suites/alerting/ @elastic/response-ops
Expand Down Expand Up @@ -2250,11 +2250,11 @@ x-pack/platform/test/functional/page_objects/search_profiler_page.ts @elastic/se
/x-pack/test/functional/page_objects/embedded_console.ts @elastic/search-kibana
/x-pack/test/functional_enterprise_search/ @elastic/search-kibana
/x-pack/solutions/search/plugins/enterprise_search/public/applications/shared/doc_links @elastic/platform-docs
/x-pack/test_serverless/api_integration/test_suites/search/serverless_search @elastic/search-kibana
/x-pack/test_serverless/functional/test_suites/search/ @elastic/search-kibana
/x-pack/test_serverless/functional/test_suites/search/config.ts @elastic/search-kibana @elastic/appex-qa
/x-pack/solutions/search/test/serverless/api_integration/serverless_search @elastic/search-kibana
/x-pack/solutions/search/test/serverless/functional/test_suites/ @elastic/search-kibana
/x-pack/solutions/search/test/serverless/functional/configs/config.ts @elastic/search-kibana @elastic/appex-qa
/x-pack/platform/test/api_integration/apis/management/index_management/inference_endpoints.ts @elastic/search-kibana
/x-pack/test_serverless/api_integration/test_suites/search @elastic/search-kibana
/x-pack/solutions/search/test/serverless/api_integration @elastic/search-kibana
/x-pack/platform/test/serverless/functional/page_objects/svl_api_keys.ts @elastic/search-kibana
/x-pack/test_serverless/functional/page_objects/svl_search_* @elastic/search-kibana
/x-pack/solutions/search/test/functional_search/ @elastic/search-kibana
Expand Down
9 changes: 5 additions & 4 deletions x-pack/platform/test/serverless/functional/config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ import { pageObjects } from './page_objects';
import { services } from './services';
import type { CreateTestConfigOptions } from '../shared/types';

export function createTestConfig<TServices extends {} = typeof services>(
options: CreateTestConfigOptions<TServices>
) {
export function createTestConfig<
TServices extends {} = typeof services,
TPageObjects extends {} = typeof pageObjects
>(options: CreateTestConfigOptions<TServices, TPageObjects>) {
return async ({ readConfigFile }: FtrConfigProviderContext) => {
const svlSharedConfig = await readConfigFile(require.resolve('../shared/config.base.ts'));

return {
...svlSharedConfig.getAll(),

testConfigCategory: ScoutTestRunConfigCategory.UI_TEST,
pageObjects,
pageObjects: { ...pageObjects, ...options.pageObjects },
services: { ...services, ...options.services },
esTestCluster: {
...svlSharedConfig.get('esTestCluster'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Note: this suite is currently only called from the feature flags test config:
// x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts
// x-pack/solutions/search/test/serverless/functional/configs/config.feature_flags.ts

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

// Note: this suite is currently only called from the feature flags test config:
// x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts
// x-pack/solutions/search/test/serverless/functional/configs/config.feature_flags.ts
// This can be moved into the common config groups once custom roles are enabled
// permanently in serverless.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// Note: this suite is currently only called from the feature flags test config:
// x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts
// x-pack/solutions/search/test/serverless/functional/configs/config.feature_flags.ts
// These tests can be moved to the appropriate test file (spaces_selection,
// spaces_management) once multiple spaces are permanently enabled in production.

Expand Down
29 changes: 27 additions & 2 deletions x-pack/platform/test/serverless/shared/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,40 @@
*/

import { ServerlessProjectType } from '@kbn/es';
import { InheritedServices } from '../../api_integration/services';
import { GenericFtrProviderContext } from '@kbn/test';
import { services } from '../../api_integration/services';
import { pageObjects } from '../../functional/page_objects';

export interface CreateTestConfigOptions<TServices extends {} = InheritedServices> {
export type InheritedFtrProviderContext = GenericFtrProviderContext<
typeof services,
typeof pageObjects
>;

export type InheritedServices = InheritedFtrProviderContext extends GenericFtrProviderContext<
infer TServices,
infer TPageObjects
>
? TServices
: {};

export type InheritedPageObjects = InheritedFtrProviderContext extends GenericFtrProviderContext<
infer TServices,
infer TPageObjects
>
? TPageObjects
: {};

export interface CreateTestConfigOptions<
TServices extends {} = InheritedServices,
TPageObjects extends {} = InheritedPageObjects
> {
serverlessProject: ServerlessProjectType;
esServerArgs?: string[];
kbnServerArgs?: string[];
testFiles: string[];
junit: { reportName: string };
suiteTags?: { include?: string[]; exclude?: string[] };
services?: TServices;
pageObjects?: TPageObjects;
apps?: Record<string, { pathname: string; hash?: string }>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
*/

import { FtrConfigProviderContext } from '@kbn/test';
import { services } from '../../functional_search/services';
import { pageObjects } from '../../functional_search/page_objects';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const xpackFunctionalConfig = await readConfigFile(
require.resolve('@kbn/test-suites-xpack/functional/config.base')
require.resolve('@kbn/test-suites-xpack-platform/functional/config.base')
);

return {
...xpackFunctionalConfig.getAll(),
services,
pageObjects,
junit: {
reportName: 'Search Solution UI Functional Tests w/ Feature Flagged Features',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { GenericFtrProviderContext } from '@kbn/test';

import { services } from '@kbn/test-suites-xpack/functional/services';
import { pageObjects } from '@kbn/test-suites-xpack/functional/page_objects';
import { services } from '../functional_search/services';
import { pageObjects } from '../functional_search/page_objects';

export type FtrProviderContext = GenericFtrProviderContext<typeof services, typeof pageObjects>;
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { SearchNavigationProvider } from './search_navigation';
import { SearchOverviewProvider } from './search_overview_page';
import { SearchHomePageProvider } from './search_homepage';
import { SearchPlaygroundPageProvider } from './search_playground_page';
import { SearchQueryRulesPageProvider } from './search_query_rules_page';

export const pageObjects = {
...platformPageObjects,
Expand All @@ -25,4 +26,5 @@ export const pageObjects = {
searchOverview: SearchOverviewProvider,
searchHomePage: SearchHomePageProvider,
searchPlayground: SearchPlaygroundPageProvider,
searchQueryRules: SearchQueryRulesPageProvider,
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
* 2.0.
*/

import { createTestConfig } from '../../config.base';
import { createTestConfig } from '@kbn/test-suites-xpack-platform/serverless/api_integration/config.base';
import { services } from '../services';

/**
* Make sure to create a MKI deployment with custom Kibana image, that includes feature flags arguments
* These tests most likely will fail on default MKI project
*/
export default createTestConfig({
serverlessProject: 'es',
services,
junit: {
reportName: 'Serverless Search Feature Flags API Integration Tests',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
*/

import { KBN_CERT_PATH, KBN_KEY_PATH } from '@kbn/dev-utils';
import { createTestConfig } from '../../config.base';
import { createTestConfig } from '@kbn/test-suites-xpack-platform/serverless/api_integration/config.base';
import { services } from '../services';

export default createTestConfig({
serverlessProject: 'es',
services,
testFiles: [require.resolve('.')],
junit: {
reportName: 'Serverless Search API Integration Tests',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* 2.0.
*/

import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from '../ftr_provider_context';

export default function ({ loadTestFile }: FtrProviderContext) {
describe('Serverless search API - feature flags', function () {
loadTestFile(require.resolve('./search_indices'));
loadTestFile(require.resolve('../test_suites/search_indices'));
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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('Serverless search API', function () {
this.tags(['esGate']);

loadTestFile(require.resolve('../test_suites/cases/find_cases'));
loadTestFile(require.resolve('../test_suites/cases/post_case'));
loadTestFile(require.resolve('../test_suites/serverless_search'));
loadTestFile(require.resolve('../test_suites/platform_security'));
loadTestFile(require.resolve('../test_suites/search_playground'));
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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 { GenericFtrProviderContext } from '@kbn/test';

import { services } from './services';

export type FtrProviderContext = GenericFtrProviderContext<typeof services, {}>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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 { GenericFtrProviderContext } from '@kbn/test';
import { services as svlPlatformServices } from '@kbn/test-suites-xpack-platform/serverless/api_integration/services';

export const services = {
...svlPlatformServices,

// Search Solution serverless FTR services
};

export type InheritedFtrProviderContext = GenericFtrProviderContext<typeof services, {}>;

export type InheritedServices = InheritedFtrProviderContext extends GenericFtrProviderContext<
infer TServices,
{}
>
? TServices
: {};

export type {
SupertestWithRoleScopeType,
RoleCredentials,
} from '@kbn/test-suites-xpack-platform/serverless/shared/services';
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import { CASES_URL } from '@kbn/cases-plugin/common/constants';
import type { RoleCredentials } from '../../../../shared/services';
import { FtrProviderContext } from '../../../ftr_provider_context';
import type { RoleCredentials } from '../../services';
import { FtrProviderContext } from '../../ftr_provider_context';

export default ({ getService }: FtrProviderContext): void => {
const supertestWithoutAuth = getService('supertestWithoutAuth');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
import { CASES_URL } from '@kbn/cases-plugin/common/constants';
import { CaseSeverity } from '@kbn/cases-plugin/common/types/domain';
import { ConnectorTypes } from '@kbn/cases-plugin/common/types/domain';
import type { RoleCredentials } from '../../../../shared/services';

import { FtrProviderContext } from '../../../ftr_provider_context';
import type { RoleCredentials } from '../../services';
import { FtrProviderContext } from '../../ftr_provider_context';

export default ({ getService }: FtrProviderContext): void => {
const supertestWithoutAuth = getService('supertestWithoutAuth');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FtrProviderContext } from '../../../ftr_provider_context';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService }: FtrProviderContext) {
const svlCommonApi = getService('svlCommonApi');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FtrProviderContext } from '../../../ftr_provider_context';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ loadTestFile }: FtrProviderContext) {
describe('Platform security APIs', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FtrProviderContext } from '../../../ftr_provider_context';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ loadTestFile }: FtrProviderContext) {
describe('search indices APIs', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import expect from 'expect';
import { SupertestWithRoleScopeType } from '../../../services';
import { FtrProviderContext } from '../../../ftr_provider_context';
import type { SupertestWithRoleScopeType } from '../../services';
import { FtrProviderContext } from '../../ftr_provider_context';

const INTERNAL_API_BASE_PATH = '/internal/search_indices';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import expect from 'expect';
import { SupertestWithRoleScopeType } from '../../../services';
import { FtrProviderContext } from '../../../ftr_provider_context';
import type { SupertestWithRoleScopeType } from '../../services';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService }: FtrProviderContext) {
const roleScopedSupertest = getService('roleScopedSupertest');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FtrProviderContext } from '../../../ftr_provider_context';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ loadTestFile }: FtrProviderContext) {
describe('search playground APIs', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import expect from 'expect';
import { SupertestWithRoleScopeType } from '../../../services';
import { FtrProviderContext } from '../../../ftr_provider_context';
import type { SupertestWithRoleScopeType } from '../../services';
import { FtrProviderContext } from '../../ftr_provider_context';

const archivedBooksIndex = 'x-pack/solutions/search/test/functional_search/fixtures/search-books';
const archiveDenseVectorIndex =
Expand Down
Loading