[Uptime] Add summary exists filter in monitor list (#128640)

This commit is contained in:
Shahzad 2022-03-30 16:53:32 +02:00 committed by GitHub
parent 7d86eed782
commit 3f4aa490ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 9 deletions

View file

@ -52,6 +52,8 @@ const queryBody = async (queryContext: QueryContext, searchAfter: any, size: num
filters.push({ match: { 'monitor.status': queryContext.statusFilter } });
}
filters.push({ exists: { field: 'summary' } });
filters.push(EXCLUDE_RUN_ONCE_FILTER);
const body = {

View file

@ -84,15 +84,6 @@ export default function ({ getService }: FtrProviderContext) {
nonSummaryIp = checks[0][0].monitor.ip;
});
it('should match non summary documents without a status filter', async () => {
const filters = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]);
const url = getBaseUrl(dateRangeStart, dateRangeEnd) + `&filters=${filters}`;
const apiResponse = await supertest.get(url);
const nonSummaryRes = apiResponse.body;
expect(nonSummaryRes.summaries.length).to.eql(1);
});
it('should not match non summary documents if the check status does not match the document status', async () => {
const filters = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]);
const url =