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
2 changes: 1 addition & 1 deletion .buildkite/ftr_oblt_serverless_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ enabled:
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group6.ts
- x-pack/test_serverless/functional/test_suites/observability/config.screenshots.ts
# serverless config files that run deployment-agnostic tests
- x-pack/test/api_integration/deployment_agnostic/oblt.serverless.config.ts
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
2 changes: 2 additions & 0 deletions .buildkite/ftr_oblt_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ enabled:
- x-pack/test/observability_ai_assistant_functional/enterprise/config.ts
- x-pack/test/profiling_api_integration/cloud/config.ts
- x-pack/test/functional/apps/apm/config.ts
# stateful config files that run deployment-agnostic tests
- x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
2 changes: 1 addition & 1 deletion .buildkite/ftr_platform_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -361,4 +361,4 @@ enabled:
- x-pack/performance/journeys_e2e/infra_hosts_view.ts
- x-pack/test/custom_branding/config.ts
# stateful config files that run deployment-agnostic tests
- x-pack/test/api_integration/deployment_agnostic/stateful.config.ts
- x-pack/test/api_integration/deployment_agnostic/configs/stateful/platform.stateful.config.ts
2 changes: 1 addition & 1 deletion .buildkite/ftr_search_serverless_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ enabled:
- x-pack/test_serverless/functional/test_suites/search/common_configs/config.group5.ts
- x-pack/test_serverless/functional/test_suites/search/common_configs/config.group6.ts
# serverless config files that run deployment-agnostic tests
- x-pack/test/api_integration/deployment_agnostic/search.serverless.config.ts
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/search.serverless.config.ts
2 changes: 1 addition & 1 deletion .buildkite/ftr_security_serverless_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ enabled:
- x-pack/test/security_solution_endpoint/configs/serverless.endpoint.config.ts
- x-pack/test/security_solution_endpoint/configs/serverless.integrations.config.ts
# serverless config files that run deployment-agnostic tests
- x-pack/test/api_integration/deployment_agnostic/security.serverless.config.ts
- x-pack/test/api_integration/deployment_agnostic/configs/serverless/security.serverless.config.ts
34 changes: 21 additions & 13 deletions x-pack/test/api_integration/deployment_agnostic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,25 @@ x-pack/test/<my_own_api_integration_folder>
│ │ ├─ <api_2>
│ │ │ ├─ <test_2_1>
│ │ │ ├─ <test_2_2>
│ ├─ services
│ │ ├─ index.ts // only services from 'x-pack/test/api_integration/deployment_agnostic/services'
│ │ ├─ <deployment_agnostic_service_1>.ts
│ │ ├─ <deployment_agnostic_service_2>.ts
│ ├─ configs
│ │ ├─ stateful
│ │ │ ├─ <stateful>.index.ts // e.g., oblt.index.ts
│ │ │ ├─ <stateful>.config.ts // e.g., oblt.stateful.config.ts
│ │ ├─ serverless
│ │ ├─ <serverless_project>.index.ts // e.g., oblt.index.ts
│ │ ├─ <serverless_project>.serverless.config.ts // e.g., oblt.serverless.config.ts
│ ├─ ftr_provider_context.d.ts // with types of services from './services'
├─ stateful.index.ts
├─ stateful.config.ts
├─ <serverless_project>.index.ts // e.g., oblt.index.ts
├─ <serverless_project>.serverless.config.ts // e.g., oblt.serverless.config.ts
├─ services
├─ index.ts // only services from 'x-pack/test/api_integration/deployment_agnostic/services'
├─ <deployment_agnostic_service_1>.ts
├─ <deployment_agnostic_service_2>.ts
```

## Loading Your Tests Properly
When Platform teams add deployment-agnostic tests, it is expected that these tests are loaded in `configs/stateful/platform.index.ts` and at least one of the `<serverless_project>.serverless.config` files under `configs/serverless` folder.

When a Solution team (e.g., one of the Oblt teams) adds deployment-agnostic tests, it is expected that these tests are loaded in both `configs/stateful/oblt.index.ts` and `configs/serverless/oblt.index.ts`.

## Step-by-Step Guide
1. Define Deployment-Agnostic Services

Expand Down Expand Up @@ -121,26 +129,26 @@ Load all test files in `index.ts` under the same folder.

4. Add Tests Entry File and FTR Config File for **Stateful** Deployment

Create `stateful.index.ts` tests entry file and load tests:
Create `configs/stateful/plaform.index.ts` tests entry file and load tests:

```ts
import { DeploymentAgnosticFtrProviderContext } from './ftr_provider_context';

export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) {
describe('apis', () => {
loadTestFile(require.resolve('./apis/<my_api>'));
loadTestFile(require.resolve('./../../apis/<my_api>'));
});
}
```

Create `stateful.config.ts` and link tests entry file:
Create `configs/stateful/platform.stateful.config.ts` and link tests entry file:

```ts
import { createStatefulTestConfig } from './../../api_integration/deployment_agnostic/default_configs/stateful.config.base';
import { services } from './services';

export default createStatefulTestConfig({
testFiles: [require.resolve('./stateful.index.ts')],
testFiles: [require.resolve('./platform.index.ts')],
services,
junit: {
reportName: 'Stateful - Deployment-agnostic API Integration Tests',
Expand All @@ -157,7 +165,7 @@ import { DeploymentAgnosticFtrProviderContext } from './ftr_provider_context';

export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) {
describe('Serverless Observability - Deployment-agnostic api integration tests', () => {
loadTestFile(require.resolve('./apis/<my_api>'));
loadTestFile(require.resolve('./../../apis/<my_api>'));
});
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { DeploymentAgnosticFtrProviderContext } from './ftr_provider_context';
import { DeploymentAgnosticFtrProviderContext } from '../../ftr_provider_context';

export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) {
describe('Serverless Observability - Deployment-agnostic api integration tests', () => {
loadTestFile(require.resolve('./apis/console'));
loadTestFile(require.resolve('./apis/core'));
loadTestFile(require.resolve('./apis/painless_lab'));
// load new oblt and platform deployment-agnostic test here
loadTestFile(require.resolve('../../apis/console'));
loadTestFile(require.resolve('../../apis/core'));
loadTestFile(require.resolve('../../apis/painless_lab'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { createServerlessTestConfig } from './default_configs/serverless.config.base';
import { createServerlessTestConfig } from '../../default_configs/serverless.config.base';

export default createServerlessTestConfig({
serverlessProject: 'oblt',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { DeploymentAgnosticFtrProviderContext } from './ftr_provider_context';
import { DeploymentAgnosticFtrProviderContext } from '../../ftr_provider_context';

export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) {
describe('Serverless Search - Deployment-agnostic api integration tests', () => {
loadTestFile(require.resolve('./apis/console'));
loadTestFile(require.resolve('./apis/core'));
// load new search and platform deployment-agnostic test here
loadTestFile(require.resolve('../../apis/console'));
loadTestFile(require.resolve('../../apis/core'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { createServerlessTestConfig } from './default_configs/serverless.config.base';
import { createServerlessTestConfig } from '../../default_configs/serverless.config.base';

export default createServerlessTestConfig({
serverlessProject: 'es',
Expand Down
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 { DeploymentAgnosticFtrProviderContext } from '../../ftr_provider_context';

export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) {
describe('Serverless Security - Deployment-agnostic api integration tests', () => {
// load new security and platform deployment-agnostic test here
loadTestFile(require.resolve('../../apis/console'));
loadTestFile(require.resolve('../../apis/core'));
loadTestFile(require.resolve('../../apis/painless_lab'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { createServerlessTestConfig } from './default_configs/serverless.config.base';
import { createServerlessTestConfig } from '../../default_configs/serverless.config.base';

export default createServerlessTestConfig({
serverlessProject: 'security',
Expand Down
Original file line number Diff line number Diff line change
@@ -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 { DeploymentAgnosticFtrProviderContext } from '../../ftr_provider_context';

export default function ({}: DeploymentAgnosticFtrProviderContext) {
describe('apis', () => {
// load new oblt deployment-agnostic test here
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* 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 { createStatefulTestConfig } from '../../default_configs/stateful.config.base';

export default createStatefulTestConfig({
testFiles: [require.resolve('./oblt.index.ts')],
junit: {
reportName: 'Observibility Stateful - Deployment-agnostic API Integration Tests',
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
* 2.0.
*/

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

export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) {
describe('apis', () => {
loadTestFile(require.resolve('./apis/console'));
loadTestFile(require.resolve('./apis/core'));
loadTestFile(require.resolve('./apis/painless_lab'));
// load new platform deployment-agnostic test here
loadTestFile(require.resolve('../../apis/console'));
loadTestFile(require.resolve('../../apis/core'));
loadTestFile(require.resolve('../../apis/painless_lab'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* 2.0.
*/

import { createStatefulTestConfig } from './default_configs/stateful.config.base';
import { createStatefulTestConfig } from '../../default_configs/stateful.config.base';

export default createStatefulTestConfig({
testFiles: [require.resolve('./stateful.index.ts')],
testFiles: [require.resolve('./platform.index.ts')],
junit: {
reportName: 'Stateful - Deployment-agnostic API Integration Tests',
reportName: 'Platform Stateful - Deployment-agnostic API Integration Tests',
},
});
15 changes: 0 additions & 15 deletions x-pack/test/api_integration/deployment_agnostic/security.index.ts

This file was deleted.