Skip to content

Commit

Permalink
move tests for placeholder indices to setup (#75096) (#75121)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
neptunian and elasticmachine authored Aug 15, 2020
1 parent 3d9c693 commit ba27f51
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
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);
});
});
}

0 comments on commit ba27f51

Please sign in to comment.