[ML] Functional tests - remove by_field_count check for categorization jobs (#72033)

This PR removes the validation of `total_by_field_count` for categorization jobs because the number of detected categories is not necessarily stable across analytics changes.
This commit is contained in:
Robert Oskamp 2020-07-16 15:21:35 +02:00 committed by GitHub
parent b167d77e3e
commit 35e1dd6522
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 120 deletions

View file

@ -261,7 +261,7 @@ export default function ({ getService }: FtrProviderContext) {
modelSizeStats: {
result_type: 'model_size_stats',
model_bytes_exceeded: '0.0 B',
total_by_field_count: '994',
// 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',
@ -274,8 +274,7 @@ export default function ({ getService }: FtrProviderContext) {
const calendarId = `wizard-test-calendar_${Date.now()}`;
// FLAKY: https://github.com/elastic/kibana/issues/71971
describe.skip('advanced job', function () {
describe('advanced job', function () {
this.tags(['mlqa']);
before(async () => {
await esArchiver.loadIfNeeded('ml/ecommerce');
@ -518,44 +517,18 @@ export default function ({ getService }: FtrProviderContext) {
id: testData.jobId,
description: testData.jobDescription,
jobGroups: [...new Set(testData.jobGroups)].sort(),
recordCount: testData.expected.row.recordCount,
memoryStatus: testData.expected.row.memoryStatus,
jobState: testData.expected.row.jobState,
datafeedState: testData.expected.row.datafeedState,
latestTimestamp: testData.expected.row.latestTimestamp,
...testData.expected.row,
});
await ml.jobTable.assertJobRowDetailsCounts(
testData.jobId,
{
job_id: testData.jobId,
processed_record_count: testData.expected.counts.processed_record_count,
processed_field_count: testData.expected.counts.processed_field_count,
input_bytes: testData.expected.counts.input_bytes,
input_field_count: testData.expected.counts.input_field_count,
invalid_date_count: testData.expected.counts.invalid_date_count,
missing_field_count: testData.expected.counts.missing_field_count,
out_of_order_timestamp_count: testData.expected.counts.out_of_order_timestamp_count,
empty_bucket_count: testData.expected.counts.empty_bucket_count,
sparse_bucket_count: testData.expected.counts.sparse_bucket_count,
bucket_count: testData.expected.counts.bucket_count,
earliest_record_timestamp: testData.expected.counts.earliest_record_timestamp,
latest_record_timestamp: testData.expected.counts.latest_record_timestamp,
input_record_count: testData.expected.counts.input_record_count,
latest_bucket_timestamp: testData.expected.counts.latest_bucket_timestamp,
...testData.expected.counts,
},
{
job_id: testData.jobId,
result_type: testData.expected.modelSizeStats.result_type,
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
total_partition_field_count:
testData.expected.modelSizeStats.total_partition_field_count,
bucket_allocation_failures_count:
testData.expected.modelSizeStats.bucket_allocation_failures_count,
memory_status: testData.expected.modelSizeStats.memory_status,
timestamp: testData.expected.modelSizeStats.timestamp,
...testData.expected.modelSizeStats,
}
);
});
@ -781,44 +754,18 @@ export default function ({ getService }: FtrProviderContext) {
id: testData.jobIdClone,
description: testData.jobDescription,
jobGroups: [...new Set(testData.jobGroupsClone)].sort(),
recordCount: testData.expected.row.recordCount,
memoryStatus: testData.expected.row.memoryStatus,
jobState: testData.expected.row.jobState,
datafeedState: testData.expected.row.datafeedState,
latestTimestamp: testData.expected.row.latestTimestamp,
...testData.expected.row,
});
await ml.jobTable.assertJobRowDetailsCounts(
testData.jobIdClone,
{
job_id: testData.jobIdClone,
processed_record_count: testData.expected.counts.processed_record_count,
processed_field_count: testData.expected.counts.processed_field_count,
input_bytes: testData.expected.counts.input_bytes,
input_field_count: testData.expected.counts.input_field_count,
invalid_date_count: testData.expected.counts.invalid_date_count,
missing_field_count: testData.expected.counts.missing_field_count,
out_of_order_timestamp_count: testData.expected.counts.out_of_order_timestamp_count,
empty_bucket_count: testData.expected.counts.empty_bucket_count,
sparse_bucket_count: testData.expected.counts.sparse_bucket_count,
bucket_count: testData.expected.counts.bucket_count,
earliest_record_timestamp: testData.expected.counts.earliest_record_timestamp,
latest_record_timestamp: testData.expected.counts.latest_record_timestamp,
input_record_count: testData.expected.counts.input_record_count,
latest_bucket_timestamp: testData.expected.counts.latest_bucket_timestamp,
...testData.expected.counts,
},
{
job_id: testData.jobIdClone,
result_type: testData.expected.modelSizeStats.result_type,
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
total_partition_field_count:
testData.expected.modelSizeStats.total_partition_field_count,
bucket_allocation_failures_count:
testData.expected.modelSizeStats.bucket_allocation_failures_count,
memory_status: testData.expected.modelSizeStats.memory_status,
timestamp: testData.expected.modelSizeStats.timestamp,
...testData.expected.modelSizeStats,
}
);
});

View file

@ -64,7 +64,7 @@ export default function ({ getService }: FtrProviderContext) {
job_id: expectedJobId,
result_type: 'model_size_stats',
model_bytes_exceeded: '0.0 B',
total_by_field_count: '30',
// 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',

View file

@ -391,44 +391,18 @@ export default function ({ getService }: FtrProviderContext) {
id: testData.jobId,
description: testData.jobDescription,
jobGroups: [...new Set(testData.jobGroups)].sort(),
recordCount: testData.expected.row.recordCount,
memoryStatus: testData.expected.row.memoryStatus,
jobState: testData.expected.row.jobState,
datafeedState: testData.expected.row.datafeedState,
latestTimestamp: testData.expected.row.latestTimestamp,
...testData.expected.row,
});
await ml.jobTable.assertJobRowDetailsCounts(
testData.jobId,
{
job_id: testData.jobId,
processed_record_count: testData.expected.counts.processed_record_count,
processed_field_count: testData.expected.counts.processed_field_count,
input_bytes: testData.expected.counts.input_bytes,
input_field_count: testData.expected.counts.input_field_count,
invalid_date_count: testData.expected.counts.invalid_date_count,
missing_field_count: testData.expected.counts.missing_field_count,
out_of_order_timestamp_count: testData.expected.counts.out_of_order_timestamp_count,
empty_bucket_count: testData.expected.counts.empty_bucket_count,
sparse_bucket_count: testData.expected.counts.sparse_bucket_count,
bucket_count: testData.expected.counts.bucket_count,
earliest_record_timestamp: testData.expected.counts.earliest_record_timestamp,
latest_record_timestamp: testData.expected.counts.latest_record_timestamp,
input_record_count: testData.expected.counts.input_record_count,
latest_bucket_timestamp: testData.expected.counts.latest_bucket_timestamp,
...testData.expected.counts,
},
{
job_id: testData.jobId,
result_type: testData.expected.modelSizeStats.result_type,
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
total_partition_field_count:
testData.expected.modelSizeStats.total_partition_field_count,
bucket_allocation_failures_count:
testData.expected.modelSizeStats.bucket_allocation_failures_count,
memory_status: testData.expected.modelSizeStats.memory_status,
timestamp: testData.expected.modelSizeStats.timestamp,
...testData.expected.modelSizeStats,
}
);
});

View file

@ -429,44 +429,18 @@ export default function ({ getService }: FtrProviderContext) {
id: testData.jobId,
description: testData.jobDescription,
jobGroups: [...new Set(testData.jobGroups)].sort(),
recordCount: testData.expected.row.recordCount,
memoryStatus: testData.expected.row.memoryStatus,
jobState: testData.expected.row.jobState,
datafeedState: testData.expected.row.datafeedState,
latestTimestamp: testData.expected.row.latestTimestamp,
...testData.expected.row,
});
await ml.jobTable.assertJobRowDetailsCounts(
testData.jobId,
{
job_id: testData.jobId,
processed_record_count: testData.expected.counts.processed_record_count,
processed_field_count: testData.expected.counts.processed_field_count,
input_bytes: testData.expected.counts.input_bytes,
input_field_count: testData.expected.counts.input_field_count,
invalid_date_count: testData.expected.counts.invalid_date_count,
missing_field_count: testData.expected.counts.missing_field_count,
out_of_order_timestamp_count: testData.expected.counts.out_of_order_timestamp_count,
empty_bucket_count: testData.expected.counts.empty_bucket_count,
sparse_bucket_count: testData.expected.counts.sparse_bucket_count,
bucket_count: testData.expected.counts.bucket_count,
earliest_record_timestamp: testData.expected.counts.earliest_record_timestamp,
latest_record_timestamp: testData.expected.counts.latest_record_timestamp,
input_record_count: testData.expected.counts.input_record_count,
latest_bucket_timestamp: testData.expected.counts.latest_bucket_timestamp,
...testData.expected.counts,
},
{
job_id: testData.jobId,
result_type: testData.expected.modelSizeStats.result_type,
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
total_partition_field_count:
testData.expected.modelSizeStats.total_partition_field_count,
bucket_allocation_failures_count:
testData.expected.modelSizeStats.bucket_allocation_failures_count,
memory_status: testData.expected.modelSizeStats.memory_status,
timestamp: testData.expected.modelSizeStats.timestamp,
...testData.expected.modelSizeStats,
}
);
});