From 8b31ec7c0e91a6f4bbc64348b411a6a709c6cc7c Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Mon, 10 Jul 2023 18:09:42 +0200 Subject: [PATCH 1/2] Initial commit for deployment agnostic tests - WIP --- .buildkite/ftr_configs.yml | 2 ++ .eslintrc.js | 3 +- .../apis/all_deployments/config.ts | 25 +++++++++++++++ x-pack/test/common/services/common_api.ts | 31 +++++++++++++++++++ x-pack/test/common/services/index.ts | 2 ++ .../functional/apps/all_deployments/config.ts | 25 +++++++++++++++ x-pack/test_all_deployments/README.md | 5 +++ .../api_integration/ftr_provider_context.d.ts | 13 ++++++++ .../test_suites/common/index.ts | 14 +++++++++ .../test_suites/common/status.ts | 23 ++++++++++++++ .../test_suites/observability/index.ts | 14 +++++++++ .../test_suites/observability/status.ts | 24 ++++++++++++++ .../test_suites/search/index.ts | 14 +++++++++ .../test_suites/search/status.ts | 24 ++++++++++++++ .../test_suites/security/index.ts | 14 +++++++++ .../test_suites/security/status.ts | 24 ++++++++++++++ .../functional/ftr_provider_context.d.ts | 16 ++++++++++ .../test_suites/common/home_page.ts | 20 ++++++++++++ .../functional/test_suites/common/index.ts | 14 +++++++++ .../test_suites/observability/home_page.ts | 21 +++++++++++++ .../test_suites/observability/index.ts | 14 +++++++++ .../test_suites/search/home_page.ts | 21 +++++++++++++ .../functional/test_suites/search/index.ts | 14 +++++++++ .../test_suites/security/home_page.ts | 21 +++++++++++++ .../functional/test_suites/security/index.ts | 14 +++++++++ x-pack/test_all_deployments/tsconfig.json | 26 ++++++++++++++++ .../test_suites/observability/config.ts | 7 ++++- .../test_suites/search/config.ts | 7 ++++- .../test_suites/security/config.ts | 7 ++++- .../test_suites/observability/config.ts | 7 ++++- .../functional/test_suites/search/config.ts | 7 ++++- .../functional/test_suites/security/config.ts | 7 ++++- 32 files changed, 473 insertions(+), 7 deletions(-) create mode 100644 x-pack/test/api_integration/apis/all_deployments/config.ts create mode 100644 x-pack/test/common/services/common_api.ts create mode 100644 x-pack/test/functional/apps/all_deployments/config.ts create mode 100644 x-pack/test_all_deployments/README.md create mode 100644 x-pack/test_all_deployments/api_integration/ftr_provider_context.d.ts create mode 100644 x-pack/test_all_deployments/api_integration/test_suites/common/index.ts create mode 100644 x-pack/test_all_deployments/api_integration/test_suites/common/status.ts create mode 100644 x-pack/test_all_deployments/api_integration/test_suites/observability/index.ts create mode 100644 x-pack/test_all_deployments/api_integration/test_suites/observability/status.ts create mode 100644 x-pack/test_all_deployments/api_integration/test_suites/search/index.ts create mode 100644 x-pack/test_all_deployments/api_integration/test_suites/search/status.ts create mode 100644 x-pack/test_all_deployments/api_integration/test_suites/security/index.ts create mode 100644 x-pack/test_all_deployments/api_integration/test_suites/security/status.ts create mode 100644 x-pack/test_all_deployments/functional/ftr_provider_context.d.ts create mode 100644 x-pack/test_all_deployments/functional/test_suites/common/home_page.ts create mode 100644 x-pack/test_all_deployments/functional/test_suites/common/index.ts create mode 100644 x-pack/test_all_deployments/functional/test_suites/observability/home_page.ts create mode 100644 x-pack/test_all_deployments/functional/test_suites/observability/index.ts create mode 100644 x-pack/test_all_deployments/functional/test_suites/search/home_page.ts create mode 100644 x-pack/test_all_deployments/functional/test_suites/search/index.ts create mode 100644 x-pack/test_all_deployments/functional/test_suites/security/home_page.ts create mode 100644 x-pack/test_all_deployments/functional/test_suites/security/index.ts create mode 100644 x-pack/test_all_deployments/tsconfig.json diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index 518192fbe05f3..1a22f2ef35655 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -413,3 +413,5 @@ enabled: - x-pack/performance/journeys/cloud_security_dashboard.ts - x-pack/test/custom_branding/config.ts - x-pack/test/profiling_api_integration/cloud/config.ts + - x-pack/test/api_integration/apis/all_deployments/config.ts + - x-pack/test/functional/apps/all_deployments/config.ts diff --git a/.eslintrc.js b/.eslintrc.js index dacfa2d470e05..ce61114fab297 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -173,7 +173,7 @@ const DEV_PATTERNS = [ ...DEV_FILE_PATTERNS.map((file) => `{packages,src,x-pack}/**/${file}`), 'packages/kbn-interpreter/tasks/**/*', 'src/dev/**/*', - 'x-pack/{dev-tools,tasks,test,test_serverless,build_chromium}/**/*', + 'x-pack/{dev-tools,tasks,test,test_all_deployments,test_serverless,build_chromium}/**/*', 'x-pack/performance/**/*', 'src/setup_node_env/index.js', 'src/cli/dev.js', @@ -602,6 +602,7 @@ module.exports = { 'x-pack/test/ui_capabilities/*/tests/**/*', 'x-pack/test/performance/**/*.ts', '**/cypress.config.{js,ts}', + 'x-pack/test_all_deployments/*/test_suites/**/*', 'x-pack/test_serverless/**/config*.ts', 'x-pack/test_serverless/*/test_suites/**/*', 'x-pack/test/profiling_api_integration/**/*.ts', diff --git a/x-pack/test/api_integration/apis/all_deployments/config.ts b/x-pack/test/api_integration/apis/all_deployments/config.ts new file mode 100644 index 0000000000000..9d8bb0d82bd26 --- /dev/null +++ b/x-pack/test/api_integration/apis/all_deployments/config.ts @@ -0,0 +1,25 @@ +/* + * 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 baseIntegrationTestsConfig = await readConfigFile(require.resolve('../../config.ts')); + + return { + ...baseIntegrationTestsConfig.getAll(), + testFiles: [ + require.resolve('../../../../test_all_deployments/api_integration/test_suites/common'), + require.resolve('../../../../test_all_deployments/api_integration/test_suites/observability'), + require.resolve('../../../../test_all_deployments/api_integration/test_suites/search'), + require.resolve('../../../../test_all_deployments/api_integration/test_suites/security'), + ], + junit: { + reportName: 'X-Pack API Integration Tests - all deployments tests', + }, + }; +} diff --git a/x-pack/test/common/services/common_api.ts b/x-pack/test/common/services/common_api.ts new file mode 100644 index 0000000000000..7ed7b592684b3 --- /dev/null +++ b/x-pack/test/common/services/common_api.ts @@ -0,0 +1,31 @@ +/* + * 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'; + +const COMMON_REQUEST_HEADERS = { + 'kbn-xsrf': 'some-xsrf-token', +}; + +export function CommonApiServiceProvider({}: FtrProviderContext) { + return { + getCommonRequestHeader() { + return COMMON_REQUEST_HEADERS; + }, + + assertResponseStatusCode(expectedStatus: number, actualStatus: number, responseBody: object) { + expect(actualStatus).to.eql( + expectedStatus, + `Expected status code ${expectedStatus}, got ${actualStatus} with body '${JSON.stringify( + responseBody + )}'` + ); + }, + }; +} diff --git a/x-pack/test/common/services/index.ts b/x-pack/test/common/services/index.ts index 0f247ad743edf..5d091197dc6d7 100644 --- a/x-pack/test/common/services/index.ts +++ b/x-pack/test/common/services/index.ts @@ -10,6 +10,7 @@ import { services as kibanaCommonServices } from '../../../../test/common/servic import { InfraLogViewsServiceProvider } from './infra_log_views'; import { SpacesServiceProvider } from './spaces'; import { BsearchSecureService } from './bsearch_secure'; +import { CommonApiServiceProvider } from './common_api'; export const services = { ...kibanaCommonServices, @@ -17,4 +18,5 @@ export const services = { supertest: kibanaApiIntegrationServices.supertest, spaces: SpacesServiceProvider, secureBsearch: BsearchSecureService, + commonApi: CommonApiServiceProvider, }; diff --git a/x-pack/test/functional/apps/all_deployments/config.ts b/x-pack/test/functional/apps/all_deployments/config.ts new file mode 100644 index 0000000000000..ad48d87859e42 --- /dev/null +++ b/x-pack/test/functional/apps/all_deployments/config.ts @@ -0,0 +1,25 @@ +/* + * 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 baseIntegrationTestsConfig = await readConfigFile(require.resolve('../../config.base.js')); + + return { + ...baseIntegrationTestsConfig.getAll(), + testFiles: [ + require.resolve('../../../../test_all_deployments/functional/test_suites/common'), + require.resolve('../../../../test_all_deployments/functional/test_suites/observability'), + require.resolve('../../../../test_all_deployments/functional/test_suites/search'), + require.resolve('../../../../test_all_deployments/functional/test_suites/security'), + ], + junit: { + reportName: 'Chrome X-Pack UI Functional Tests - all deployments tests', + }, + }; +} diff --git a/x-pack/test_all_deployments/README.md b/x-pack/test_all_deployments/README.md new file mode 100644 index 0000000000000..744c027853a99 --- /dev/null +++ b/x-pack/test_all_deployments/README.md @@ -0,0 +1,5 @@ +# Kibana tests for all deployments + +TBD, structure and additional explanations, e.g. +* no dedicated config +* no dedicated services / page objects - only x-pack version available (no serverless) \ No newline at end of file diff --git a/x-pack/test_all_deployments/api_integration/ftr_provider_context.d.ts b/x-pack/test_all_deployments/api_integration/ftr_provider_context.d.ts new file mode 100644 index 0000000000000..b25a83ea85124 --- /dev/null +++ b/x-pack/test_all_deployments/api_integration/ftr_provider_context.d.ts @@ -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 { GenericFtrProviderContext } from '@kbn/test'; + +// eslint-disable-next-line @kbn/imports/no_boundary_crossing +import { services } from '../../test/api_integration/services'; + +export type FtrProviderContext = GenericFtrProviderContext; diff --git a/x-pack/test_all_deployments/api_integration/test_suites/common/index.ts b/x-pack/test_all_deployments/api_integration/test_suites/common/index.ts new file mode 100644 index 0000000000000..05afb50b210e1 --- /dev/null +++ b/x-pack/test_all_deployments/api_integration/test_suites/common/index.ts @@ -0,0 +1,14 @@ +/* + * 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('all deployments common API', function () { + loadTestFile(require.resolve('./status')); + }); +} diff --git a/x-pack/test_all_deployments/api_integration/test_suites/common/status.ts b/x-pack/test_all_deployments/api_integration/test_suites/common/status.ts new file mode 100644 index 0000000000000..e399baa189563 --- /dev/null +++ b/x-pack/test_all_deployments/api_integration/test_suites/common/status.ts @@ -0,0 +1,23 @@ +/* + * 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 ({ getService }: FtrProviderContext) { + const commonApi = getService('commonApi'); + const supertest = getService('supertest'); + + describe('Status API', function () { + it('gets the status', async () => { + const { body, status } = await supertest + .get(`/api/status`) + .set(commonApi.getCommonRequestHeader()); + + commonApi.assertResponseStatusCode(200, status, body); + }); + }); +} diff --git a/x-pack/test_all_deployments/api_integration/test_suites/observability/index.ts b/x-pack/test_all_deployments/api_integration/test_suites/observability/index.ts new file mode 100644 index 0000000000000..0f808a46a3992 --- /dev/null +++ b/x-pack/test_all_deployments/api_integration/test_suites/observability/index.ts @@ -0,0 +1,14 @@ +/* + * 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('all deployments observability API', function () { + loadTestFile(require.resolve('./status')); + }); +} diff --git a/x-pack/test_all_deployments/api_integration/test_suites/observability/status.ts b/x-pack/test_all_deployments/api_integration/test_suites/observability/status.ts new file mode 100644 index 0000000000000..1c081c0091152 --- /dev/null +++ b/x-pack/test_all_deployments/api_integration/test_suites/observability/status.ts @@ -0,0 +1,24 @@ +/* + * 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 ({ getService }: FtrProviderContext) { + const commonApi = getService('commonApi'); + const supertest = getService('supertest'); + + // This is a dummy test. Replace with something useful! + describe('Status API', function () { + it('gets the status', async () => { + const { body, status } = await supertest + .get(`/api/status`) + .set(commonApi.getCommonRequestHeader()); + + commonApi.assertResponseStatusCode(200, status, body); + }); + }); +} diff --git a/x-pack/test_all_deployments/api_integration/test_suites/search/index.ts b/x-pack/test_all_deployments/api_integration/test_suites/search/index.ts new file mode 100644 index 0000000000000..932d66b438a09 --- /dev/null +++ b/x-pack/test_all_deployments/api_integration/test_suites/search/index.ts @@ -0,0 +1,14 @@ +/* + * 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('all deployments search API', function () { + loadTestFile(require.resolve('./status')); + }); +} diff --git a/x-pack/test_all_deployments/api_integration/test_suites/search/status.ts b/x-pack/test_all_deployments/api_integration/test_suites/search/status.ts new file mode 100644 index 0000000000000..1c081c0091152 --- /dev/null +++ b/x-pack/test_all_deployments/api_integration/test_suites/search/status.ts @@ -0,0 +1,24 @@ +/* + * 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 ({ getService }: FtrProviderContext) { + const commonApi = getService('commonApi'); + const supertest = getService('supertest'); + + // This is a dummy test. Replace with something useful! + describe('Status API', function () { + it('gets the status', async () => { + const { body, status } = await supertest + .get(`/api/status`) + .set(commonApi.getCommonRequestHeader()); + + commonApi.assertResponseStatusCode(200, status, body); + }); + }); +} diff --git a/x-pack/test_all_deployments/api_integration/test_suites/security/index.ts b/x-pack/test_all_deployments/api_integration/test_suites/security/index.ts new file mode 100644 index 0000000000000..ab5ae6f771e57 --- /dev/null +++ b/x-pack/test_all_deployments/api_integration/test_suites/security/index.ts @@ -0,0 +1,14 @@ +/* + * 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('all deployments security API', function () { + loadTestFile(require.resolve('./status')); + }); +} diff --git a/x-pack/test_all_deployments/api_integration/test_suites/security/status.ts b/x-pack/test_all_deployments/api_integration/test_suites/security/status.ts new file mode 100644 index 0000000000000..1c081c0091152 --- /dev/null +++ b/x-pack/test_all_deployments/api_integration/test_suites/security/status.ts @@ -0,0 +1,24 @@ +/* + * 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 ({ getService }: FtrProviderContext) { + const commonApi = getService('commonApi'); + const supertest = getService('supertest'); + + // This is a dummy test. Replace with something useful! + describe('Status API', function () { + it('gets the status', async () => { + const { body, status } = await supertest + .get(`/api/status`) + .set(commonApi.getCommonRequestHeader()); + + commonApi.assertResponseStatusCode(200, status, body); + }); + }); +} diff --git a/x-pack/test_all_deployments/functional/ftr_provider_context.d.ts b/x-pack/test_all_deployments/functional/ftr_provider_context.d.ts new file mode 100644 index 0000000000000..0dd082f3928cd --- /dev/null +++ b/x-pack/test_all_deployments/functional/ftr_provider_context.d.ts @@ -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 { GenericFtrProviderContext } from '@kbn/test'; + +// eslint-disable-next-line @kbn/imports/no_boundary_crossing +import { services } from '../../test/functional/page_objects'; + +// eslint-disable-next-line @kbn/imports/no_boundary_crossing +import { services } from '../../test/functional/services'; + +export type FtrProviderContext = GenericFtrProviderContext; diff --git a/x-pack/test_all_deployments/functional/test_suites/common/home_page.ts b/x-pack/test_all_deployments/functional/test_suites/common/home_page.ts new file mode 100644 index 0000000000000..71a16720cd98d --- /dev/null +++ b/x-pack/test_all_deployments/functional/test_suites/common/home_page.ts @@ -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 ({ getPageObject, getService }: FtrProviderContext) { + const commonPage = getPageObject('common'); + const testSubjects = getService('testSubjects'); + + describe('home page', function () { + it('navigates to home page', async () => { + await commonPage.navigateToApp('home'); + await testSubjects.existOrFail('homeApp', { timeout: 2000 }); + }); + }); +} diff --git a/x-pack/test_all_deployments/functional/test_suites/common/index.ts b/x-pack/test_all_deployments/functional/test_suites/common/index.ts new file mode 100644 index 0000000000000..c544eb5739646 --- /dev/null +++ b/x-pack/test_all_deployments/functional/test_suites/common/index.ts @@ -0,0 +1,14 @@ +/* + * 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('all deployments common UI', function () { + loadTestFile(require.resolve('./home_page')); + }); +} diff --git a/x-pack/test_all_deployments/functional/test_suites/observability/home_page.ts b/x-pack/test_all_deployments/functional/test_suites/observability/home_page.ts new file mode 100644 index 0000000000000..36ed41e6bc72a --- /dev/null +++ b/x-pack/test_all_deployments/functional/test_suites/observability/home_page.ts @@ -0,0 +1,21 @@ +/* + * 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 ({ getPageObject, getService }: FtrProviderContext) { + const commonPage = getPageObject('common'); + const testSubjects = getService('testSubjects'); + + // This is a dummy test. Replace with something useful! + describe('home page', function () { + it('navigates to home page', async () => { + await commonPage.navigateToApp('home'); + await testSubjects.existOrFail('homeApp', { timeout: 2000 }); + }); + }); +} diff --git a/x-pack/test_all_deployments/functional/test_suites/observability/index.ts b/x-pack/test_all_deployments/functional/test_suites/observability/index.ts new file mode 100644 index 0000000000000..81de590b46a46 --- /dev/null +++ b/x-pack/test_all_deployments/functional/test_suites/observability/index.ts @@ -0,0 +1,14 @@ +/* + * 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('all deployments observability UI', function () { + loadTestFile(require.resolve('./home_page')); + }); +} diff --git a/x-pack/test_all_deployments/functional/test_suites/search/home_page.ts b/x-pack/test_all_deployments/functional/test_suites/search/home_page.ts new file mode 100644 index 0000000000000..36ed41e6bc72a --- /dev/null +++ b/x-pack/test_all_deployments/functional/test_suites/search/home_page.ts @@ -0,0 +1,21 @@ +/* + * 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 ({ getPageObject, getService }: FtrProviderContext) { + const commonPage = getPageObject('common'); + const testSubjects = getService('testSubjects'); + + // This is a dummy test. Replace with something useful! + describe('home page', function () { + it('navigates to home page', async () => { + await commonPage.navigateToApp('home'); + await testSubjects.existOrFail('homeApp', { timeout: 2000 }); + }); + }); +} diff --git a/x-pack/test_all_deployments/functional/test_suites/search/index.ts b/x-pack/test_all_deployments/functional/test_suites/search/index.ts new file mode 100644 index 0000000000000..8e14e8d3b927e --- /dev/null +++ b/x-pack/test_all_deployments/functional/test_suites/search/index.ts @@ -0,0 +1,14 @@ +/* + * 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('all deployments search UI', function () { + loadTestFile(require.resolve('./home_page')); + }); +} diff --git a/x-pack/test_all_deployments/functional/test_suites/security/home_page.ts b/x-pack/test_all_deployments/functional/test_suites/security/home_page.ts new file mode 100644 index 0000000000000..36ed41e6bc72a --- /dev/null +++ b/x-pack/test_all_deployments/functional/test_suites/security/home_page.ts @@ -0,0 +1,21 @@ +/* + * 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 ({ getPageObject, getService }: FtrProviderContext) { + const commonPage = getPageObject('common'); + const testSubjects = getService('testSubjects'); + + // This is a dummy test. Replace with something useful! + describe('home page', function () { + it('navigates to home page', async () => { + await commonPage.navigateToApp('home'); + await testSubjects.existOrFail('homeApp', { timeout: 2000 }); + }); + }); +} diff --git a/x-pack/test_all_deployments/functional/test_suites/security/index.ts b/x-pack/test_all_deployments/functional/test_suites/security/index.ts new file mode 100644 index 0000000000000..89f7ae49a7846 --- /dev/null +++ b/x-pack/test_all_deployments/functional/test_suites/security/index.ts @@ -0,0 +1,14 @@ +/* + * 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('all deployments security UI', function () { + loadTestFile(require.resolve('./home_page')); + }); +} diff --git a/x-pack/test_all_deployments/tsconfig.json b/x-pack/test_all_deployments/tsconfig.json new file mode 100644 index 0000000000000..1ebca2d3092a0 --- /dev/null +++ b/x-pack/test_all_deployments/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "rootDirs": [".", "../test"], + "types": ["node", "@kbn/ambient-ftr-types"], + }, + "include": [ + "**/*", + "../../typings/**/*", + "../../packages/kbn-test/types/ftr_globals/**/*", + ], + "exclude": [ + "target/**/*", + "*/plugins/**/*", + "*/packages/**/*", + "*/*/packages/**/*", + ], + "kbn_references": [ + { "path": "../test/tsconfig.json" }, + "@kbn/expect", + "@kbn/test", + "@kbn/repo-info", + "@kbn/dev-proc-runner", + ] +} diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/config.ts b/x-pack/test_serverless/api_integration/test_suites/observability/config.ts index 80a4b18fe1639..92c645fc33673 100644 --- a/x-pack/test_serverless/api_integration/test_suites/observability/config.ts +++ b/x-pack/test_serverless/api_integration/test_suites/observability/config.ts @@ -9,7 +9,12 @@ import { createTestConfig } from '../../config.base'; export default createTestConfig({ serverlessProject: 'oblt', - testFiles: [require.resolve('../common'), require.resolve('.')], + testFiles: [ + require.resolve('../common'), + require.resolve('.'), + require.resolve('../../../../test_all_deployments/api_integration/test_suites/common'), + require.resolve('../../../../test_all_deployments/api_integration/test_suites/observability'), + ], junit: { reportName: 'Serverless Observability API Integration Tests', }, diff --git a/x-pack/test_serverless/api_integration/test_suites/search/config.ts b/x-pack/test_serverless/api_integration/test_suites/search/config.ts index fa1cefff02273..9dbf14bea44e3 100644 --- a/x-pack/test_serverless/api_integration/test_suites/search/config.ts +++ b/x-pack/test_serverless/api_integration/test_suites/search/config.ts @@ -9,7 +9,12 @@ import { createTestConfig } from '../../config.base'; export default createTestConfig({ serverlessProject: 'es', - testFiles: [require.resolve('../common'), require.resolve('.')], + testFiles: [ + require.resolve('../common'), + require.resolve('.'), + require.resolve('../../../../test_all_deployments/api_integration/test_suites/common'), + require.resolve('../../../../test_all_deployments/api_integration/test_suites/search'), + ], junit: { reportName: 'Serverless Search API Integration Tests', }, diff --git a/x-pack/test_serverless/api_integration/test_suites/security/config.ts b/x-pack/test_serverless/api_integration/test_suites/security/config.ts index e313d7abdf9d6..377a0cc699ff5 100644 --- a/x-pack/test_serverless/api_integration/test_suites/security/config.ts +++ b/x-pack/test_serverless/api_integration/test_suites/security/config.ts @@ -9,7 +9,12 @@ import { createTestConfig } from '../../config.base'; export default createTestConfig({ serverlessProject: 'security', - testFiles: [require.resolve('../common'), require.resolve('.')], + testFiles: [ + require.resolve('../common'), + require.resolve('.'), + require.resolve('../../../../test_all_deployments/api_integration/test_suites/common'), + require.resolve('../../../../test_all_deployments/api_integration/test_suites/security'), + ], junit: { reportName: 'Serverless Security API Integration Tests', }, diff --git a/x-pack/test_serverless/functional/test_suites/observability/config.ts b/x-pack/test_serverless/functional/test_suites/observability/config.ts index 077dfff243735..0fa564a4a5164 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/config.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/config.ts @@ -9,7 +9,12 @@ import { createTestConfig } from '../../config.base'; export default createTestConfig({ serverlessProject: 'oblt', - testFiles: [require.resolve('../common'), require.resolve('.')], + testFiles: [ + require.resolve('../common'), + require.resolve('.'), + require.resolve('../../../../test_all_deployments/functional/test_suites/common'), + require.resolve('../../../../test_all_deployments/functional/test_suites/observability'), + ], junit: { reportName: 'Serverless Observability Functional Tests', }, diff --git a/x-pack/test_serverless/functional/test_suites/search/config.ts b/x-pack/test_serverless/functional/test_suites/search/config.ts index 124a4fc90a9e6..48ea34894c088 100644 --- a/x-pack/test_serverless/functional/test_suites/search/config.ts +++ b/x-pack/test_serverless/functional/test_suites/search/config.ts @@ -9,7 +9,12 @@ import { createTestConfig } from '../../config.base'; export default createTestConfig({ serverlessProject: 'es', - testFiles: [require.resolve('../common'), require.resolve('.')], + testFiles: [ + require.resolve('../common'), + require.resolve('.'), + require.resolve('../../../../test_all_deployments/functional/test_suites/common'), + require.resolve('../../../../test_all_deployments/functional/test_suites/search'), + ], junit: { reportName: 'Serverless Search Functional Tests', }, diff --git a/x-pack/test_serverless/functional/test_suites/security/config.ts b/x-pack/test_serverless/functional/test_suites/security/config.ts index e255310c61b28..0d7e1f55c17c0 100644 --- a/x-pack/test_serverless/functional/test_suites/security/config.ts +++ b/x-pack/test_serverless/functional/test_suites/security/config.ts @@ -9,7 +9,12 @@ import { createTestConfig } from '../../config.base'; export default createTestConfig({ serverlessProject: 'security', - testFiles: [require.resolve('../common'), require.resolve('.')], + testFiles: [ + require.resolve('../common'), + require.resolve('.'), + require.resolve('../../../../test_all_deployments/functional/test_suites/common'), + require.resolve('../../../../test_all_deployments/functional/test_suites/security'), + ], junit: { reportName: 'Serverless Security Functional Tests', }, From 74149e65d18622996a71efd020cc040000aa486f Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:18:25 +0000 Subject: [PATCH 2/2] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- x-pack/test_all_deployments/tsconfig.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/x-pack/test_all_deployments/tsconfig.json b/x-pack/test_all_deployments/tsconfig.json index 1ebca2d3092a0..c142d1fc78c05 100644 --- a/x-pack/test_all_deployments/tsconfig.json +++ b/x-pack/test_all_deployments/tsconfig.json @@ -18,9 +18,6 @@ ], "kbn_references": [ { "path": "../test/tsconfig.json" }, - "@kbn/expect", "@kbn/test", - "@kbn/repo-info", - "@kbn/dev-proc-runner", ] }