Skip to content

Commit 06ca525

Browse files
committed
Removing ml-state index from archive (#77143)
* 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
1 parent 00737fe commit 06ca525

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

x-pack/test/apm_api_integration/common/archives_metadata.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
export default {
88
'apm_8.0.0': {
9-
start: '2020-09-10T08:07:13.274Z',
10-
end: '2020-09-10T08:37:13.274Z',
9+
start: '2020-09-10T06:00:00.000Z',
10+
end: '2020-09-10T07:00:00.000Z',
1111
},
1212
};
Binary file not shown.

x-pack/test/apm_api_integration/trial/tests/service_maps/service_maps.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import querystring from 'querystring';
88
import expect from '@kbn/expect';
9+
import { isEmpty } from 'lodash';
910
import { FtrProviderContext } from '../../../common/ftr_provider_context';
1011

1112
export default function serviceMapsApiTests({ getService }: FtrProviderContext) {
@@ -285,5 +286,28 @@ export default function serviceMapsApiTests({ getService }: FtrProviderContext)
285286
});
286287
});
287288
});
289+
290+
describe('when there is data with anomalies', () => {
291+
before(() => esArchiver.load('apm_8.0.0'));
292+
after(() => esArchiver.unload('apm_8.0.0'));
293+
294+
it('returns service map elements', async () => {
295+
const start = encodeURIComponent('2020-09-10T06:00:00.000Z');
296+
const end = encodeURIComponent('2020-09-10T07:00:00.000Z');
297+
298+
const response = await supertest.get(`/api/apm/service-map?start=${start}&end=${end}`);
299+
300+
expect(response.status).to.be(200);
301+
const dataWithAnomalies = response.body.elements.filter(
302+
(el: { data: { serviceAnomalyStats?: {} } }) => !isEmpty(el.data.serviceAnomalyStats)
303+
);
304+
expect(dataWithAnomalies).to.not.empty();
305+
dataWithAnomalies.forEach(({ data }: any) => {
306+
expect(
307+
Object.values(data.serviceAnomalyStats).filter((value) => isEmpty(value))
308+
).to.not.empty();
309+
});
310+
});
311+
});
288312
});
289313
}

0 commit comments

Comments
 (0)