[ML] Functional tests - export service types (#52612)

With this PR the types of the ML services that are used in other services are exported from the service file to allow a cleaner re-use.
This commit is contained in:
Robert Oskamp 2019-12-11 16:25:48 +01:00 committed by GitHub
parent b6ea6990c0
commit 3130759c47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 14 deletions

View file

@ -4,12 +4,15 @@
* you may not use this file except in compliance with the Elastic License.
*/
import expect from '@kbn/expect';
import { ProvidedType } from '@kbn/test/types/ftr';
import { FtrProviderContext } from '../../ftr_provider_context';
import { JOB_STATE, DATAFEED_STATE } from '../../../../legacy/plugins/ml/common/constants/states';
import { DATA_FRAME_TASK_STATE } from '../../../../legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/common';
export type MlApi = ProvidedType<typeof MachineLearningAPIProvider>;
export function MachineLearningAPIProvider({ getService }: FtrProviderContext) {
const es = getService('legacyEs');
const log = getService('log');

View file

@ -3,6 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { ProvidedType } from '@kbn/test/types/ftr';
import { FtrProviderContext } from '../../ftr_provider_context';
@ -11,6 +12,8 @@ interface SetValueOptions {
typeCharByChar?: boolean;
}
export type MlCommon = ProvidedType<typeof MachineLearningCommonProvider>;
export function MachineLearningCommonProvider({ getService }: FtrProviderContext) {
const log = getService('log');
const retry = getService('retry');

View file

@ -4,9 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/
import expect from '@kbn/expect';
import { ProvidedType } from '@kbn/test/types/ftr';
import { FtrProviderContext } from '../../ftr_provider_context';
export type MlCustomUrls = ProvidedType<typeof MachineLearningCustomUrlsProvider>;
export function MachineLearningCustomUrlsProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');

View file

@ -3,16 +3,15 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { ProvidedType } from '@kbn/test/types/ftr';
import { FtrProviderContext } from '../../ftr_provider_context';
import { MachineLearningAPIProvider } from './api';
import { MlApi } from './api';
import { DATA_FRAME_TASK_STATE } from '../../../../legacy/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/common';
export function MachineLearningDataFrameAnalyticsProvider(
{ getService }: FtrProviderContext,
mlApi: ProvidedType<typeof MachineLearningAPIProvider>
mlApi: MlApi
) {
const testSubjects = getService('testSubjects');

View file

@ -3,16 +3,15 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { ProvidedType } from '@kbn/test/types/ftr';
import { FtrProviderContext } from '../../ftr_provider_context';
import { MachineLearningAPIProvider } from './api';
import { MlApi } from './api';
import { JOB_STATE, DATAFEED_STATE } from '../../../../legacy/plugins/ml/common/constants/states';
export function MachineLearningJobManagementProvider(
{ getService }: FtrProviderContext,
mlApi: ProvidedType<typeof MachineLearningAPIProvider>
mlApi: MlApi
) {
const testSubjects = getService('testSubjects');

View file

@ -4,14 +4,13 @@
* you may not use this file except in compliance with the Elastic License.
*/
import expect from '@kbn/expect';
import { ProvidedType } from '@kbn/test/types/ftr';
import { FtrProviderContext } from '../../ftr_provider_context';
import { MachineLearningCommonProvider } from './common';
import { MlCommon } from './common';
export function MachineLearningJobWizardAdvancedProvider(
{ getService }: FtrProviderContext,
mlCommon: ProvidedType<typeof MachineLearningCommonProvider>
mlCommon: MlCommon
) {
const comboBox = getService('comboBox');
const testSubjects = getService('testSubjects');

View file

@ -4,16 +4,15 @@
* you may not use this file except in compliance with the Elastic License.
*/
import expect from '@kbn/expect';
import { ProvidedType } from '@kbn/test/types/ftr';
import { FtrProviderContext } from '../../ftr_provider_context';
import { MachineLearningCommonProvider } from './common';
import { MachineLearningCustomUrlsProvider } from './custom_urls';
import { MlCommon } from './common';
import { MlCustomUrls } from './custom_urls';
export function MachineLearningJobWizardCommonProvider(
{ getService }: FtrProviderContext,
mlCommon: ProvidedType<typeof MachineLearningCommonProvider>,
customUrls: ProvidedType<typeof MachineLearningCustomUrlsProvider>
mlCommon: MlCommon,
customUrls: MlCustomUrls
) {
const comboBox = getService('comboBox');
const retry = getService('retry');