[ML] Functional tests - split ML test groups (#131716)

This PR splits up the ML functional UI test groups and renames them to better match the contained test suites.
This commit is contained in:
Robert Oskamp 2022-05-09 17:22:03 +02:00 committed by GitHub
parent 79d57040d4
commit c79eb03319
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
78 changed files with 260 additions and 207 deletions

View file

@ -162,10 +162,12 @@ enabled:
- x-pack/test/functional/apps/maps/group2/config.ts
- x-pack/test/functional/apps/maps/group3/config.ts
- x-pack/test/functional/apps/maps/group4/config.ts
- x-pack/test/functional/apps/ml/anomaly_detection/config.ts
- x-pack/test/functional/apps/ml/data_frame_analytics/config.ts
- x-pack/test/functional/apps/ml/data_visualizer/config.ts
- x-pack/test/functional/apps/ml/group1/config.ts
- x-pack/test/functional/apps/ml/group2/config.ts
- x-pack/test/functional/apps/ml/group3/config.ts
- x-pack/test/functional/apps/ml/permissions/config.ts
- x-pack/test/functional/apps/ml/short_tests/config.ts
- x-pack/test/functional/apps/ml/stack_management_jobs/config.ts
- x-pack/test/functional/apps/monitoring/config.ts
- x-pack/test/functional/apps/remote_clusters/config.ts
- x-pack/test/functional/apps/reporting_management/config.ts

View file

@ -104,42 +104,49 @@ Run the following commands from the `x-pack` directory and use separate terminal
for test server and test runner. The test server command starts an Elasticsearch
and Kibana instance that the tests will be run against.
1. Functional UI tests with `Trial` license (default config):
Functional tests are broken up into independent groups with their own configuration.
Test server and runner need to be pointed to the configuration to run. The basic
commands are
node scripts/functional_tests_server.js
node scripts/functional_test_runner.js --include-tag mlqa
node scripts/functional_tests_server.js --config PATH_TO_CONFIG
node scripts/functional_test_runner.js --config PATH_TO_CONFIG
ML functional `Trial` license tests are located in `x-pack/test/functional/apps/ml`.
With PATH_TO_CONFIG and other options as follows.
1. Functional UI tests with `Trial` license:
Group | PATH_TO_CONFIG
----- | --------------
anomaly detection | `test/functional/apps/ml/anomaly_detection/config.ts`
data frame analytics | `test/functional/apps/ml/anomaly_detection/config.ts`
data visualizer | `test/functional/apps/ml/data_frame_analytics/config.ts`
permissions | `test/functional/apps/ml/permissions/config.ts`
stack management jobs | `test/functional/apps/ml/stack_management_jobs/config.ts`
short tests | `test/functional/apps/ml/short_tests/config.ts`
The `short tests` group contains tests for page navigation, model management,
feature controls, settings and embeddables. Test files for each group are located
in the directory of their copnfiguration file.
1. Functional UI tests with `Basic` license:
node scripts/functional_tests_server.js --config test/functional_basic/config.ts
node scripts/functional_test_runner.js --config test/functional_basic/config.ts --include-tag mlqa
ML functional `Basic` license tests are located in `x-pack/test/functional_basic/apps/ml`.
- PATH_TO_CONFIG: `test/functional_basic/config.ts`
- Add `--include-tag ml` to the test runner command
- Tests are located in `x-pack/test/functional_basic/apps/ml`
1. API integration tests with `Trial` license:
node scripts/functional_tests_server.js
node scripts/functional_test_runner.js --config test/api_integration/config.ts --include-tag mlqa
ML API integration `Trial` license tests are located in `x-pack/test/api_integration/apis/ml`.
1. API integration tests with `Basic` license:
node scripts/functional_tests_server.js --config test/api_integration_basic/config.ts
node scripts/functional_test_runner.js --config test/api_integration_basic/config.ts --include-tag mlqa
ML API integration `Basic` license tests are located in `x-pack/test/api_integration_basic/apis/ml`.
- PATH_TO_CONFIG: `test/api_integration/config.ts`
- Add `--include-tag ml` to the test runner command
- Tests are located in `x-pack/test/api_integration/apis/ml`
1. Accessibility tests:
We maintain a suite of accessibility tests (you may see them referred to elsewhere as `a11y` tests). These tests render each of our pages and ensure that the inputs and other elements contain the attributes necessary to ensure all users are able to make use of ML (for example, users relying on screen readers).
node scripts/functional_tests_server --config test/accessibility/config.ts
node scripts/functional_test_runner.js --config test/accessibility/config.ts --grep=ml
ML accessibility tests are located in `x-pack/test/accessibility/apps`.
- PATH_TO_CONFIG: `test/accessibility/config.ts`
- Add `--grep=ml` to the test runner command
- Tests are located in `x-pack/test/accessibility/apps`
## Generating docs screenshots
@ -151,7 +158,7 @@ for test server and test runner. The test server command starts an Elasticsearch
and Kibana instance that the tests will be run against.
node scripts/functional_tests_server.js --config test/screenshot_creation/config.ts
node scripts/functional_test_runner.js --config test/screenshot_creation/config.ts --include-tag mlqa
node scripts/functional_test_runner.js --config test/screenshot_creation/config.ts --include-tag ml
The generated screenshots are stored in `x-pack/test/functional/screenshots/session/ml_docs`.
ML screenshot generation tests are located in `x-pack/test/screenshot_creation/apps/ml_docs`.

View file

@ -106,8 +106,8 @@ and Kibana instance that the tests will be run against.
1. Functional UI tests with `Trial` license (default config):
node scripts/functional_tests_server.js
node scripts/functional_test_runner.js --include-tag transform
node scripts/functional_tests_server.js --config test/functional/apps/transform/config.ts
node scripts/functional_test_runner.js --config test/functional/apps/transform/config.ts
Transform functional `Trial` license tests are located in `x-pack/test/functional/apps/transform`.
@ -120,7 +120,7 @@ and Kibana instance that the tests will be run against.
1. API integration tests with `Trial` license:
node scripts/functional_tests_server.js
node scripts/functional_tests_server.js --config test/api_integration/config.ts
node scripts/functional_test_runner.js --config test/api_integration/config.ts --include-tag transform
Transform API integration `Trial` license tests are located in `x-pack/test/api_integration/apis/transform`.

View file

@ -12,7 +12,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
const ml = getService('ml');
describe('Machine Learning', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await ml.securityCommon.createMlRoles();

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
interface Detector {
identifier: string;
@ -220,7 +220,7 @@ export default function ({ getService }: FtrProviderContext) {
const calendarId = `wizard-test-calendar_${Date.now()}`;
describe('advanced job', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce');
await ml.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date');

View file

@ -6,7 +6,7 @@
*/
import { Datafeed, Job } from '@kbn/ml-plugin/common/types/anomaly_detection_jobs';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -360,7 +360,7 @@ export default function ({ getService }: FtrProviderContext) {
];
describe('aggregated or scripted job', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce');

View file

@ -6,14 +6,14 @@
*/
import { Annotation } from '@kbn/ml-plugin/common/types/annotations';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const ml = getService('ml');
describe('annotations', function () {
this.tags(['mlqa']);
this.tags(['ml']);
const jobId = `fq_single_1_smv_${Date.now()}`;
const annotation = {

View file

@ -6,7 +6,7 @@
*/
import { Job, Datafeed } from '@kbn/ml-plugin/common/types/anomaly_detection_jobs';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
// @ts-expect-error not full interface
const JOB_CONFIG: Job = {
@ -64,7 +64,7 @@ export default function ({ getService }: FtrProviderContext) {
const elasticChart = getService('elasticChart');
describe('anomaly explorer', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp');

View file

@ -6,7 +6,7 @@
*/
import { CATEGORY_EXAMPLES_VALIDATION_STATUS } from '@kbn/ml-plugin/common/constants/categorization_job';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -75,7 +75,7 @@ export default function ({ getService }: FtrProviderContext) {
const calendarId = `wizard-test-calendar_${Date.now()}`;
describe('categorization', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/categorization_small');
await ml.testResources.createIndexPatternIfNeeded('ft_categorization_small', '@timestamp');

View file

@ -13,5 +13,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests - ML anomaly_detection',
},
};
}

View file

@ -7,12 +7,12 @@
import { Job, Datafeed } from '@kbn/ml-plugin/common/types/anomaly_detection_jobs';
import { TIME_RANGE_TYPE } from '@kbn/ml-plugin/public/application/jobs/components/custom_url_editor/constants';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
import type {
DiscoverUrlConfig,
DashboardUrlConfig,
OtherUrlConfig,
} from '../../../../services/ml/job_table';
} from '../../../services/ml/job_table';
// @ts-expect-error doesn't implement the full interface
const JOB_CONFIG: Job = {
@ -63,7 +63,7 @@ export default function ({ getService }: FtrProviderContext) {
const browser = getService('browser');
describe('custom urls', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
interface Detector {
identifier: string;
@ -115,7 +115,7 @@ export default function ({ getService }: FtrProviderContext) {
];
describe('job on data set with date_nanos time field', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/event_rate_nanos');
await ml.testResources.createIndexPatternIfNeeded(

View file

@ -6,7 +6,7 @@
*/
import { Job, Datafeed } from '@kbn/ml-plugin/common/types/anomaly_detection_jobs';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
// @ts-expect-error not full interface
const JOB_CONFIG: Job = {
@ -40,7 +40,7 @@ export default function ({ getService }: FtrProviderContext) {
const ml = getService('ml');
describe('forecasts', function () {
this.tags(['mlqa']);
this.tags(['ml']);
describe('with single metric job', function () {
before(async () => {

View file

@ -5,12 +5,35 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('anomaly detection', function () {
export default function ({ getService, loadTestFile }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const ml = getService('ml');
describe('machine learning - anomaly detection', function () {
this.tags(['skipFirefox']);
before(async () => {
await ml.securityCommon.createMlRoles();
await ml.securityCommon.createMlUsers();
});
after(async () => {
// NOTE: Logout needs to happen before anything else to avoid flaky behavior
await ml.securityUI.logout();
await ml.securityCommon.cleanMlUsers();
await ml.securityCommon.cleanMlRoles();
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/categorization_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/event_rate_nanos');
await ml.testResources.resetKibanaTimeZone();
});
loadTestFile(require.resolve('./single_metric_job'));
loadTestFile(require.resolve('./single_metric_job_without_datafeed_start'));
loadTestFile(require.resolve('./multi_metric_job'));

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -72,7 +72,7 @@ export default function ({ getService }: FtrProviderContext) {
const calendarId = `wizard-test-calendar_${Date.now()}`;
describe('multi metric', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -86,7 +86,7 @@ export default function ({ getService }: FtrProviderContext) {
const calendarId = `wizard-test-calendar_${Date.now()}`;
describe('population', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce');
await ml.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -266,7 +266,7 @@ export default function ({ getService }: FtrProviderContext) {
];
describe('saved search', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -72,7 +72,7 @@ export default function ({ getService }: FtrProviderContext) {
const calendarId = `wizard-test-calendar_${Date.now()}`;
describe('single metric', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -57,7 +57,7 @@ export default function ({ getService }: FtrProviderContext) {
}
describe('single metric without datafeed start', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp');

View file

@ -6,7 +6,7 @@
*/
import { Job, Datafeed } from '@kbn/ml-plugin/common/types/anomaly_detection_jobs';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
// @ts-expect-error not full interface
const JOB_CONFIG: Job = {
@ -41,7 +41,7 @@ export default function ({ getService }: FtrProviderContext) {
const ml = getService('ml');
describe('single metric viewer', function () {
this.tags(['mlqa']);
this.tags(['ml']);
describe('with single metric job', function () {
before(async () => {

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { AnalyticsTableRowDetails } from '../../../../services/ml/data_frame_analytics_table';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { AnalyticsTableRowDetails } from '../../../services/ml/data_frame_analytics_table';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { AnalyticsTableRowDetails } from '../../../../services/ml/data_frame_analytics_table';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { AnalyticsTableRowDetails } from '../../../services/ml/data_frame_analytics_table';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

View file

@ -9,7 +9,7 @@ import expect from '@kbn/expect';
import { DeepPartial } from '@kbn/ml-plugin/common/types/common';
import { DataFrameAnalyticsConfig } from '@kbn/ml-plugin/public/application/data_frame_analytics/common';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

View file

@ -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
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests - ML data_frame_analytics',
},
};
}

View file

@ -11,7 +11,9 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const ml = getService('ml');
describe('machine learning - group 2', () => {
describe('machine learning - data frame analytics', function () {
this.tags(['ml', 'skipFirefox']);
before(async () => {
await ml.securityCommon.createMlRoles();
await ml.securityCommon.createMlUsers();
@ -24,22 +26,21 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
await ml.securityCommon.cleanMlUsers();
await ml.securityCommon.cleanMlRoles();
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/categorization_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/event_rate_nanos');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/bm_classification');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ihp_outlier');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/egs_regression');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/module_sample_ecommerce');
await ml.testResources.resetKibanaTimeZone();
});
loadTestFile(require.resolve('./permissions'));
loadTestFile(require.resolve('./pages'));
loadTestFile(require.resolve('./data_frame_analytics'));
loadTestFile(require.resolve('./model_management'));
loadTestFile(require.resolve('./outlier_detection_creation'));
loadTestFile(require.resolve('./regression_creation'));
loadTestFile(require.resolve('./classification_creation'));
loadTestFile(require.resolve('./cloning'));
loadTestFile(require.resolve('./results_view_content'));
loadTestFile(require.resolve('./regression_creation_saved_search'));
loadTestFile(require.resolve('./classification_creation_saved_search'));
loadTestFile(require.resolve('./outlier_detection_creation_saved_search'));
});
}

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { AnalyticsTableRowDetails } from '../../../../services/ml/data_frame_analytics_table';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { AnalyticsTableRowDetails } from '../../../services/ml/data_frame_analytics_table';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { AnalyticsTableRowDetails } from '../../../../services/ml/data_frame_analytics_table';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { AnalyticsTableRowDetails } from '../../../services/ml/data_frame_analytics_table';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { AnalyticsTableRowDetails } from '../../../../services/ml/data_frame_analytics_table';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { AnalyticsTableRowDetails } from '../../../services/ml/data_frame_analytics_table';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { AnalyticsTableRowDetails } from '../../../../services/ml/data_frame_analytics_table';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { AnalyticsTableRowDetails } from '../../../services/ml/data_frame_analytics_table';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

View file

@ -8,7 +8,7 @@
import { DeepPartial } from '@kbn/ml-plugin/common/types/common';
import { DataFrameAnalyticsConfig } from '@kbn/ml-plugin/public/application/data_frame_analytics/common';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

View file

@ -13,5 +13,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests - ML data_visualizer',
},
};
}

View file

@ -208,7 +208,7 @@ export default function ({ getService }: FtrProviderContext) {
];
describe('file based', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await ml.testResources.setKibanaTimeZoneToUTC();

View file

@ -12,7 +12,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
const ml = getService('ml');
describe('machine learning - data visualizer', function () {
this.tags(['skipFirefox', 'mlqa']);
this.tags(['skipFirefox', 'ml']);
before(async () => {
await ml.securityCommon.createMlRoles();
@ -27,14 +27,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
await ml.securityCommon.cleanMlRoles();
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/categorization_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/event_rate_nanos');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/bm_classification');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ihp_outlier');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/egs_regression');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/module_sample_ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/module_sample_logs');
await ml.testResources.resetKibanaTimeZone();
});

View file

@ -154,7 +154,7 @@ export default function ({ getPageObject, getService }: FtrProviderContext) {
}
describe('index based', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/module_sample_logs');

View file

@ -12,7 +12,7 @@ export default function ({ getService }: FtrProviderContext) {
const ml = getService('ml');
describe('index based actions panel on trial license', function () {
this.tags(['mlqa']);
this.tags(['ml']);
const indexPatternName = 'ft_farequote';

View file

@ -173,7 +173,7 @@ export default function ({ getService }: FtrProviderContext) {
}
describe('data view management', function () {
this.tags(['mlqa']);
this.tags(['ml']);
const indexPatternTitle = 'ft_farequote';
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');

View file

@ -1,23 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('data frame analytics', function () {
this.tags(['mlqa', 'skipFirefox']);
loadTestFile(require.resolve('./outlier_detection_creation'));
loadTestFile(require.resolve('./regression_creation'));
loadTestFile(require.resolve('./classification_creation'));
loadTestFile(require.resolve('./cloning'));
loadTestFile(require.resolve('./results_view_content'));
loadTestFile(require.resolve('./regression_creation_saved_search'));
loadTestFile(require.resolve('./classification_creation_saved_search'));
loadTestFile(require.resolve('./outlier_detection_creation_saved_search'));
});
}

View file

@ -1,18 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('permissions', function () {
this.tags(['skipFirefox']);
loadTestFile(require.resolve('./full_ml_access'));
loadTestFile(require.resolve('./read_ml_access'));
loadTestFile(require.resolve('./no_ml_access'));
});
}

View file

@ -1,19 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('stack management jobs', function () {
this.tags(['mlqa', 'skipFirefox']);
loadTestFile(require.resolve('./synchronize'));
loadTestFile(require.resolve('./manage_spaces'));
loadTestFile(require.resolve('./import_jobs'));
loadTestFile(require.resolve('./export_jobs'));
});
}

View file

@ -13,5 +13,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests - ML permission',
},
};
}

View file

@ -5,9 +5,9 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { USER } from '../../../../services/ml/security_common';
import { USER } from '../../../services/ml/security_common';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -20,7 +20,7 @@ export default function ({ getService }: FtrProviderContext) {
];
describe('for user with full ML access', function () {
this.tags(['skipFirefox', 'mlqa']);
this.tags(['skipFirefox', 'ml']);
describe('with no data loaded', function () {
for (const testUser of testUsers) {
@ -122,7 +122,7 @@ export default function ({ getService }: FtrProviderContext) {
const ecExpectedTotalCount = '287';
const uploadFilePath = require.resolve(
'../../data_visualizer/files_to_import/artificial_server_log'
'../data_visualizer/files_to_import/artificial_server_log'
);
const expectedUploadFileTitle = 'artificial_server_log';

View file

@ -11,7 +11,9 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const ml = getService('ml');
describe('machine learning - group 3', function () {
describe('machine learning - permissions', function () {
this.tags(['ml', 'skipFirefox']);
before(async () => {
await ml.securityCommon.createMlRoles();
await ml.securityCommon.createMlUsers();
@ -25,21 +27,14 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
await ml.securityCommon.cleanMlRoles();
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/categorization_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/event_rate_nanos');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/bm_classification');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ihp_outlier');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/egs_regression');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/module_sample_ecommerce');
await ml.testResources.resetKibanaTimeZone();
});
loadTestFile(require.resolve('./feature_controls'));
loadTestFile(require.resolve('./settings'));
loadTestFile(require.resolve('./embeddables'));
loadTestFile(require.resolve('./stack_management_jobs'));
loadTestFile(require.resolve('./full_ml_access'));
loadTestFile(require.resolve('./read_ml_access'));
loadTestFile(require.resolve('./no_ml_access'));
});
}

View file

@ -5,9 +5,9 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { USER } from '../../../../services/ml/security_common';
import { USER } from '../../../services/ml/security_common';
export default function ({ getPageObjects, getService }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'error']);
@ -16,7 +16,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const testUsers = [{ user: USER.ML_UNAUTHORIZED, discoverAvailable: true }];
describe('for user with no ML access', function () {
this.tags(['skipFirefox', 'mlqa']);
this.tags(['skipFirefox', 'ml']);
for (const testUser of testUsers) {
describe(`(${testUser.user})`, function () {

View file

@ -5,9 +5,9 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { USER } from '../../../../services/ml/security_common';
import { USER } from '../../../services/ml/security_common';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -19,7 +19,7 @@ export default function ({ getService }: FtrProviderContext) {
];
describe('for user with read ML access', function () {
this.tags(['skipFirefox', 'mlqa']);
this.tags(['skipFirefox', 'ml']);
describe('with no data loaded', function () {
for (const testUser of testUsers) {
@ -116,7 +116,7 @@ export default function ({ getService }: FtrProviderContext) {
const ecExpectedTotalCount = '287';
const uploadFilePath = require.resolve(
'../../data_visualizer/files_to_import/artificial_server_log'
'../data_visualizer/files_to_import/artificial_server_log'
);
const expectedUploadFileTitle = 'artificial_server_log';

View file

@ -13,5 +13,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests - ML short_tests',
},
};
}

View file

@ -34,7 +34,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'timePicker', 'dashboard']);
describe('anomaly charts in dashboard', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');

View file

@ -66,7 +66,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'timePicker', 'dashboard']);
describe('anomaly embeddables migration in Dashboard', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');

View file

@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('feature controls', function () {
this.tags(['skipFirefox', 'mlqa']);
this.tags(['skipFirefox', 'ml']);
loadTestFile(require.resolve('./ml_security'));
loadTestFile(require.resolve('./ml_spaces'));
});

View file

@ -0,0 +1,38 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService, loadTestFile }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const ml = getService('ml');
describe('machine learning - short tests', function () {
before(async () => {
await ml.securityCommon.createMlRoles();
await ml.securityCommon.createMlUsers();
});
after(async () => {
// NOTE: Logout needs to happen before anything else to avoid flaky behavior
await ml.securityUI.logout();
await ml.securityCommon.cleanMlUsers();
await ml.securityCommon.cleanMlRoles();
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote');
await ml.testResources.resetKibanaTimeZone();
});
loadTestFile(require.resolve('./pages'));
loadTestFile(require.resolve('./model_management'));
loadTestFile(require.resolve('./feature_controls'));
loadTestFile(require.resolve('./settings'));
loadTestFile(require.resolve('./embeddables'));
});
}

View file

@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('model management', function () {
this.tags(['mlqa', 'skipFirefox']);
this.tags(['ml', 'skipFirefox']);
loadTestFile(require.resolve('./model_list'));
});

View file

@ -11,7 +11,7 @@ export default function ({ getService }: FtrProviderContext) {
const ml = getService('ml');
describe('page navigation', function () {
this.tags(['skipFirefox', 'mlqa']);
this.tags(['skipFirefox', 'ml']);
before(async () => {
await ml.api.cleanMlIndices();
await ml.securityUI.loginAsMlPowerUser();

View file

@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('settings', function () {
this.tags(['mlqa', 'skipFirefox']);
this.tags(['ml', 'skipFirefox']);
loadTestFile(require.resolve('./calendar_creation'));
loadTestFile(require.resolve('./calendar_edit'));

View file

@ -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
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js'));
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests - ML stack_management_jobs',
},
};
}

View file

@ -7,7 +7,7 @@
import { Job, Datafeed } from '@kbn/ml-plugin/common/types/anomaly_detection_jobs';
import type { DataFrameAnalyticsConfig } from '@kbn/ml-plugin/public/application/data_frame_analytics/common';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
const testADJobs: Array<{ job: Job; datafeed: Datafeed }> = [
{
@ -255,7 +255,7 @@ export default function ({ getService }: FtrProviderContext) {
const ml = getService('ml');
describe('export jobs', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await ml.api.cleanMlIndices();
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');

View file

@ -6,7 +6,7 @@
*/
import { JobType } from '@kbn/ml-plugin/common/types/saved_objects';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -31,7 +31,7 @@ export default function ({ getService }: FtrProviderContext) {
];
describe('import jobs', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await ml.api.cleanMlIndices();
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');

View file

@ -11,7 +11,8 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const ml = getService('ml');
describe('machine learning - group 2', () => {
describe('machine learning - stack management jobs', function () {
this.tags(['ml', 'skipFirefox']);
before(async () => {
await ml.securityCommon.createMlRoles();
await ml.securityCommon.createMlUsers();
@ -25,18 +26,16 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
await ml.securityCommon.cleanMlRoles();
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/farequote_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ecommerce');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/categorization_small');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/event_rate_nanos');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/bm_classification');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/ihp_outlier');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/egs_regression');
await esArchiver.unload('x-pack/test/functional/es_archives/ml/module_sample_ecommerce');
await ml.testResources.resetKibanaTimeZone();
});
loadTestFile(require.resolve('./anomaly_detection'));
loadTestFile(require.resolve('./synchronize'));
loadTestFile(require.resolve('./manage_spaces'));
loadTestFile(require.resolve('./import_jobs'));
loadTestFile(require.resolve('./export_jobs'));
});
}

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const browser = getService('browser');
@ -107,7 +107,7 @@ export default function ({ getService }: FtrProviderContext) {
}
describe('manage spaces', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ihp_outlier');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -20,7 +20,7 @@ export default function ({ getService }: FtrProviderContext) {
const dfaJobIdES = 'ihp_od_es';
describe('synchronize', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ihp_outlier');

View file

@ -13,5 +13,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests - Transform',
},
};
}

View file

@ -12,7 +12,7 @@ export default function ({ getService }: FtrProviderContext) {
const ml = getService('ml');
describe('index based actions panel on basic license', function () {
this.tags(['mlqa']);
this.tags(['ml']);
const indexPatternName = 'ft_farequote';
const savedSearch = 'ft_farequote_kuery';

View file

@ -12,7 +12,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
const ml = getService('ml');
describe('machine learning basic license', function () {
this.tags(['skipFirefox', 'mlqa']);
this.tags(['skipFirefox', 'ml']);
before(async () => {
await ml.securityCommon.createMlRoles();

View file

@ -12,7 +12,7 @@ export default ({ loadTestFile, getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
describe('ML app', function () {
this.tags(['mlqa', 'skipFirefox']);
this.tags(['ml', 'skipFirefox']);
before(async () => {
await ml.securityCommon.createMlRoles();

View file

@ -16,7 +16,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
const ml = getService('ml');
describe('machine learning docs', function () {
this.tags(['mlqa']);
this.tags(['ml']);
before(async () => {
await ml.testResources.installAllKibanaSampleData();