Skip to content

Commit

Permalink
[Security Solution][Detection Engine] fix broken serverless ES|QL tes…
Browse files Browse the repository at this point in the history
…ts (#184581)

## Summary

- #183096 PR disabled bfetch
requests for Serverless, leading to failure of multiple serverless ES|QL
tests that rely on intercepting `bsearch` request
- addresses:
  -  #184558
  -  #184556
  - #184557
  • Loading branch information
vitaliidm authored May 31, 2024
1 parent 3ec981d commit 83861df
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ const workaroundForResizeObserver = () =>
}
});

// Failing: See https://github.com/elastic/kibana/issues/184558
describe.skip(
describe(
'Detection ES|QL rules, creation',
{
// skipped in MKI as it depends on feature flag alertSuppressionForEsqlRuleEnabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ const expectedValidEsqlQuery =

// skipped in MKI as it depends on feature flag alertSuppressionForEsqlRuleEnabled
// alertSuppressionForEsqlRuleEnabled feature flag is also enabled in a global config
// Failing: See https://github.com/elastic/kibana/issues/184556
// Failing: See https://github.com/elastic/kibana/issues/184557
describe.skip(
describe(
'Detection ES|QL rules, edit',
{
tags: ['@ess', '@serverless', '@skipInServerlessMKI'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -953,11 +953,21 @@ export const interceptEsqlQueryFieldsRequest = (
esqlQuery: string,
alias: string = 'esqlQueryFields'
) => {
cy.intercept('POST', '/internal/bsearch?*', (req) => {
if (req.body?.batch?.[0]?.request?.params?.query?.includes?.(esqlQuery)) {
req.alias = alias;
}
});
const isServerless = Cypress.env('IS_SERVERLESS');
// bfetch is disabled in serverless, so we need to watch another request
if (isServerless) {
cy.intercept('POST', '/internal/search/esql_async', (req) => {
if (req.body?.params?.query?.includes?.(esqlQuery)) {
req.alias = alias;
}
});
} else {
cy.intercept('POST', '/internal/bsearch?*', (req) => {
if (req.body?.batch?.[0]?.request?.params?.query?.includes?.(esqlQuery)) {
req.alias = alias;
}
});
}
};

export const checkLoadQueryDynamically = () => {
Expand Down

0 comments on commit 83861df

Please sign in to comment.