diff --git a/x-pack/test/ingest_manager_api_integration/apis/epm/install_remove_assets.ts b/x-pack/test/ingest_manager_api_integration/apis/epm/install_remove_assets.ts index 7fb8b0a2b1708..fc0589c2e90e9 100644 --- a/x-pack/test/ingest_manager_api_integration/apis/epm/install_remove_assets.ts +++ b/x-pack/test/ingest_manager_api_integration/apis/epm/install_remove_assets.ts @@ -106,18 +106,6 @@ export default function (providerContext: FtrProviderContext) { }); expect(resSearch.id).equal('sample_search'); }); - it('should have installed placeholder indices', async function () { - const resLogsIndexPatternPlaceholder = await es.transport.request({ - method: 'GET', - path: `/logs-index_pattern_placeholder`, - }); - expect(resLogsIndexPatternPlaceholder.statusCode).equal(200); - const resMetricsIndexPatternPlaceholder = await es.transport.request({ - method: 'GET', - path: `/metrics-index_pattern_placeholder`, - }); - expect(resMetricsIndexPatternPlaceholder.statusCode).equal(200); - }); it('should have created the correct saved object', async function () { const res = await kibanaServer.savedObjects.get({ type: 'epm-packages', diff --git a/x-pack/test/ingest_manager_api_integration/apis/index.js b/x-pack/test/ingest_manager_api_integration/apis/index.js index 72121b2164bfd..948f953ebe3f5 100644 --- a/x-pack/test/ingest_manager_api_integration/apis/index.js +++ b/x-pack/test/ingest_manager_api_integration/apis/index.js @@ -7,7 +7,8 @@ export default function ({ loadTestFile }) { describe('Ingest Manager Endpoints', function () { this.tags('ciGroup7'); - + // Ingest Manager setup + loadTestFile(require.resolve('./setup')); // Fleet loadTestFile(require.resolve('./fleet/index')); diff --git a/x-pack/test/ingest_manager_api_integration/apis/setup.ts b/x-pack/test/ingest_manager_api_integration/apis/setup.ts new file mode 100644 index 0000000000000..daf0c8937715f --- /dev/null +++ b/x-pack/test/ingest_manager_api_integration/apis/setup.ts @@ -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; + * you may not use this file except in compliance with the Elastic License. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../api_integration/ftr_provider_context'; + +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; + const supertest = getService('supertest'); + const es = getService('es'); + describe('ingest manager setup', async () => { + before(async () => { + await supertest.post(`/api/ingest_manager/setup`).set('kbn-xsrf', 'xxx').send(); + }); + + it('should have installed placeholder indices', async function () { + const resLogsIndexPatternPlaceholder = await es.transport.request({ + method: 'GET', + path: `/logs-index_pattern_placeholder`, + }); + expect(resLogsIndexPatternPlaceholder.statusCode).equal(200); + const resMetricsIndexPatternPlaceholder = await es.transport.request({ + method: 'GET', + path: `/metrics-index_pattern_placeholder`, + }); + expect(resMetricsIndexPatternPlaceholder.statusCode).equal(200); + }); + }); +}