Skip to content

Commit

Permalink
[Security Solution] Reenable rules table filtering serverless tests (#…
Browse files Browse the repository at this point in the history
…166771)

**Relates to:** #161540

## Summary

This PR unskips rules table filtering serverless tests.

Serverless [rules_table_filtering.cy.ts (100
runs)](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3205)
🟢
  • Loading branch information
maximpn authored Sep 28, 2023
1 parent e6e3e2d commit 88b8b8c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ import {
import { disableAutoRefresh } from '../../../../tasks/alerts_detection_rules';
import { getNewRule } from '../../../../objects/rule';

// TODO: https://github.com/elastic/kibana/issues/161540
// Flaky in serverless tests
describe('Rules table: filtering', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => {
describe('Rules table: filtering', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
});
Expand All @@ -44,11 +42,8 @@ describe('Rules table: filtering', { tags: ['@ess', '@serverless', '@skipInServe
cy.task('esArchiverResetKibana');
});

// TODO: https://github.com/elastic/kibana/issues/161540
describe.skip('Last response filter', () => {
// Flaky in serverless tests
// @brokenInServerless tag is not working so a skip was needed
it('Filters rules by last response', { tags: ['@brokenInServerless'] }, function () {
describe('Last response filter', () => {
it('Filters rules by last response', function () {
deleteIndex('test_index');

createIndex('test_index', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import { rootRequest } from '../common';
export const deleteIndex = (index: string) => {
rootRequest({
method: 'DELETE',
url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}?refresh=wait_for`,
headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' },
url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}`,
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
failOnStatusCode: false,
});
};
Expand All @@ -19,7 +23,11 @@ export const deleteDataStream = (dataStreamName: string) => {
rootRequest({
method: 'DELETE',
url: `${Cypress.env('ELASTICSEARCH_URL')}/_data_stream/${dataStreamName}`,
headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' },
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
failOnStatusCode: false,
});
};
Expand All @@ -30,6 +38,11 @@ export const deleteAllDocuments = (target: string) =>
url: `${Cypress.env(
'ELASTICSEARCH_URL'
)}/${target}/_delete_by_query?conflicts=proceed&scroll_size=10000&refresh`,
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
body: {
query: {
match_all: {},
Expand All @@ -41,6 +54,11 @@ export const createIndex = (indexName: string, properties: Record<string, unknow
rootRequest({
method: 'PUT',
url: `${Cypress.env('ELASTICSEARCH_URL')}/${indexName}`,
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
body: {
mappings: {
properties,
Expand All @@ -52,6 +70,11 @@ export const createDocument = (indexName: string, document: Record<string, unkno
rootRequest({
method: 'POST',
url: `${Cypress.env('ELASTICSEARCH_URL')}/${indexName}/_doc?refresh=wait_for`,
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
body: document,
});

Expand All @@ -61,7 +84,11 @@ export const waitForNewDocumentToBeIndexed = (index: string, initialNumberOfDocu
rootRequest<{ hits: { hits: unknown[] } }>({
method: 'GET',
url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}/_search`,
headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' },
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
failOnStatusCode: false,
}).then((response) => {
if (response.status !== 200) {
Expand All @@ -80,7 +107,11 @@ export const refreshIndex = (index: string) => {
rootRequest({
method: 'POST',
url: `${Cypress.env('ELASTICSEARCH_URL')}/${index}/_refresh`,
headers: { 'kbn-xsrf': 'cypress-creds', 'x-elastic-internal-origin': 'security-solution' },
headers: {
'kbn-xsrf': 'cypress-creds',
'x-elastic-internal-origin': 'security-solution',
'elastic-api-version': '2023-10-31',
},
failOnStatusCode: false,
}).then((response) => {
if (response.status !== 200) {
Expand Down

0 comments on commit 88b8b8c

Please sign in to comment.