Skip to content

Commit 3bcfd48

Browse files
pheyoskibanamachine
authored andcommitted
[ML] Functional tests - reenable categorization tests (#101137)
This PR re-enables the categorization tests that have been temporarily skipped.
1 parent 88615e4 commit 3bcfd48

7 files changed

Lines changed: 99 additions & 105 deletions

File tree

x-pack/test/api_integration/apis/ml/jobs/categorization_field_examples.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ export default ({ getService }: FtrProviderContext) => {
284284
},
285285
];
286286

287-
// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
288-
describe.skip('Categorization example endpoint - ', function () {
287+
describe('Categorization example endpoint - ', function () {
289288
before(async () => {
290289
await esArchiver.loadIfNeeded('ml/categorization');
291290
await ml.testResources.setKibanaTimeZoneToUTC();

x-pack/test/api_integration/apis/ml/modules/setup_module.ts

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -241,34 +241,33 @@ export default ({ getService }: FtrProviderContext) => {
241241
dashboards: [] as string[],
242242
},
243243
},
244-
// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
245-
// {
246-
// testTitleSuffix:
247-
// 'for logs_ui_categories with prefix, startDatafeed true and estimateModelMemory true',
248-
// sourceDataArchive: 'ml/module_logs',
249-
// indexPattern: { name: 'ft_module_logs', timeField: '@timestamp' },
250-
// module: 'logs_ui_categories',
251-
// user: USER.ML_POWERUSER,
252-
// requestBody: {
253-
// prefix: 'pf7_',
254-
// indexPatternName: 'ft_module_logs',
255-
// startDatafeed: true,
256-
// end: Date.now(),
257-
// },
258-
// expected: {
259-
// responseCode: 200,
260-
// jobs: [
261-
// {
262-
// jobId: 'pf7_log-entry-categories-count',
263-
// jobState: JOB_STATE.CLOSED,
264-
// datafeedState: DATAFEED_STATE.STOPPED,
265-
// },
266-
// ],
267-
// searches: [] as string[],
268-
// visualizations: [] as string[],
269-
// dashboards: [] as string[],
270-
// },
271-
// },
244+
{
245+
testTitleSuffix:
246+
'for logs_ui_categories with prefix, startDatafeed true and estimateModelMemory true',
247+
sourceDataArchive: 'ml/module_logs',
248+
indexPattern: { name: 'ft_module_logs', timeField: '@timestamp' },
249+
module: 'logs_ui_categories',
250+
user: USER.ML_POWERUSER,
251+
requestBody: {
252+
prefix: 'pf7_',
253+
indexPatternName: 'ft_module_logs',
254+
startDatafeed: true,
255+
end: Date.now(),
256+
},
257+
expected: {
258+
responseCode: 200,
259+
jobs: [
260+
{
261+
jobId: 'pf7_log-entry-categories-count',
262+
jobState: JOB_STATE.CLOSED,
263+
datafeedState: DATAFEED_STATE.STOPPED,
264+
},
265+
],
266+
searches: [] as string[],
267+
visualizations: [] as string[],
268+
dashboards: [] as string[],
269+
},
270+
},
272271
{
273272
testTitleSuffix: 'for nginx_ecs with prefix, startDatafeed true and estimateModelMemory true',
274273
sourceDataArchive: 'ml/module_nginx',

x-pack/test/api_integration/apis/ml/results/get_categorizer_stats.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ export default ({ getService }: FtrProviderContext) => {
5151
query: { bool: { must: [{ match_all: {} }] } },
5252
};
5353

54-
// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
55-
describe.skip('get categorizer_stats', function () {
54+
describe('get categorizer_stats', function () {
5655
before(async () => {
5756
await esArchiver.loadIfNeeded('ml/module_sample_logs');
5857
await ml.testResources.setKibanaTimeZoneToUTC();

x-pack/test/api_integration/apis/ml/results/get_stopped_partitions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ export default ({ getService }: FtrProviderContext) => {
8585

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

88-
// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
89-
describe.skip('get stopped_partitions', function () {
88+
describe('get stopped_partitions', function () {
9089
before(async () => {
9190
await esArchiver.loadIfNeeded('ml/module_sample_logs');
9291
await ml.testResources.setKibanaTimeZoneToUTC();

x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts

Lines changed: 66 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -149,73 +149,72 @@ export default function ({ getService }: FtrProviderContext) {
149149
},
150150
},
151151
},
152-
// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
153-
// {
154-
// suiteTitle: 'with categorization detector and default datafeed settings',
155-
// jobSource: 'ft_ecommerce',
156-
// jobId: `ec_advanced_2_${Date.now()}`,
157-
// get jobIdClone(): string {
158-
// return `${this.jobId}_clone`;
159-
// },
160-
// jobDescription:
161-
// 'Create advanced job from ft_ecommerce dataset with a categorization detector and default datafeed settings',
162-
// jobGroups: ['automated', 'ecommerce', 'advanced'],
163-
// get jobGroupsClone(): string[] {
164-
// return [...this.jobGroups, 'clone'];
165-
// },
166-
// pickFieldsConfig: {
167-
// categorizationField: 'products.product_name',
168-
// detectors: [
169-
// {
170-
// identifier: 'count by mlcategory',
171-
// function: 'count',
172-
// byField: 'mlcategory',
173-
// } as Detector,
174-
// ],
175-
// influencers: ['mlcategory'],
176-
// bucketSpan: '4h',
177-
// memoryLimit: '100mb',
178-
// } as PickFieldsConfig,
179-
// datafeedConfig: {} as DatafeedConfig,
180-
// expected: {
181-
// wizard: {
182-
// timeField: 'order_date',
183-
// },
184-
// row: {
185-
// recordCount: '4,675',
186-
// memoryStatus: 'ok',
187-
// jobState: 'closed',
188-
// datafeedState: 'stopped',
189-
// latestTimestamp: '2019-07-12 23:45:36',
190-
// },
191-
// counts: {
192-
// processed_record_count: '4,675',
193-
// processed_field_count: '4,675',
194-
// input_bytes: '354.2 KB',
195-
// input_field_count: '4,675',
196-
// invalid_date_count: '0',
197-
// missing_field_count: '0',
198-
// out_of_order_timestamp_count: '0',
199-
// empty_bucket_count: '0',
200-
// sparse_bucket_count: '0',
201-
// bucket_count: '185',
202-
// earliest_record_timestamp: '2019-06-12 00:04:19',
203-
// latest_record_timestamp: '2019-07-12 23:45:36',
204-
// input_record_count: '4,675',
205-
// latest_bucket_timestamp: '2019-07-12 20:00:00',
206-
// },
207-
// modelSizeStats: {
208-
// result_type: 'model_size_stats',
209-
// model_bytes_exceeded: '0.0 B',
210-
// // not checking total_by_field_count as the number of categories might change
211-
// total_over_field_count: '0',
212-
// total_partition_field_count: '2',
213-
// bucket_allocation_failures_count: '0',
214-
// memory_status: 'ok',
215-
// timestamp: '2019-07-12 16:00:00',
216-
// },
217-
// },
218-
// },
152+
{
153+
suiteTitle: 'with categorization detector and default datafeed settings',
154+
jobSource: 'ft_ecommerce',
155+
jobId: `ec_advanced_2_${Date.now()}`,
156+
get jobIdClone(): string {
157+
return `${this.jobId}_clone`;
158+
},
159+
jobDescription:
160+
'Create advanced job from ft_ecommerce dataset with a categorization detector and default datafeed settings',
161+
jobGroups: ['automated', 'ecommerce', 'advanced'],
162+
get jobGroupsClone(): string[] {
163+
return [...this.jobGroups, 'clone'];
164+
},
165+
pickFieldsConfig: {
166+
categorizationField: 'products.product_name',
167+
detectors: [
168+
{
169+
identifier: 'count by mlcategory',
170+
function: 'count',
171+
byField: 'mlcategory',
172+
} as Detector,
173+
],
174+
influencers: ['mlcategory'],
175+
bucketSpan: '4h',
176+
memoryLimit: '100mb',
177+
} as PickFieldsConfig,
178+
datafeedConfig: {} as DatafeedConfig,
179+
expected: {
180+
wizard: {
181+
timeField: 'order_date',
182+
},
183+
row: {
184+
recordCount: '4,675',
185+
memoryStatus: 'ok',
186+
jobState: 'closed',
187+
datafeedState: 'stopped',
188+
latestTimestamp: '2019-07-12 23:45:36',
189+
},
190+
counts: {
191+
processed_record_count: '4,675',
192+
processed_field_count: '4,675',
193+
input_bytes: '354.2 KB',
194+
input_field_count: '4,675',
195+
invalid_date_count: '0',
196+
missing_field_count: '0',
197+
out_of_order_timestamp_count: '0',
198+
empty_bucket_count: '0',
199+
sparse_bucket_count: '0',
200+
bucket_count: '185',
201+
earliest_record_timestamp: '2019-06-12 00:04:19',
202+
latest_record_timestamp: '2019-07-12 23:45:36',
203+
input_record_count: '4,675',
204+
latest_bucket_timestamp: '2019-07-12 20:00:00',
205+
},
206+
modelSizeStats: {
207+
result_type: 'model_size_stats',
208+
model_bytes_exceeded: '0.0 B',
209+
// not checking total_by_field_count as the number of categories might change
210+
total_over_field_count: '0',
211+
total_partition_field_count: '2',
212+
bucket_allocation_failures_count: '0',
213+
memory_status: 'ok',
214+
timestamp: '2019-07-12 16:00:00',
215+
},
216+
},
217+
},
219218
];
220219

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

x-pack/test/functional/apps/ml/anomaly_detection/categorization_job.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ export default function ({ getService }: FtrProviderContext) {
7474

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

77-
// skipping categorization tests, see https://github.com/elastic/kibana/issues/101056
78-
describe.skip('categorization', function () {
77+
describe('categorization', function () {
7978
this.tags(['mlqa']);
8079
before(async () => {
8180
await esArchiver.loadIfNeeded('ml/categorization');

x-pack/test/functional/services/ml/test_resources.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ export function MachineLearningTestResourcesProvider({ getService }: FtrProvider
534534
},
535535

536536
async installFleetPackage(packageIdentifier: string) {
537-
log.debug(`Installing Fleet package'${packageIdentifier}'`);
537+
log.debug(`Installing Fleet package '${packageIdentifier}'`);
538538

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

547547
async removeFleetPackage(packageIdentifier: string) {
548-
log.debug(`Removing Fleet package'${packageIdentifier}'`);
548+
log.debug(`Removing Fleet package '${packageIdentifier}'`);
549549

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

0 commit comments

Comments
 (0)