Skip to content

Commit

Permalink
Removing ml-state index from archive (elastic#77143)
Browse files Browse the repository at this point in the history
* removing ml-state index from archive

* removing archiver

* removing archiver

* adding archiver with ml anomalies

* fixing test
# Conflicts:
#	x-pack/test/apm_api_integration/trial/tests/service_maps/service_maps.ts
  • Loading branch information
cauemarcondes committed Sep 13, 2020
1 parent 00737fe commit 06ca525
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x-pack/test/apm_api_integration/common/archives_metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

export default {
'apm_8.0.0': {
start: '2020-09-10T08:07:13.274Z',
end: '2020-09-10T08:37:13.274Z',
start: '2020-09-10T06:00:00.000Z',
end: '2020-09-10T07:00:00.000Z',
},
};
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import querystring from 'querystring';
import expect from '@kbn/expect';
import { isEmpty } from 'lodash';
import { FtrProviderContext } from '../../../common/ftr_provider_context';

export default function serviceMapsApiTests({ getService }: FtrProviderContext) {
Expand Down Expand Up @@ -285,5 +286,28 @@ export default function serviceMapsApiTests({ getService }: FtrProviderContext)
});
});
});

describe('when there is data with anomalies', () => {
before(() => esArchiver.load('apm_8.0.0'));
after(() => esArchiver.unload('apm_8.0.0'));

it('returns service map elements', async () => {
const start = encodeURIComponent('2020-09-10T06:00:00.000Z');
const end = encodeURIComponent('2020-09-10T07:00:00.000Z');

const response = await supertest.get(`/api/apm/service-map?start=${start}&end=${end}`);

expect(response.status).to.be(200);
const dataWithAnomalies = response.body.elements.filter(
(el: { data: { serviceAnomalyStats?: {} } }) => !isEmpty(el.data.serviceAnomalyStats)
);
expect(dataWithAnomalies).to.not.empty();
dataWithAnomalies.forEach(({ data }: any) => {
expect(
Object.values(data.serviceAnomalyStats).filter((value) => isEmpty(value))
).to.not.empty();
});
});
});
});
}

0 comments on commit 06ca525

Please sign in to comment.