From 22a1b251aa1d6b7c40a39f460ffcd23e0870fb88 Mon Sep 17 00:00:00 2001 From: wafaanasr Date: Wed, 2 Aug 2023 16:53:30 +0100 Subject: [PATCH 1/6] add logger to see on ci --- .../group7/exception_operators_data_types/double.ts | 5 +++-- x-pack/test/lists_api_integration/utils.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts index 05d821b5932fb..bbd7956c59ce5 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts @@ -33,8 +33,7 @@ export default ({ getService }: FtrProviderContext) => { const log = getService('log'); const es = getService('es'); - // Failing: See https://github.com/elastic/kibana/issues/155122 - describe.skip('Rule exception operators for data type double', () => { + describe('Rule exception operators for data type double', () => { before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/rule_exceptions/double'); await esArchiver.load('x-pack/test/functional/es_archives/rule_exceptions/double_as_string'); @@ -490,6 +489,7 @@ export default ({ getService }: FtrProviderContext) => { expect(hits).to.eql([]); }); }); + // here describe('working against string values in the data set', () => { it('will return 3 results if we have a list that includes 1 double', async () => { @@ -511,6 +511,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForRuleSuccess({ supertest, log, id }); await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); + log.debug('HERE hits: ', signalsOpen.hits.hits); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.double).sort(); expect(hits).to.eql(['1.1', '1.2', '1.3']); }); diff --git a/x-pack/test/lists_api_integration/utils.ts b/x-pack/test/lists_api_integration/utils.ts index 13ea80e20b0fd..e9d6abf69650e 100644 --- a/x-pack/test/lists_api_integration/utils.ts +++ b/x-pack/test/lists_api_integration/utils.ts @@ -333,6 +333,7 @@ export const waitForListItem = async ( const { status, body } = await supertest .get(`${LIST_ITEM_URL}?list_id=${fileName}&value=${itemValue}`) .send(); + log.debug('HERE status: ', status, 'fileName: ', fileName, 'itemValue: ', itemValue); if (status !== 200) { log.debug( `Did not get an expected 200 "ok" when waiting for a list item (waitForListItem) yet. Retrying until we get a 200 "ok". body: ${JSON.stringify( From e5ec441da230675f38290fecca10bd56e4536641 Mon Sep 17 00:00:00 2001 From: wafaanasr Date: Thu, 3 Aug 2023 10:41:13 +0100 Subject: [PATCH 2/6] add loggers to debug the values --- .../group7/exception_operators_data_types/double.ts | 2 +- x-pack/test/lists_api_integration/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts index bbd7956c59ce5..c10125c2dfd55 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts @@ -511,7 +511,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForRuleSuccess({ supertest, log, id }); await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); - log.debug('HERE hits: ', signalsOpen.hits.hits); + log.info('HERE hits: ', signalsOpen.hits.hits); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.double).sort(); expect(hits).to.eql(['1.1', '1.2', '1.3']); }); diff --git a/x-pack/test/lists_api_integration/utils.ts b/x-pack/test/lists_api_integration/utils.ts index e9d6abf69650e..080b4b0df702f 100644 --- a/x-pack/test/lists_api_integration/utils.ts +++ b/x-pack/test/lists_api_integration/utils.ts @@ -333,7 +333,7 @@ export const waitForListItem = async ( const { status, body } = await supertest .get(`${LIST_ITEM_URL}?list_id=${fileName}&value=${itemValue}`) .send(); - log.debug('HERE status: ', status, 'fileName: ', fileName, 'itemValue: ', itemValue); + log.info('HERE status: ', status, 'fileName: ', fileName, 'itemValue: ', itemValue); if (status !== 200) { log.debug( `Did not get an expected 200 "ok" when waiting for a list item (waitForListItem) yet. Retrying until we get a 200 "ok". body: ${JSON.stringify( From c4f6a6e47dab070a4452cc3c45c1704d0ac6494b Mon Sep 17 00:00:00 2001 From: wafaanasr Date: Thu, 3 Aug 2023 11:20:28 +0100 Subject: [PATCH 3/6] try warning in logs --- .../group7/exception_operators_data_types/double.ts | 2 +- x-pack/test/lists_api_integration/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts index c10125c2dfd55..df8e90a080fb5 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts @@ -511,7 +511,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForRuleSuccess({ supertest, log, id }); await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); - log.info('HERE hits: ', signalsOpen.hits.hits); + log.warning('HERE hits: ', signalsOpen.hits.hits); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.double).sort(); expect(hits).to.eql(['1.1', '1.2', '1.3']); }); diff --git a/x-pack/test/lists_api_integration/utils.ts b/x-pack/test/lists_api_integration/utils.ts index 080b4b0df702f..0905165d7835f 100644 --- a/x-pack/test/lists_api_integration/utils.ts +++ b/x-pack/test/lists_api_integration/utils.ts @@ -333,7 +333,7 @@ export const waitForListItem = async ( const { status, body } = await supertest .get(`${LIST_ITEM_URL}?list_id=${fileName}&value=${itemValue}`) .send(); - log.info('HERE status: ', status, 'fileName: ', fileName, 'itemValue: ', itemValue); + log.warning('HERE status: ', status, 'fileName: ', fileName, 'itemValue: ', itemValue); if (status !== 200) { log.debug( `Did not get an expected 200 "ok" when waiting for a list item (waitForListItem) yet. Retrying until we get a 200 "ok". body: ${JSON.stringify( From fa4a7d5cf8ae403f80439cd264e3b2f326a2d3d0 Mon Sep 17 00:00:00 2001 From: wafaanasr Date: Thu, 3 Aug 2023 12:26:58 +0100 Subject: [PATCH 4/6] only log.error gets captured in ci --- .../group7/exception_operators_data_types/double.ts | 2 +- x-pack/test/lists_api_integration/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts index df8e90a080fb5..84674cfd64878 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts @@ -511,7 +511,7 @@ export default ({ getService }: FtrProviderContext) => { await waitForRuleSuccess({ supertest, log, id }); await waitForSignalsToBePresent(supertest, log, 1, [id]); const signalsOpen = await getSignalsById(supertest, log, id); - log.warning('HERE hits: ', signalsOpen.hits.hits); + log.error(`HERE hits: ${signalsOpen.hits.hits}`); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.double).sort(); expect(hits).to.eql(['1.1', '1.2', '1.3']); }); diff --git a/x-pack/test/lists_api_integration/utils.ts b/x-pack/test/lists_api_integration/utils.ts index 0905165d7835f..031f31ee5c719 100644 --- a/x-pack/test/lists_api_integration/utils.ts +++ b/x-pack/test/lists_api_integration/utils.ts @@ -333,7 +333,7 @@ export const waitForListItem = async ( const { status, body } = await supertest .get(`${LIST_ITEM_URL}?list_id=${fileName}&value=${itemValue}`) .send(); - log.warning('HERE status: ', status, 'fileName: ', fileName, 'itemValue: ', itemValue); + log.error(`HERE status: ${status}, 'fileName: ', ${fileName}, 'itemValue: ', ${itemValue}`); if (status !== 200) { log.debug( `Did not get an expected 200 "ok" when waiting for a list item (waitForListItem) yet. Retrying until we get a 200 "ok". body: ${JSON.stringify( From c80b36b346f5ea58bde941b39e2b49452c68ecf6 Mon Sep 17 00:00:00 2001 From: wafaanasr Date: Tue, 8 Aug 2023 16:05:58 +0200 Subject: [PATCH 5/6] increase number of alerts to wait for to 3 since we are expecting 3 alerts to be generated --- .../group7/exception_operators_data_types/double.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts index 84674cfd64878..aa0c3f2b5e6c3 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts @@ -489,8 +489,6 @@ export default ({ getService }: FtrProviderContext) => { expect(hits).to.eql([]); }); }); - // here - describe('working against string values in the data set', () => { it('will return 3 results if we have a list that includes 1 double', async () => { await importFile(supertest, log, 'double', ['1.0'], 'list_items.txt'); @@ -509,7 +507,7 @@ export default ({ getService }: FtrProviderContext) => { ], ]); await waitForRuleSuccess({ supertest, log, id }); - await waitForSignalsToBePresent(supertest, log, 1, [id]); + await waitForSignalsToBePresent(supertest, log, 3, [id]); const signalsOpen = await getSignalsById(supertest, log, id); log.error(`HERE hits: ${signalsOpen.hits.hits}`); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.double).sort(); From 11fba568719605bd4e7f8c04c65aeaaaf058a6eb Mon Sep 17 00:00:00 2001 From: wafaanasr Date: Wed, 9 Aug 2023 10:28:38 +0200 Subject: [PATCH 6/6] remove logs --- .../group7/exception_operators_data_types/double.ts | 1 - x-pack/test/lists_api_integration/utils.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts index aa0c3f2b5e6c3..39a878a82f896 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/group7/exception_operators_data_types/double.ts @@ -509,7 +509,6 @@ export default ({ getService }: FtrProviderContext) => { await waitForRuleSuccess({ supertest, log, id }); await waitForSignalsToBePresent(supertest, log, 3, [id]); const signalsOpen = await getSignalsById(supertest, log, id); - log.error(`HERE hits: ${signalsOpen.hits.hits}`); const hits = signalsOpen.hits.hits.map((hit) => hit._source?.double).sort(); expect(hits).to.eql(['1.1', '1.2', '1.3']); }); diff --git a/x-pack/test/lists_api_integration/utils.ts b/x-pack/test/lists_api_integration/utils.ts index 031f31ee5c719..13ea80e20b0fd 100644 --- a/x-pack/test/lists_api_integration/utils.ts +++ b/x-pack/test/lists_api_integration/utils.ts @@ -333,7 +333,6 @@ export const waitForListItem = async ( const { status, body } = await supertest .get(`${LIST_ITEM_URL}?list_id=${fileName}&value=${itemValue}`) .send(); - log.error(`HERE status: ${status}, 'fileName: ', ${fileName}, 'itemValue: ', ${itemValue}`); if (status !== 200) { log.debug( `Did not get an expected 200 "ok" when waiting for a list item (waitForListItem) yet. Retrying until we get a 200 "ok". body: ${JSON.stringify(