Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Functional tests - reenable categorization tests #101137

Merged
merged 2 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ export default ({ getService }: FtrProviderContext) => {
},
];

// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
describe.skip('Categorization example endpoint - ', function () {
describe('Categorization example endpoint - ', function () {
before(async () => {
await esArchiver.loadIfNeeded('ml/categorization');
await ml.testResources.setKibanaTimeZoneToUTC();
Expand Down
55 changes: 27 additions & 28 deletions x-pack/test/api_integration/apis/ml/modules/setup_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,34 +241,33 @@ export default ({ getService }: FtrProviderContext) => {
dashboards: [] as string[],
},
},
// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
// {
// testTitleSuffix:
// 'for logs_ui_categories with prefix, startDatafeed true and estimateModelMemory true',
// sourceDataArchive: 'ml/module_logs',
// indexPattern: { name: 'ft_module_logs', timeField: '@timestamp' },
// module: 'logs_ui_categories',
// user: USER.ML_POWERUSER,
// requestBody: {
// prefix: 'pf7_',
// indexPatternName: 'ft_module_logs',
// startDatafeed: true,
// end: Date.now(),
// },
// expected: {
// responseCode: 200,
// jobs: [
// {
// jobId: 'pf7_log-entry-categories-count',
// jobState: JOB_STATE.CLOSED,
// datafeedState: DATAFEED_STATE.STOPPED,
// },
// ],
// searches: [] as string[],
// visualizations: [] as string[],
// dashboards: [] as string[],
// },
// },
{
testTitleSuffix:
'for logs_ui_categories with prefix, startDatafeed true and estimateModelMemory true',
sourceDataArchive: 'ml/module_logs',
indexPattern: { name: 'ft_module_logs', timeField: '@timestamp' },
module: 'logs_ui_categories',
user: USER.ML_POWERUSER,
requestBody: {
prefix: 'pf7_',
indexPatternName: 'ft_module_logs',
startDatafeed: true,
end: Date.now(),
},
expected: {
responseCode: 200,
jobs: [
{
jobId: 'pf7_log-entry-categories-count',
jobState: JOB_STATE.CLOSED,
datafeedState: DATAFEED_STATE.STOPPED,
},
],
searches: [] as string[],
visualizations: [] as string[],
dashboards: [] as string[],
},
},
{
testTitleSuffix: 'for nginx_ecs with prefix, startDatafeed true and estimateModelMemory true',
sourceDataArchive: 'ml/module_nginx',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ export default ({ getService }: FtrProviderContext) => {
query: { bool: { must: [{ match_all: {} }] } },
};

// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
describe.skip('get categorizer_stats', function () {
describe('get categorizer_stats', function () {
before(async () => {
await esArchiver.loadIfNeeded('ml/module_sample_logs');
await ml.testResources.setKibanaTimeZoneToUTC();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ export default ({ getService }: FtrProviderContext) => {

const testJobIds = testSetUps.map((t) => t.jobId);

// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
describe.skip('get stopped_partitions', function () {
describe('get stopped_partitions', function () {
before(async () => {
await esArchiver.loadIfNeeded('ml/module_sample_logs');
await ml.testResources.setKibanaTimeZoneToUTC();
Expand Down
133 changes: 66 additions & 67 deletions x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,73 +149,72 @@ export default function ({ getService }: FtrProviderContext) {
},
},
},
// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
// {
// suiteTitle: 'with categorization detector and default datafeed settings',
// jobSource: 'ft_ecommerce',
// jobId: `ec_advanced_2_${Date.now()}`,
// get jobIdClone(): string {
// return `${this.jobId}_clone`;
// },
// jobDescription:
// 'Create advanced job from ft_ecommerce dataset with a categorization detector and default datafeed settings',
// jobGroups: ['automated', 'ecommerce', 'advanced'],
// get jobGroupsClone(): string[] {
// return [...this.jobGroups, 'clone'];
// },
// pickFieldsConfig: {
// categorizationField: 'products.product_name',
// detectors: [
// {
// identifier: 'count by mlcategory',
// function: 'count',
// byField: 'mlcategory',
// } as Detector,
// ],
// influencers: ['mlcategory'],
// bucketSpan: '4h',
// memoryLimit: '100mb',
// } as PickFieldsConfig,
// datafeedConfig: {} as DatafeedConfig,
// expected: {
// wizard: {
// timeField: 'order_date',
// },
// row: {
// recordCount: '4,675',
// memoryStatus: 'ok',
// jobState: 'closed',
// datafeedState: 'stopped',
// latestTimestamp: '2019-07-12 23:45:36',
// },
// counts: {
// processed_record_count: '4,675',
// processed_field_count: '4,675',
// input_bytes: '354.2 KB',
// input_field_count: '4,675',
// invalid_date_count: '0',
// missing_field_count: '0',
// out_of_order_timestamp_count: '0',
// empty_bucket_count: '0',
// sparse_bucket_count: '0',
// bucket_count: '185',
// earliest_record_timestamp: '2019-06-12 00:04:19',
// latest_record_timestamp: '2019-07-12 23:45:36',
// input_record_count: '4,675',
// latest_bucket_timestamp: '2019-07-12 20:00:00',
// },
// modelSizeStats: {
// result_type: 'model_size_stats',
// model_bytes_exceeded: '0.0 B',
// // not checking total_by_field_count as the number of categories might change
// total_over_field_count: '0',
// total_partition_field_count: '2',
// bucket_allocation_failures_count: '0',
// memory_status: 'ok',
// timestamp: '2019-07-12 16:00:00',
// },
// },
// },
{
suiteTitle: 'with categorization detector and default datafeed settings',
jobSource: 'ft_ecommerce',
jobId: `ec_advanced_2_${Date.now()}`,
get jobIdClone(): string {
return `${this.jobId}_clone`;
},
jobDescription:
'Create advanced job from ft_ecommerce dataset with a categorization detector and default datafeed settings',
jobGroups: ['automated', 'ecommerce', 'advanced'],
get jobGroupsClone(): string[] {
return [...this.jobGroups, 'clone'];
},
pickFieldsConfig: {
categorizationField: 'products.product_name',
detectors: [
{
identifier: 'count by mlcategory',
function: 'count',
byField: 'mlcategory',
} as Detector,
],
influencers: ['mlcategory'],
bucketSpan: '4h',
memoryLimit: '100mb',
} as PickFieldsConfig,
datafeedConfig: {} as DatafeedConfig,
expected: {
wizard: {
timeField: 'order_date',
},
row: {
recordCount: '4,675',
memoryStatus: 'ok',
jobState: 'closed',
datafeedState: 'stopped',
latestTimestamp: '2019-07-12 23:45:36',
},
counts: {
processed_record_count: '4,675',
processed_field_count: '4,675',
input_bytes: '354.2 KB',
input_field_count: '4,675',
invalid_date_count: '0',
missing_field_count: '0',
out_of_order_timestamp_count: '0',
empty_bucket_count: '0',
sparse_bucket_count: '0',
bucket_count: '185',
earliest_record_timestamp: '2019-06-12 00:04:19',
latest_record_timestamp: '2019-07-12 23:45:36',
input_record_count: '4,675',
latest_bucket_timestamp: '2019-07-12 20:00:00',
},
modelSizeStats: {
result_type: 'model_size_stats',
model_bytes_exceeded: '0.0 B',
// not checking total_by_field_count as the number of categories might change
total_over_field_count: '0',
total_partition_field_count: '2',
bucket_allocation_failures_count: '0',
memory_status: 'ok',
timestamp: '2019-07-12 16:00:00',
},
},
},
];

const calendarId = `wizard-test-calendar_${Date.now()}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ export default function ({ getService }: FtrProviderContext) {

const calendarId = `wizard-test-calendar_${Date.now()}`;

// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
describe.skip('categorization', function () {
describe('categorization', function () {
this.tags(['mlqa']);
before(async () => {
await esArchiver.loadIfNeeded('ml/categorization');
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/functional/services/ml/test_resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ export function MachineLearningTestResourcesProvider({ getService }: FtrProvider
},

async installFleetPackage(packageIdentifier: string) {
log.debug(`Installing Fleet package'${packageIdentifier}'`);
log.debug(`Installing Fleet package '${packageIdentifier}'`);

await supertest
.post(`/api/fleet/epm/packages/${packageIdentifier}`)
Expand All @@ -545,7 +545,7 @@ export function MachineLearningTestResourcesProvider({ getService }: FtrProvider
},

async removeFleetPackage(packageIdentifier: string) {
log.debug(`Removing Fleet package'${packageIdentifier}'`);
log.debug(`Removing Fleet package '${packageIdentifier}'`);

await supertest
.delete(`/api/fleet/epm/packages/${packageIdentifier}`)
Expand Down