diff --git a/src/core/server/mocks.ts b/src/core/server/mocks.ts index 2451b98ffdf29d..c707fa2b479e46 100644 --- a/src/core/server/mocks.ts +++ b/src/core/server/mocks.ts @@ -18,7 +18,7 @@ */ import { of } from 'rxjs'; import { duration } from 'moment'; -import { PluginInitializerContext, CoreSetup, CoreStart } from '.'; +import { PluginInitializerContext, CoreSetup, CoreStart, StartServicesAccessor } from '.'; import { CspConfig } from './csp'; import { loggingServiceMock } from './logging/logging_service.mock'; import { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock'; @@ -100,7 +100,9 @@ function pluginInitializerContextMock(config: T = {} as T) { return mock; } -type CoreSetupMockType = MockedKeys & jest.Mocked>; +type CoreSetupMockType = MockedKeys & { + getStartServices: jest.MockedFunction>; +}; function createCoreSetupMock({ pluginStartDeps = {}, diff --git a/x-pack/plugins/licensing/server/mocks.ts b/x-pack/plugins/licensing/server/mocks.ts index d622e3f71eff54..154692a2fd1979 100644 --- a/x-pack/plugins/licensing/server/mocks.ts +++ b/x-pack/plugins/licensing/server/mocks.ts @@ -4,15 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ import { BehaviorSubject } from 'rxjs'; -import { LicensingPluginSetup } from './types'; +import { LicensingPluginSetup, LicensingPluginStart } from './types'; import { licenseMock } from '../common/licensing.mock'; +import { featureUsageMock } from './services/feature_usage_service.mock'; -const createSetupMock = () => { +const createSetupMock = (): jest.Mocked => { const license = licenseMock.createLicense(); - const mock: jest.Mocked = { + const mock = { license$: new BehaviorSubject(license), refresh: jest.fn(), createLicensePoller: jest.fn(), + featureUsage: featureUsageMock.createSetup(), }; mock.refresh.mockResolvedValue(license); mock.createLicensePoller.mockReturnValue({ @@ -23,7 +25,16 @@ const createSetupMock = () => { return mock; }; +const createStartMock = (): jest.Mocked => { + const mock = { + featureUsage: featureUsageMock.createStart(), + }; + + return mock; +}; + export const licensingMock = { createSetup: createSetupMock, + createStart: createStartMock, ...licenseMock, }; diff --git a/x-pack/plugins/licensing/server/plugin.ts b/x-pack/plugins/licensing/server/plugin.ts index 383245e6f4ee8a..ee43ac0ce233cd 100644 --- a/x-pack/plugins/licensing/server/plugin.ts +++ b/x-pack/plugins/licensing/server/plugin.ts @@ -20,12 +20,13 @@ import { } from 'src/core/server'; import { ILicense, PublicLicense, PublicFeatures } from '../common/types'; -import { LicensingPluginSetup } from './types'; +import { LicensingPluginSetup, LicensingPluginStart } from './types'; import { License } from '../common/license'; import { createLicenseUpdate } from '../common/license_update'; import { ElasticsearchError, RawLicense, RawFeatures } from './types'; import { registerRoutes } from './routes'; +import { FeatureUsageService } from './services'; import { LicenseConfigType } from './licensing_config'; import { createRouteHandlerContext } from './licensing_route_handler_context'; @@ -77,18 +78,19 @@ function sign({ * A plugin for fetching, refreshing, and receiving information about the license for the * current Kibana instance. */ -export class LicensingPlugin implements Plugin { +export class LicensingPlugin implements Plugin { private stop$ = new Subject(); private readonly logger: Logger; private readonly config$: Observable; private loggingSubscription?: Subscription; + private featureUsage = new FeatureUsageService(); constructor(private readonly context: PluginInitializerContext) { this.logger = this.context.logger.get(); this.config$ = this.context.config.create(); } - public async setup(core: CoreSetup) { + public async setup(core: CoreSetup<{}, LicensingPluginStart>) { this.logger.debug('Setting up Licensing plugin'); const config = await this.config$.pipe(take(1)).toPromise(); const pollingFrequency = config.api_polling_frequency; @@ -101,13 +103,14 @@ export class LicensingPlugin implements Plugin { core.http.registerRouteHandlerContext('licensing', createRouteHandlerContext(license$)); - registerRoutes(core.http.createRouter()); + registerRoutes(core.http.createRouter(), core.getStartServices); core.http.registerOnPreResponse(createOnPreResponseHandler(refresh, license$)); return { refresh, license$, createLicensePoller: this.createLicensePoller.bind(this), + featureUsage: this.featureUsage.setup(), }; } @@ -186,7 +189,11 @@ export class LicensingPlugin implements Plugin { return error.message; } - public async start(core: CoreStart) {} + public async start(core: CoreStart) { + return { + featureUsage: this.featureUsage.start(), + }; + } public stop() { this.stop$.next(); diff --git a/x-pack/plugins/licensing/server/routes/feature_usage.ts b/x-pack/plugins/licensing/server/routes/feature_usage.ts new file mode 100644 index 00000000000000..5fbfbc3f577b81 --- /dev/null +++ b/x-pack/plugins/licensing/server/routes/feature_usage.ts @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import { IRouter, StartServicesAccessor } from 'src/core/server'; +import { LicensingPluginStart } from '../types'; + +export function registerFeatureUsageRoute( + router: IRouter, + getStartServices: StartServicesAccessor<{}, LicensingPluginStart> +) { + router.get( + { path: '/api/licensing/feature_usage', validate: false }, + async (context, request, response) => { + const [, , { featureUsage }] = await getStartServices(); + return response.ok({ + body: [...featureUsage.getLastUsages().entries()].reduce( + (res, [featureName, lastUsage]) => { + return { + ...res, + [featureName]: new Date(lastUsage).toISOString(), + }; + }, + {} + ), + }); + } + ); +} diff --git a/x-pack/plugins/licensing/server/routes/index.ts b/x-pack/plugins/licensing/server/routes/index.ts index 26b3bc6292dd62..2d073a92e507e9 100644 --- a/x-pack/plugins/licensing/server/routes/index.ts +++ b/x-pack/plugins/licensing/server/routes/index.ts @@ -3,9 +3,16 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from 'src/core/server'; + +import { IRouter, StartServicesAccessor } from 'src/core/server'; +import { LicensingPluginStart } from '../types'; import { registerInfoRoute } from './info'; +import { registerFeatureUsageRoute } from './feature_usage'; -export function registerRoutes(router: IRouter) { +export function registerRoutes( + router: IRouter, + getStartServices: StartServicesAccessor<{}, LicensingPluginStart> +) { registerInfoRoute(router); + registerFeatureUsageRoute(router, getStartServices); } diff --git a/x-pack/plugins/licensing/server/services/feature_usage_service.mock.ts b/x-pack/plugins/licensing/server/services/feature_usage_service.mock.ts new file mode 100644 index 00000000000000..f247c6ffcb526c --- /dev/null +++ b/x-pack/plugins/licensing/server/services/feature_usage_service.mock.ts @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { + FeatureUsageService, + FeatureUsageServiceSetup, + FeatureUsageServiceStart, +} from './feature_usage_service'; + +const createSetupMock = (): jest.Mocked => { + const mock = { + register: jest.fn(), + }; + + return mock; +}; + +const createStartMock = (): jest.Mocked => { + const mock = { + notifyUsage: jest.fn(), + getLastUsages: jest.fn(), + }; + + return mock; +}; + +const createServiceMock = (): jest.Mocked> => { + const mock = { + setup: jest.fn(() => createSetupMock()), + start: jest.fn(() => createStartMock()), + }; + + return mock; +}; + +export const featureUsageMock = { + create: createServiceMock, + createSetup: createSetupMock, + createStart: createStartMock, +}; diff --git a/x-pack/plugins/licensing/server/services/feature_usage_service.test.ts b/x-pack/plugins/licensing/server/services/feature_usage_service.test.ts new file mode 100644 index 00000000000000..f0ef0dbec0b220 --- /dev/null +++ b/x-pack/plugins/licensing/server/services/feature_usage_service.test.ts @@ -0,0 +1,116 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { FeatureUsageService } from './feature_usage_service'; + +describe('FeatureUsageService', () => { + let service: FeatureUsageService; + + beforeEach(() => { + service = new FeatureUsageService(); + }); + + afterEach(() => { + jest.restoreAllMocks(); + }); + + const toObj = (map: ReadonlyMap): Record => + Object.fromEntries(map.entries()); + + describe('#setup', () => { + describe('#register', () => { + it('throws when registering the same feature twice', () => { + const setup = service.setup(); + setup.register('foo'); + expect(() => { + setup.register('foo'); + }).toThrowErrorMatchingInlineSnapshot(`"Feature 'foo' has already been registered."`); + }); + }); + }); + + describe('#start', () => { + describe('#notifyUsage', () => { + it('allows to notify a feature usage', () => { + const setup = service.setup(); + setup.register('feature'); + const start = service.start(); + start.notifyUsage('feature', 127001); + + expect(start.getLastUsages().get('feature')).toBe(127001); + }); + + it('can receive a Date object', () => { + const setup = service.setup(); + setup.register('feature'); + const start = service.start(); + + const usageTime = new Date(2015, 9, 21, 17, 54, 12); + start.notifyUsage('feature', usageTime); + expect(start.getLastUsages().get('feature')).toBe(usageTime.getTime()); + }); + + it('uses the current time when `usedAt` is unspecified', () => { + jest.spyOn(Date, 'now').mockReturnValue(42); + + const setup = service.setup(); + setup.register('feature'); + const start = service.start(); + start.notifyUsage('feature'); + + expect(start.getLastUsages().get('feature')).toBe(42); + }); + + it('throws when notifying for an unregistered feature', () => { + service.setup(); + const start = service.start(); + expect(() => { + start.notifyUsage('unregistered'); + }).toThrowErrorMatchingInlineSnapshot(`"Feature 'unregistered' is not registered."`); + }); + }); + + describe('#getLastUsages', () => { + it('returns the last usage for all used features', () => { + const setup = service.setup(); + setup.register('featureA'); + setup.register('featureB'); + const start = service.start(); + start.notifyUsage('featureA', 127001); + start.notifyUsage('featureB', 6666); + + expect(toObj(start.getLastUsages())).toEqual({ + featureA: 127001, + featureB: 6666, + }); + }); + + it('returns the last usage even after notifying for an older usage', () => { + const setup = service.setup(); + setup.register('featureA'); + const start = service.start(); + start.notifyUsage('featureA', 1000); + start.notifyUsage('featureA', 500); + + expect(toObj(start.getLastUsages())).toEqual({ + featureA: 1000, + }); + }); + + it('does not return entries for unused registered features', () => { + const setup = service.setup(); + setup.register('featureA'); + setup.register('featureB'); + const start = service.start(); + start.notifyUsage('featureA', 127001); + + expect(toObj(start.getLastUsages())).toEqual({ + featureA: 127001, + }); + }); + }); + }); +}); diff --git a/x-pack/plugins/licensing/server/services/feature_usage_service.ts b/x-pack/plugins/licensing/server/services/feature_usage_service.ts new file mode 100644 index 00000000000000..47ffe3a3d9f54f --- /dev/null +++ b/x-pack/plugins/licensing/server/services/feature_usage_service.ts @@ -0,0 +1,63 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { isDate } from 'lodash'; + +/** @public */ +export interface FeatureUsageServiceSetup { + /** + * Register a feature to be able to notify of it's usages using the {@link FeatureUsageServiceStart | service start contract}. + */ + register(featureName: string): void; +} + +/** @public */ +export interface FeatureUsageServiceStart { + /** + * Notify of a registered feature usage at given time. + * + * @param featureName - the name of the feature to notify usage of + * @param usedAt - Either a `Date` or an unix timestamp with ms. If not specified, it will be set to the current time. + */ + notifyUsage(featureName: string, usedAt?: Date | number): void; + /** + * Return a map containing last usage timestamp for all features. + * Features that were not used yet do not appear in the map. + */ + getLastUsages(): ReadonlyMap; +} + +export class FeatureUsageService { + private readonly features: string[] = []; + private readonly lastUsages = new Map(); + + public setup(): FeatureUsageServiceSetup { + return { + register: featureName => { + if (this.features.includes(featureName)) { + throw new Error(`Feature '${featureName}' has already been registered.`); + } + this.features.push(featureName); + }, + }; + } + + public start(): FeatureUsageServiceStart { + return { + notifyUsage: (featureName, usedAt = Date.now()) => { + if (!this.features.includes(featureName)) { + throw new Error(`Feature '${featureName}' is not registered.`); + } + if (isDate(usedAt)) { + usedAt = usedAt.getTime(); + } + const currentValue = this.lastUsages.get(featureName) ?? 0; + this.lastUsages.set(featureName, Math.max(usedAt, currentValue)); + }, + getLastUsages: () => new Map(this.lastUsages.entries()), + }; + } +} diff --git a/x-pack/plugins/licensing/server/services/index.ts b/x-pack/plugins/licensing/server/services/index.ts new file mode 100644 index 00000000000000..fc890dd3c927d6 --- /dev/null +++ b/x-pack/plugins/licensing/server/services/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export { + FeatureUsageService, + FeatureUsageServiceSetup, + FeatureUsageServiceStart, +} from './feature_usage_service'; diff --git a/x-pack/plugins/licensing/server/types.ts b/x-pack/plugins/licensing/server/types.ts index f46167a0d0a42f..f11d9d5e69a585 100644 --- a/x-pack/plugins/licensing/server/types.ts +++ b/x-pack/plugins/licensing/server/types.ts @@ -6,6 +6,7 @@ import { Observable } from 'rxjs'; import { IClusterClient } from 'src/core/server'; import { ILicense, LicenseStatus, LicenseType } from '../common/types'; +import { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './services'; export interface ElasticsearchError extends Error { status?: number; @@ -57,7 +58,6 @@ export interface LicensingPluginSetup { * Triggers licensing information re-fetch. */ refresh(): Promise; - /** * Creates a license poller to retrieve a license data with. * Allows a plugin to configure a cluster to retrieve data from at @@ -67,4 +67,16 @@ export interface LicensingPluginSetup { clusterClient: IClusterClient, pollingFrequency: number ) => { license$: Observable; refresh(): Promise }; + /** + * APIs to register licensed feature usage. + */ + featureUsage: FeatureUsageServiceSetup; +} + +/** @public */ +export interface LicensingPluginStart { + /** + * APIs to manage licensed feature usage. + */ + featureUsage: FeatureUsageServiceStart; } diff --git a/x-pack/test/plugin_api_integration/config.ts b/x-pack/test/plugin_api_integration/config.ts index c581e0c246e132..adb31f3562a6f7 100644 --- a/x-pack/test/plugin_api_integration/config.ts +++ b/x-pack/test/plugin_api_integration/config.ts @@ -22,6 +22,7 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) { testFiles: [ require.resolve('./test_suites/task_manager'), require.resolve('./test_suites/event_log'), + require.resolve('./test_suites/licensed_feature_usage'), ], services, servers: integrationConfig.get('servers'), diff --git a/x-pack/test/plugin_api_integration/plugins/feature_usage_test/kibana.json b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/kibana.json new file mode 100644 index 00000000000000..b11b7ada24a578 --- /dev/null +++ b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/kibana.json @@ -0,0 +1,9 @@ +{ + "id": "feature_usage_test", + "version": "1.0.0", + "kibanaVersion": "kibana", + "configPath": ["xpack", "feature_usage_test"], + "requiredPlugins": ["licensing"], + "server": true, + "ui": false +} diff --git a/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/index.ts b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/index.ts new file mode 100644 index 00000000000000..e07915ab5f46b5 --- /dev/null +++ b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { PluginInitializer } from 'kibana/server'; +import { + FeatureUsageTestPlugin, + FeatureUsageTestPluginSetup, + FeatureUsageTestPluginStart, +} from './plugin'; + +export const plugin: PluginInitializer< + FeatureUsageTestPluginSetup, + FeatureUsageTestPluginStart +> = () => new FeatureUsageTestPlugin(); diff --git a/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/plugin.ts b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/plugin.ts new file mode 100644 index 00000000000000..b36d6dca077f74 --- /dev/null +++ b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/plugin.ts @@ -0,0 +1,53 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { Plugin, CoreSetup } from 'kibana/server'; +import { + LicensingPluginSetup, + LicensingPluginStart, +} from '../../../../../plugins/licensing/server'; +import { registerRoutes } from './routes'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface FeatureUsageTestPluginSetup {} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface FeatureUsageTestPluginStart {} + +export interface FeatureUsageTestSetupDependencies { + licensing: LicensingPluginSetup; +} +export interface FeatureUsageTestStartDependencies { + licensing: LicensingPluginStart; +} + +export class FeatureUsageTestPlugin + implements + Plugin< + FeatureUsageTestPluginSetup, + FeatureUsageTestPluginStart, + FeatureUsageTestSetupDependencies, + FeatureUsageTestStartDependencies + > { + public setup( + { + http, + getStartServices, + }: CoreSetup, + { licensing }: FeatureUsageTestSetupDependencies + ) { + licensing.featureUsage.register('test_feature_a'); + licensing.featureUsage.register('test_feature_b'); + licensing.featureUsage.register('test_feature_c'); + + registerRoutes(http.createRouter(), getStartServices); + + return {}; + } + + public start() { + return {}; + } +} diff --git a/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/routes/hit.ts b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/routes/hit.ts new file mode 100644 index 00000000000000..494bcdbf5f61eb --- /dev/null +++ b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/routes/hit.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { schema } from '@kbn/config-schema'; +import { IRouter, StartServicesAccessor } from 'src/core/server'; +import { FeatureUsageTestStartDependencies, FeatureUsageTestPluginStart } from '../plugin'; + +export function registerFeatureHitRoute( + router: IRouter, + getStartServices: StartServicesAccessor< + FeatureUsageTestStartDependencies, + FeatureUsageTestPluginStart + > +) { + router.get( + { + path: '/api/feature_usage_test/hit', + validate: { + query: schema.object({ + featureName: schema.string(), + usedAt: schema.maybe(schema.number()), + }), + }, + }, + async (context, request, response) => { + const [, { licensing }] = await getStartServices(); + try { + const { featureName, usedAt } = request.query; + licensing.featureUsage.notifyUsage(featureName, usedAt); + return response.ok(); + } catch (e) { + return response.badRequest(); + } + } + ); +} diff --git a/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/routes/index.ts b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/routes/index.ts new file mode 100644 index 00000000000000..a8225838fd9bfc --- /dev/null +++ b/x-pack/test/plugin_api_integration/plugins/feature_usage_test/server/routes/index.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { IRouter, StartServicesAccessor } from 'src/core/server'; +import { FeatureUsageTestStartDependencies, FeatureUsageTestPluginStart } from '../plugin'; + +import { registerFeatureHitRoute } from './hit'; + +export function registerRoutes( + router: IRouter, + getStartServices: StartServicesAccessor< + FeatureUsageTestStartDependencies, + FeatureUsageTestPluginStart + > +) { + registerFeatureHitRoute(router, getStartServices); +} diff --git a/x-pack/test/plugin_api_integration/test_suites/licensed_feature_usage/feature_usage.ts b/x-pack/test/plugin_api_integration/test_suites/licensed_feature_usage/feature_usage.ts new file mode 100644 index 00000000000000..41f2cfc7983ef0 --- /dev/null +++ b/x-pack/test/plugin_api_integration/test_suites/licensed_feature_usage/feature_usage.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +// eslint-disable-next-line import/no-default-export +export default function({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + + const notifyUsage = async (featureName: string, usedAt: number) => { + await supertest.get(`/api/feature_usage_test/hit?featureName=${featureName}&usedAt=${usedAt}`); + }; + + const toISO = (time: number) => new Date(time).toISOString(); + + describe('/api/licensing/feature_usage', () => { + it('returns a map of last feature usages', async () => { + const timeA = Date.now(); + await notifyUsage('test_feature_a', timeA); + + const timeB = Date.now() - 4567; + await notifyUsage('test_feature_b', timeB); + + const response = await supertest.get('/api/licensing/feature_usage').expect(200); + + expect(response.body.test_feature_a).to.eql(toISO(timeA)); + expect(response.body.test_feature_b).to.eql(toISO(timeB)); + }); + }); +} diff --git a/x-pack/test/plugin_api_integration/test_suites/licensed_feature_usage/index.ts b/x-pack/test/plugin_api_integration/test_suites/licensed_feature_usage/index.ts new file mode 100644 index 00000000000000..6cafb60bf81679 --- /dev/null +++ b/x-pack/test/plugin_api_integration/test_suites/licensed_feature_usage/index.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function({ loadTestFile }: FtrProviderContext) { + describe('Licensed feature usage APIs', function() { + this.tags('ciGroup2'); + loadTestFile(require.resolve('./feature_usage')); + }); +}