Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.11] Risk score test unskip and clear transform (#168469) #168867

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
installLegacyRiskScore,
getLegacyRiskScoreDashboards,
clearLegacyDashboards,
deleteRiskEngineTask,
deleteAllRiskScores,
} from './utils';

// eslint-disable-next-line import/no-default-export
Expand All @@ -29,6 +31,16 @@ export default ({ getService }: FtrProviderContext) => {
const log = getService('log');

describe('Risk Engine', () => {
beforeEach(async () => {
await cleanRiskEngineConfig({ kibanaServer });
await deleteRiskEngineTask({ es, log });
await deleteAllRiskScores(log, es);
await clearTransforms({
es,
log,
});
});

afterEach(async () => {
await cleanRiskEngineConfig({
kibanaServer,
Expand All @@ -45,10 +57,11 @@ export default ({ getService }: FtrProviderContext) => {
supertest,
log,
});
await deleteRiskEngineTask({ es, log });
});

// FLAKY: https://github.com/elastic/kibana/issues/168376
describe.skip('init api', () => {
describe('init api', () => {
it('should return response with success status', async () => {
const response = await riskEngineRoutes.init();
expect(response.body).to.eql({
Expand Down Expand Up @@ -374,7 +387,7 @@ export default ({ getService }: FtrProviderContext) => {
});

// FLAKY: https://github.com/elastic/kibana/issues/168355
describe.skip('status api', () => {
describe('status api', () => {
it('should disable / enable risk engine', async () => {
const status1 = await riskEngineRoutes.getStatus();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
cleanRiskEngineConfig,
waitForRiskEngineTaskToBeGone,
deleteRiskScoreIndices,
clearTransforms,
} from './utils';

// eslint-disable-next-line import/no-default-export
Expand All @@ -37,8 +38,7 @@ export default ({ getService }: FtrProviderContext): void => {
const createAndSyncRuleAndAlerts = createAndSyncRuleAndAlertsFactory({ supertest, log });
const riskEngineRoutes = riskEngineRouteHelpersFactory(supertest);

// Failing: See https://github.com/elastic/kibana/issues/168424
describe.skip('Risk Engine - Risk Scoring Task', () => {
describe('Risk Engine - Risk Scoring Task', () => {
context('with auditbeat data', () => {
const { indexListOfDocuments } = dataGeneratorFactory({
es,
Expand All @@ -62,6 +62,7 @@ export default ({ getService }: FtrProviderContext): void => {
await deleteAllRiskScores(log, es);
await deleteAllAlerts(supertest, log, es);
await deleteAllRules(supertest, log);
await clearTransforms({ es, log });
});

afterEach(async () => {
Expand All @@ -70,6 +71,7 @@ export default ({ getService }: FtrProviderContext): void => {
await deleteAllRiskScores(log, es);
await deleteAllAlerts(supertest, log, es);
await deleteAllRules(supertest, log);
await clearTransforms({ es, log });
});

describe('with some alerts containing hosts', () => {
Expand All @@ -94,8 +96,7 @@ export default ({ getService }: FtrProviderContext): void => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/168415
describe.skip('initializing the risk engine', () => {
describe('initializing the risk engine', () => {
beforeEach(async () => {
await riskEngineRoutes.init();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
waitForRiskScoresToBePresent,
riskEngineRouteHelpersFactory,
cleanRiskEngineConfig,
clearTransforms,
} from './utils';
import { dataGeneratorFactory } from '../../../utils/data_generator';

Expand Down Expand Up @@ -53,6 +54,7 @@ export default ({ getService }: FtrProviderContext) => {
await deleteRiskScoreIndices({ log, es });
await deleteAllAlerts(supertest, log, es);
await deleteAllRules(supertest, log);
await clearTransforms({ es, log });
});

describe('Risk engine not enabled', () => {
Expand All @@ -66,7 +68,7 @@ export default ({ getService }: FtrProviderContext) => {
});

// FLAKY: https://github.com/elastic/kibana/issues/168429
describe.skip('Risk engine enabled', () => {
describe('Risk engine enabled', () => {
let hostId: string;
let userId: string;

Expand Down Expand Up @@ -108,6 +110,7 @@ export default ({ getService }: FtrProviderContext) => {
await deleteRiskScoreIndices({ log, es });
await deleteAllAlerts(supertest, log, es);
await deleteAllRules(supertest, log);
await clearTransforms({ es, log });
});

it('should return riskEngineMetrics with expected values', async () => {
Expand Down
Loading