Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ingest Manager] move tests for placeholder indices to setup #75096

Merged
merged 3 commits into from
Aug 15, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion x-pack/test/ingest_manager_api_integration/apis/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Expand Down
32 changes: 32 additions & 0 deletions x-pack/test/ingest_manager_api_integration/apis/setup.ts
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;
* 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);
});
});
}