[Telemetry][API Integration tests] Ensure .kibana index exists (#76662)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Alejandro Fernández Haro 2020-09-10 12:45:27 +01:00 committed by GitHub
parent 0f249d7383
commit ad62fa0a6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -55,7 +55,12 @@ const assertStatsAndMetrics = (body) => {
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
describe('kibana stats api', () => {
before('make sure there are some saved objects', () => esArchiver.load('saved_objects/basic'));
after('cleanup saved objects changes', () => esArchiver.unload('saved_objects/basic'));
describe('basic', () => {
it('should return the stats without cluster_uuid with no query string params', () => {
return supertest

View file

@ -38,8 +38,12 @@ function flatKeys(source) {
export default function ({ getService }) {
const supertest = getService('supertest');
const es = getService('es');
const esArchiver = getService('esArchiver');
describe('/api/telemetry/v2/clusters/_stats', () => {
before('make sure there are some saved objects', () => esArchiver.load('saved_objects/basic'));
after('cleanup saved objects changes', () => esArchiver.unload('saved_objects/basic'));
before('create some telemetry-data tracked indices', async () => {
return es.indices.create({ index: 'filebeat-telemetry_tests_logs' });
});