Skip to content

Commit

Permalink
Make risk engine feature flags default true (elastic#167778)
Browse files Browse the repository at this point in the history
## Summary

Enable feature flags true for risk engine

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
nkhristinin and kibanamachine authored Oct 2, 2023
1 parent b2a7b55 commit 236eff4
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ export const allowedExperimentalValues = Object.freeze({
/**
* Enable risk engine client and initialisation of datastream, component templates and mappings
*/
riskScoringPersistence: false,
riskScoringPersistence: true,

/**
* Enables experimental Entity Analytics HTTP endpoints
*/
riskScoringRoutesEnabled: false,
riskScoringRoutesEnabled: true,
/*
*
* Enables Discover embedded within timeline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { act, render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { render, screen } from '@testing-library/react';
import React from 'react';
import { RiskScoreEntity } from '../../../../../common/search_strategy';
import { TestProviders } from '../../../../common/mock';

import { RiskScoreEnableButton } from './risk_score_enable_button';
import { installRiskScoreModule } from './utils';

jest.mock('./utils');

describe('RiskScoreEnableButton', () => {
const mockRefetch = jest.fn();
Expand All @@ -40,44 +36,5 @@ describe('RiskScoreEnableButton', () => {
'Enable'
);
});

it('Triggers the right installer', async () => {
render(
<TestProviders>
<RiskScoreEnableButton
refetch={mockRefetch}
riskScoreEntity={riskScoreEntity}
timerange={timerange}
/>
</TestProviders>
);

await act(async () => {
await userEvent.click(screen.getByTestId(`enable_${riskScoreEntity}_risk_score`));
});

expect(installRiskScoreModule).toHaveBeenCalled();
});

it('Update button state while installing', async () => {
render(
<TestProviders>
<RiskScoreEnableButton
refetch={mockRefetch}
riskScoreEntity={riskScoreEntity}
timerange={timerange}
/>
</TestProviders>
);

userEvent.click(screen.getByTestId(`enable_${riskScoreEntity}_risk_score`));

await waitFor(() => {
expect(screen.getByTestId(`enable_${riskScoreEntity}_risk_score`)).toHaveProperty(
'disabled',
true
);
});
});
});
});
2 changes: 0 additions & 2 deletions x-pack/test/detection_engine_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ export function createTestConfig(options: CreateTestConfigOptions, testFiles?: s
'--xpack.ruleRegistry.unsafe.legacyMultiTenancy.enabled=true',
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
'previewTelemetryUrlEnabled',
'riskScoringPersistence',
'riskScoringRoutesEnabled',
])}`,
'--xpack.task_manager.poll_interval=1000',
`--xpack.actions.preconfigured=${JSON.stringify({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export default function ({ getService }: FtrProviderContext) {
'osquery:telemetry-saved-queries',
'report:execute',
'reports:monitor',
'risk_engine:risk_scoring',
'security:endpoint-diagnostics',
'security:endpoint-meta-telemetry',
'security:telemetry-configuration',
Expand Down
2 changes: 0 additions & 2 deletions x-pack/test/security_solution_cypress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
'alertDetailsPageEnabled',
'chartEmbeddablesEnabled',
'discoverInTimeline',
'riskScoringRoutesEnabled',
'riskScoringPersistence',
])}`,
// mock cloud to enable the guided onboarding tour in e2e tests
'--xpack.cloud.id=test',
Expand Down
4 changes: 0 additions & 4 deletions x-pack/test/security_solution_cypress/serverless_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
...svlSharedConfig.get('kbnTestServer.serverArgs'),
'--serverless=security',
'--xpack.encryptedSavedObjects.encryptionKey="abcdefghijklmnopqrstuvwxyz123456"',
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
'riskScoringRoutesEnabled',
'riskScoringPersistence',
])}`,
`--xpack.securitySolutionServerless.productTypes=${JSON.stringify([
{ product_line: 'security', product_tier: 'complete' },
{ product_line: 'endpoint', product_tier: 'complete' },
Expand Down

0 comments on commit 236eff4

Please sign in to comment.