-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Index Management] Add node plugins serverless tests (#172040)
- Loading branch information
1 parent
98b2cfb
commit 8e36ba7
Showing
6 changed files
with
62 additions
and
20 deletions.
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
x-pack/test/api_integration/apis/management/index_management/cluster_nodes.helpers.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
x-pack/test/api_integration/apis/management/index_management/lib/cluster_nodes.api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { API_BASE_PATH } from '../constants'; | ||
import { FtrProviderContext } from '../../../../ftr_provider_context'; | ||
|
||
export function clusterNodesApi(getService: FtrProviderContext['getService']) { | ||
const supertest = getService('supertest'); | ||
|
||
const getNodesPlugins = () => | ||
supertest | ||
.get(`${API_BASE_PATH}/nodes/plugins`) | ||
.set('kbn-xsrf', 'xxx') | ||
.set('x-elastic-internal-origin', 'xxx'); | ||
|
||
return { | ||
getNodesPlugins, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
x-pack/test_serverless/api_integration/test_suites/common/index_management/cluster_nodes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* 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'; | ||
|
||
export default function ({ getService }: FtrProviderContext) { | ||
const indexManagementService = getService('indexManagement'); | ||
|
||
describe('nodes', () => { | ||
let getNodesPlugins: typeof indexManagementService['clusterNodes']['api']['getNodesPlugins']; | ||
|
||
before(async () => { | ||
({ | ||
clusterNodes: { | ||
api: { getNodesPlugins }, | ||
}, | ||
} = indexManagementService); | ||
}); | ||
|
||
it('should fetch the nodes plugins', async () => { | ||
const { body } = await getNodesPlugins().expect(200); | ||
|
||
expect(Array.isArray(body)).to.be(true); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters