Skip to content

Commit

Permalink
[Security Solution][Endpoint] Unskip alerts response console test (el…
Browse files Browse the repository at this point in the history
…astic#174341)

## Summary

Re-enable response console tests for Alerts page.

closes elastic/issues/169689
closes elastic/issues/173472

### Flaky test runner
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4766
x 100 (all pass)

### Checklist

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
  • Loading branch information
ashokaditya authored and delanni committed Jan 11, 2024
1 parent d1d3c8b commit 7560976
Showing 1 changed file with 47 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,62 +26,59 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';
import { createEndpointHost } from '../../tasks/create_endpoint_host';
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data';

describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;
describe(
'Response console: From Alerts',
{ tags: ['@ess', '@serverless', '@brokenInServerless'] },
() => {
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
let policy: PolicyData;
let createdHost: CreateAndEnrollEndpointHostResponse;

beforeEach(() => {
login();
});

before(() => {
getEndpointIntegrationVersion().then((version) =>
createAgentPolicyTask(version).then((data) => {
indexedPolicy = data;
policy = indexedPolicy.integrationPolicies[0];

return enableAllPolicyProtections(policy.id).then(() => {
// Create and enroll a new Endpoint host
return createEndpointHost(policy.policy_id).then((host) => {
createdHost = host as CreateAndEnrollEndpointHostResponse;
});
});
})
);
});

after(() => {
if (createdHost) {
cy.task('destroyEndpointHost', createdHost);
}

if (indexedPolicy) {
cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy);
}

if (createdHost) {
deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] });
}
});

// FLAKY: https://github.com/elastic/kibana/issues/169689
// FLAKY: https://github.com/elastic/kibana/issues/173472
describe.skip('From Alerts', () => {
let ruleId: string;
let ruleName: string;
beforeEach(() => {
login();
});

before(() => {
loadRule(
{ query: `agent.name: ${createdHost.hostname} and agent.type: endpoint` },
false
).then((data) => {
ruleId = data.id;
ruleName = data.name;
});
getEndpointIntegrationVersion()
.then((version) =>
createAgentPolicyTask(version).then((data) => {
indexedPolicy = data;
policy = indexedPolicy.integrationPolicies[0];

return enableAllPolicyProtections(policy.id).then(() => {
// Create and enroll a new Endpoint host
return createEndpointHost(policy.policy_id).then((host) => {
createdHost = host as CreateAndEnrollEndpointHostResponse;
});
});
})
)
.then(() => {
loadRule(
{ query: `agent.name: ${createdHost.hostname} and agent.type: endpoint` },
false
).then((data) => {
ruleId = data.id;
ruleName = data.name;
});
});
});

after(() => {
if (createdHost) {
cy.task('destroyEndpointHost', createdHost);
}

if (indexedPolicy) {
cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy);
}

if (createdHost) {
deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] });
}

if (ruleId) {
cleanupRule(ruleId);
}
Expand Down Expand Up @@ -113,5 +110,5 @@ describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerles
openResponderFromEndpointAlertDetails();
ensureOnResponder();
});
});
});
}
);

0 comments on commit 7560976

Please sign in to comment.