Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Oct 14, 2024
1 parent f981e19 commit c055d94
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const ACTION_TYPE_ID = '.inference';
let actionTypeModel: ActionTypeModel;

beforeAll(() => {
ExperimentalFeaturesService.init({ experimentalFeatures: experimentalFeaturesMock });
ExperimentalFeaturesService.init({
experimentalFeatures: { ...experimentalFeaturesMock, inferenceConnectorOn: true } as any,
});
const connectorTypeRegistry = new TypeRegistry<ActionTypeModel>();
registerConnectorTypes({ connectorTypeRegistry, services: registrationServicesMock });
const getResult = connectorTypeRegistry.get(ACTION_TYPE_ID);
Expand Down
11 changes: 11 additions & 0 deletions x-pack/plugins/stack_connectors/server/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import { PluginInitializerContext } from '@kbn/core/server';
import { coreMock } from '@kbn/core/server/mocks';
import { StackConnectorsPlugin } from './plugin';
import { actionsMock } from '@kbn/actions-plugin/server/mocks';
import { experimentalFeaturesMock } from '../public/mocks';
import { parseExperimentalConfigValue } from '../common/experimental_features';

jest.mock('../common/experimental_features');

const mockParseExperimentalConfigValue = parseExperimentalConfigValue as jest.Mock;

describe('Stack Connectors Plugin', () => {
describe('setup()', () => {
Expand All @@ -18,6 +24,11 @@ describe('Stack Connectors Plugin', () => {

beforeEach(() => {
context = coreMock.createPluginInitializerContext();
mockParseExperimentalConfigValue.mockReturnValue({
...experimentalFeaturesMock,
inferenceConnectorOn: true,
});

plugin = new StackConnectorsPlugin(context);
coreSetup = coreMock.createSetup();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export default function createRegisteredConnectorTypeTests({ getService }: FtrPr
'.gen-ai',
'.bedrock',
'.gemini',
'.inference',
'.sentinelone',
'.cases',
'.crowdstrike',
Expand Down
5 changes: 4 additions & 1 deletion x-pack/test/task_manager_claimer_mget/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
'--xpack.task_manager.ephemeral_tasks.enabled=false',
'--xpack.task_manager.ephemeral_tasks.request_capacity=100',
'--xpack.task_manager.metrics_reset_interval=40000',
`--xpack.stack_connectors.enableExperimental=${JSON.stringify(['crowdstrikeConnectorOn'])}`,
`--xpack.stack_connectors.enableExperimental=${JSON.stringify([
'crowdstrikeConnectorOn',
'inferenceConnectorOn',
])}`,
...findTestPluginPaths(path.resolve(__dirname, 'plugins')),
],
},
Expand Down

0 comments on commit c055d94

Please sign in to comment.