mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `8.16`: - [[CLOUD] Instant deployment (#201688)](https://github.com/elastic/kibana/pull/201688) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Xavier Mouligneau","email":"xavier.mouligneau@elastic.co"},"sourceCommit":{"committedDate":"2024-11-27T13:08:08Z","message":"[CLOUD] Instant deployment (#201688)\n\n## Summary\r\n\r\nWe are having the same issue as here\r\nhttps://github.com/elastic/kibana/pull/197667 for instant deployment. We\r\nneed to allow the solution_type `search`.\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"54d46986e676c0a824ac20204391f0212e59c880","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Cloud","v9.0.0","backport:version","v8.17.0","v8.18.0","v8.16.2"],"title":"[CLOUD] Instant deployment","number":201688,"url":"https://github.com/elastic/kibana/pull/201688","mergeCommit":{"message":"[CLOUD] Instant deployment (#201688)\n\n## Summary\r\n\r\nWe are having the same issue as here\r\nhttps://github.com/elastic/kibana/pull/197667 for instant deployment. We\r\nneed to allow the solution_type `search`.\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"54d46986e676c0a824ac20204391f0212e59c880"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201688","number":201688,"mergeCommit":{"message":"[CLOUD] Instant deployment (#201688)\n\n## Summary\r\n\r\nWe are having the same issue as here\r\nhttps://github.com/elastic/kibana/pull/197667 for instant deployment. We\r\nneed to allow the solution_type `search`.\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"54d46986e676c0a824ac20204391f0212e59c880"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Xavier Mouligneau <xavier.mouligneau@elastic.co>
This commit is contained in:
parent
b3d1d7a89c
commit
a705711ae6
3 changed files with 56 additions and 1 deletions
|
@ -129,6 +129,60 @@ describe('PUT /internal/spaces/space/{id}/solution', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should update the solution_type when it is search', async () => {
|
||||
const payload = {
|
||||
solution_type: 'search',
|
||||
};
|
||||
|
||||
const { routeHandler, savedObjectsRepositoryMock } = await setup();
|
||||
|
||||
const request = httpServerMock.createKibanaRequest({
|
||||
params: {
|
||||
id: 'a-space',
|
||||
},
|
||||
body: payload,
|
||||
method: 'post',
|
||||
});
|
||||
|
||||
const response = await routeHandler(mockRouteContext, request, kibanaResponseFactory);
|
||||
|
||||
const { status } = response;
|
||||
|
||||
expect(status).toEqual(200);
|
||||
expect(savedObjectsRepositoryMock.update).toHaveBeenCalledTimes(1);
|
||||
expect(savedObjectsRepositoryMock.update).toHaveBeenCalledWith('space', 'a-space', {
|
||||
solution: 'es',
|
||||
name: 'a space',
|
||||
color: undefined,
|
||||
description: undefined,
|
||||
disabledFeatures: [],
|
||||
imageUrl: undefined,
|
||||
initials: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
it('should failed when the solution_type is not the expected one', async () => {
|
||||
const payload = {
|
||||
solution_type: 'searchXoXo',
|
||||
};
|
||||
|
||||
const { routeHandler } = await setup();
|
||||
|
||||
const request = httpServerMock.createKibanaRequest({
|
||||
params: {
|
||||
id: 'a-space',
|
||||
},
|
||||
body: payload,
|
||||
method: 'post',
|
||||
});
|
||||
|
||||
const response = await routeHandler(mockRouteContext, request, kibanaResponseFactory);
|
||||
|
||||
const { status } = response;
|
||||
|
||||
expect(status).toEqual(500);
|
||||
});
|
||||
|
||||
it('should not allow a new space to be created', async () => {
|
||||
const payload = {
|
||||
solution: 'oblt',
|
||||
|
|
|
@ -21,6 +21,7 @@ const spaceSolutionSchema = schema.oneOf([
|
|||
schema.literal('security'),
|
||||
schema.literal('observability'),
|
||||
schema.literal('elasticsearch'),
|
||||
schema.literal('search'),
|
||||
]),
|
||||
}),
|
||||
]);
|
||||
|
|
|
@ -139,7 +139,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
.expect(400);
|
||||
|
||||
expect(body.message).to.eql(
|
||||
'[request body]: types that failed validation:\n- [request body.0.solution]: expected at least one defined value but got [undefined]\n- [request body.1.solution_type]: types that failed validation:\n - [request body.solution_type.0]: expected value to equal [security]\n - [request body.solution_type.1]: expected value to equal [observability]\n - [request body.solution_type.2]: expected value to equal [elasticsearch]'
|
||||
'[request body]: types that failed validation:\n- [request body.0.solution]: expected at least one defined value but got [undefined]\n- [request body.1.solution_type]: types that failed validation:\n - [request body.solution_type.0]: expected value to equal [security]\n - [request body.solution_type.1]: expected value to equal [observability]\n - [request body.solution_type.2]: expected value to equal [elasticsearch]\n - [request body.solution_type.3]: expected value to equal [search]'
|
||||
);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue