[scout] migrate FTR serverless API management tests#262124
[scout] migrate FTR serverless API management tests#262124dmlemeshko merged 16 commits intoelastic:mainfrom
Conversation
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| /** Matches a string that contains the expected substring */ | ||
| stringContaining: (expected: string) => | ||
| createAsymmetricMatcher( | ||
| (actual) => typeof actual === 'string' && actual.includes(expected), | ||
| `stringContaining(${JSON.stringify(expected)})` | ||
| ), |
There was a problem hiding this comment.
it was used by one of the migrated tests, seems to be reasonable addition
| apiTest( | ||
| 'should not allow us to update a space with disabled features', | ||
| async ({ apiClient }) => { | ||
| const response = await apiClient.put('api/spaces/space/space_to_update', { | ||
| headers: { ...COMMON_HEADERS, ...adminApiCredentials.apiKeyHeader }, | ||
| body: { | ||
| id: 'space_to_update', | ||
| name: 'some new name', | ||
| initials: 'SN', | ||
| disabledFeatures: ['discover'], | ||
| }, | ||
| }); | ||
|
|
||
| expect(response).toHaveStatusCode(400); | ||
| } | ||
| ); |
There was a problem hiding this comment.
This one doesnt create space_to_update itself. It relies on the preceding should allow us to update a space test having created it. If that test fails or is skipped, this one will break with a misleading error (exp 404 not found)
There was a problem hiding this comment.
updated, good catch
davismcphee
left a comment
There was a problem hiding this comment.
Data Discover changes LGTM 👍
There was a problem hiding this comment.
Could we put the new tests in the data_views subfolder? Seems like that would match what we've been doing so far.
jeramysoucy
left a comment
There was a problem hiding this comment.
Sorry for the delay! LGTM, but can we improve the file names on serverless-specific tests? E.g.
- serverless_crud.spec.ts
- serverless_route_access.spec.ts
| /** | ||
| * Serverless-specific spaces CRUD tests. | ||
| * Feature visibility cannot be set in serverless — the create/update tests | ||
| * verifying that disabledFeatures is rejected are unique to serverless. |
There was a problem hiding this comment.
Nit: the path/name of the file does not easily identify this as a serverless-specific test suite.
| ...tags.serverless.observability.complete, | ||
| ...tags.serverless.search, | ||
| ...tags.serverless.security.complete, | ||
| ], |
There was a problem hiding this comment.
Nit: same as above. Would it make sense to put serverless-specific tests in their own folder, or to add a name prefix?
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
|
|
Starting backport for target branches: 9.3, 9.4 https://github.com/elastic/kibana/actions/runs/24442055845 |
## Summary This PR migrates FTR API tests from `x-pack/platform/test/serverless/api_integration/test_suites/management/` - rollups.ts - scripted_fields.ts - spaces.ts to Scout API tests across two plugins: - `src/platform/plugins/shared/data_views/test/scout/api/tests/` - rollup_data_views.spec.ts - scripted_fields_disabled.spec.ts - `x-pack/platform/plugins/shared/spaces/test/scout/api/tests/` - crud.spec.ts - active_space.spec.ts (tags broadened to `deploymentAgnostic`; stateful FTR counterpart `x-pack/platform/test/api_integration/apis/spaces/get_active_space.ts` removed) - route_access.spec.ts (cherry picked from commit d83040b)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
## Summary This PR migrates FTR API tests from `x-pack/platform/test/serverless/api_integration/test_suites/management/` - rollups.ts - scripted_fields.ts - spaces.ts to Scout API tests across two plugins: - `src/platform/plugins/shared/data_views/test/scout/api/tests/` - rollup_data_views.spec.ts - scripted_fields_disabled.spec.ts - `x-pack/platform/plugins/shared/spaces/test/scout/api/tests/` - crud.spec.ts - active_space.spec.ts (tags broadened to `deploymentAgnostic`; stateful FTR counterpart `x-pack/platform/test/api_integration/apis/spaces/get_active_space.ts` removed) - route_access.spec.ts (cherry picked from commit d83040b) # Conflicts: # x-pack/platform/test/serverless/api_integration/test_suites/management/spaces.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…263291) # Backport This will backport the following commits from `main` to `9.4`: - [[scout] migrate FTR serverless API management tests (#262124)](#262124) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2026-04-15T07:29:18Z","message":"[scout] migrate FTR serverless API management tests (#262124)\n\n## Summary\n\nThis PR migrates FTR API tests from\n`x-pack/platform/test/serverless/api_integration/test_suites/management/`\n\n- rollups.ts\n- scripted_fields.ts\n- spaces.ts\n\nto Scout API tests across two plugins:\n\n- `src/platform/plugins/shared/data_views/test/scout/api/tests/`\n - rollup_data_views.spec.ts\n - scripted_fields_disabled.spec.ts\n\n- `x-pack/platform/plugins/shared/spaces/test/scout/api/tests/`\n - crud.spec.ts\n- active_space.spec.ts (tags broadened to `deploymentAgnostic`; stateful\nFTR counterpart\n`x-pack/platform/test/api_integration/apis/spaces/get_active_space.ts`\nremoved)\n - route_access.spec.ts","sha":"d83040b6ec743859edf2ebe974e6d71ac2bae5b8","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.4.0","v9.5.0","v9.3.4"],"title":"[scout] migrate FTR serverless API management tests","number":262124,"url":"https://github.com/elastic/kibana/pull/262124","mergeCommit":{"message":"[scout] migrate FTR serverless API management tests (#262124)\n\n## Summary\n\nThis PR migrates FTR API tests from\n`x-pack/platform/test/serverless/api_integration/test_suites/management/`\n\n- rollups.ts\n- scripted_fields.ts\n- spaces.ts\n\nto Scout API tests across two plugins:\n\n- `src/platform/plugins/shared/data_views/test/scout/api/tests/`\n - rollup_data_views.spec.ts\n - scripted_fields_disabled.spec.ts\n\n- `x-pack/platform/plugins/shared/spaces/test/scout/api/tests/`\n - crud.spec.ts\n- active_space.spec.ts (tags broadened to `deploymentAgnostic`; stateful\nFTR counterpart\n`x-pack/platform/test/api_integration/apis/spaces/get_active_space.ts`\nremoved)\n - route_access.spec.ts","sha":"d83040b6ec743859edf2ebe974e6d71ac2bae5b8"}},"sourceBranch":"main","suggestedTargetBranches":["9.4","9.3"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/262124","number":262124,"mergeCommit":{"message":"[scout] migrate FTR serverless API management tests (#262124)\n\n## Summary\n\nThis PR migrates FTR API tests from\n`x-pack/platform/test/serverless/api_integration/test_suites/management/`\n\n- rollups.ts\n- scripted_fields.ts\n- spaces.ts\n\nto Scout API tests across two plugins:\n\n- `src/platform/plugins/shared/data_views/test/scout/api/tests/`\n - rollup_data_views.spec.ts\n - scripted_fields_disabled.spec.ts\n\n- `x-pack/platform/plugins/shared/spaces/test/scout/api/tests/`\n - crud.spec.ts\n- active_space.spec.ts (tags broadened to `deploymentAgnostic`; stateful\nFTR counterpart\n`x-pack/platform/test/api_integration/apis/spaces/get_active_space.ts`\nremoved)\n - route_access.spec.ts","sha":"d83040b6ec743859edf2ebe974e6d71ac2bae5b8"}},{"branch":"9.3","label":"v9.3.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
…263299) # Backport This will backport the following commits from `main` to `9.3`: - [[scout] migrate FTR serverless API management tests (#262124)](#262124) <!--- Backport version: 11.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2026-04-15T07:29:18Z","message":"[scout] migrate FTR serverless API management tests (#262124)\n\n## Summary\n\nThis PR migrates FTR API tests from\n`x-pack/platform/test/serverless/api_integration/test_suites/management/`\n\n- rollups.ts\n- scripted_fields.ts\n- spaces.ts\n\nto Scout API tests across two plugins:\n\n- `src/platform/plugins/shared/data_views/test/scout/api/tests/`\n - rollup_data_views.spec.ts\n - scripted_fields_disabled.spec.ts\n\n- `x-pack/platform/plugins/shared/spaces/test/scout/api/tests/`\n - crud.spec.ts\n- active_space.spec.ts (tags broadened to `deploymentAgnostic`; stateful\nFTR counterpart\n`x-pack/platform/test/api_integration/apis/spaces/get_active_space.ts`\nremoved)\n - route_access.spec.ts","sha":"d83040b6ec743859edf2ebe974e6d71ac2bae5b8","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.4.0","v9.5.0","v9.3.4"],"title":"[scout] migrate FTR serverless API management tests","number":262124,"url":"https://github.com/elastic/kibana/pull/262124","mergeCommit":{"message":"[scout] migrate FTR serverless API management tests (#262124)\n\n## Summary\n\nThis PR migrates FTR API tests from\n`x-pack/platform/test/serverless/api_integration/test_suites/management/`\n\n- rollups.ts\n- scripted_fields.ts\n- spaces.ts\n\nto Scout API tests across two plugins:\n\n- `src/platform/plugins/shared/data_views/test/scout/api/tests/`\n - rollup_data_views.spec.ts\n - scripted_fields_disabled.spec.ts\n\n- `x-pack/platform/plugins/shared/spaces/test/scout/api/tests/`\n - crud.spec.ts\n- active_space.spec.ts (tags broadened to `deploymentAgnostic`; stateful\nFTR counterpart\n`x-pack/platform/test/api_integration/apis/spaces/get_active_space.ts`\nremoved)\n - route_access.spec.ts","sha":"d83040b6ec743859edf2ebe974e6d71ac2bae5b8"}},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/263291","number":263291,"state":"OPEN"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/262124","number":262124,"mergeCommit":{"message":"[scout] migrate FTR serverless API management tests (#262124)\n\n## Summary\n\nThis PR migrates FTR API tests from\n`x-pack/platform/test/serverless/api_integration/test_suites/management/`\n\n- rollups.ts\n- scripted_fields.ts\n- spaces.ts\n\nto Scout API tests across two plugins:\n\n- `src/platform/plugins/shared/data_views/test/scout/api/tests/`\n - rollup_data_views.spec.ts\n - scripted_fields_disabled.spec.ts\n\n- `x-pack/platform/plugins/shared/spaces/test/scout/api/tests/`\n - crud.spec.ts\n- active_space.spec.ts (tags broadened to `deploymentAgnostic`; stateful\nFTR counterpart\n`x-pack/platform/test/api_integration/apis/spaces/get_active_space.ts`\nremoved)\n - route_access.spec.ts","sha":"d83040b6ec743859edf2ebe974e6d71ac2bae5b8"}},{"branch":"9.3","label":"v9.3.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
Summary
Closes https://github.com/elastic/appex-qa-team/issues/849
This PR migrates FTR API tests from
x-pack/platform/test/serverless/api_integration/test_suites/management/to Scout API tests across two plugins:
src/platform/plugins/shared/data_views/test/scout/api/tests/x-pack/platform/plugins/shared/spaces/test/scout/api/tests/deploymentAgnostic; stateful FTR counterpartx-pack/platform/test/api_integration/apis/spaces/get_active_space.tsremoved)