[ML] Functional tests - stabilize job row details validations (#64503)
This PR stabilizes the AD job row details check by only validating expected properties instead of the whole object.
This commit is contained in:
parent
6c98b2368b
commit
fe79979328
|
@ -195,7 +195,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
modelSizeStats: {
|
modelSizeStats: {
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '10.0 MB',
|
|
||||||
total_by_field_count: '37',
|
total_by_field_count: '37',
|
||||||
total_over_field_count: '92',
|
total_over_field_count: '92',
|
||||||
total_partition_field_count: '8',
|
total_partition_field_count: '8',
|
||||||
|
@ -262,7 +261,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
modelSizeStats: {
|
modelSizeStats: {
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '100.0 MB',
|
|
||||||
total_by_field_count: '994',
|
total_by_field_count: '994',
|
||||||
total_over_field_count: '0',
|
total_over_field_count: '0',
|
||||||
total_partition_field_count: '2',
|
total_partition_field_count: '2',
|
||||||
|
@ -549,7 +547,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
job_id: testData.jobId,
|
job_id: testData.jobId,
|
||||||
result_type: testData.expected.modelSizeStats.result_type,
|
result_type: testData.expected.modelSizeStats.result_type,
|
||||||
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
|
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
|
||||||
model_bytes_memory_limit: testData.expected.modelSizeStats.model_bytes_memory_limit,
|
|
||||||
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
|
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
|
||||||
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
|
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
|
||||||
total_partition_field_count:
|
total_partition_field_count:
|
||||||
|
@ -813,7 +810,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
job_id: testData.jobIdClone,
|
job_id: testData.jobIdClone,
|
||||||
result_type: testData.expected.modelSizeStats.result_type,
|
result_type: testData.expected.modelSizeStats.result_type,
|
||||||
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
|
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
|
||||||
model_bytes_memory_limit: testData.expected.modelSizeStats.model_bytes_memory_limit,
|
|
||||||
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
|
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
|
||||||
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
|
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
|
||||||
total_partition_field_count:
|
total_partition_field_count:
|
||||||
|
|
|
@ -64,7 +64,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
job_id: expectedJobId,
|
job_id: expectedJobId,
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '15.0 MB',
|
|
||||||
total_by_field_count: '30',
|
total_by_field_count: '30',
|
||||||
total_over_field_count: '0',
|
total_over_field_count: '0',
|
||||||
total_partition_field_count: '2',
|
total_partition_field_count: '2',
|
||||||
|
|
|
@ -153,7 +153,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
modelSizeStats: {
|
modelSizeStats: {
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '10.0 MB',
|
|
||||||
total_by_field_count: '3',
|
total_by_field_count: '3',
|
||||||
total_over_field_count: '0',
|
total_over_field_count: '0',
|
||||||
total_partition_field_count: '2',
|
total_partition_field_count: '2',
|
||||||
|
@ -422,7 +421,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
job_id: testData.jobId,
|
job_id: testData.jobId,
|
||||||
result_type: testData.expected.modelSizeStats.result_type,
|
result_type: testData.expected.modelSizeStats.result_type,
|
||||||
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
|
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
|
||||||
model_bytes_memory_limit: testData.expected.modelSizeStats.model_bytes_memory_limit,
|
|
||||||
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
|
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
|
||||||
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
|
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
|
||||||
total_partition_field_count:
|
total_partition_field_count:
|
||||||
|
|
|
@ -61,7 +61,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
job_id: expectedJobId,
|
job_id: expectedJobId,
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '20.0 MB',
|
|
||||||
total_by_field_count: '59',
|
total_by_field_count: '59',
|
||||||
total_over_field_count: '0',
|
total_over_field_count: '0',
|
||||||
total_partition_field_count: '58',
|
total_partition_field_count: '58',
|
||||||
|
|
|
@ -75,7 +75,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
job_id: expectedJobId,
|
job_id: expectedJobId,
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '8.0 MB',
|
|
||||||
total_by_field_count: '25',
|
total_by_field_count: '25',
|
||||||
total_over_field_count: '92',
|
total_over_field_count: '92',
|
||||||
total_partition_field_count: '3',
|
total_partition_field_count: '3',
|
||||||
|
|
|
@ -54,7 +54,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
modelSizeStats: {
|
modelSizeStats: {
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '20.0 MB',
|
|
||||||
total_by_field_count: '3',
|
total_by_field_count: '3',
|
||||||
total_over_field_count: '0',
|
total_over_field_count: '0',
|
||||||
total_partition_field_count: '2',
|
total_partition_field_count: '2',
|
||||||
|
@ -105,7 +104,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
modelSizeStats: {
|
modelSizeStats: {
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '20.0 MB',
|
|
||||||
total_by_field_count: '7',
|
total_by_field_count: '7',
|
||||||
total_over_field_count: '0',
|
total_over_field_count: '0',
|
||||||
total_partition_field_count: '6',
|
total_partition_field_count: '6',
|
||||||
|
@ -156,7 +154,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
modelSizeStats: {
|
modelSizeStats: {
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '20.0 MB',
|
|
||||||
total_by_field_count: '7',
|
total_by_field_count: '7',
|
||||||
total_over_field_count: '0',
|
total_over_field_count: '0',
|
||||||
total_partition_field_count: '6',
|
total_partition_field_count: '6',
|
||||||
|
@ -208,7 +205,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
modelSizeStats: {
|
modelSizeStats: {
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '20.0 MB',
|
|
||||||
total_by_field_count: '3',
|
total_by_field_count: '3',
|
||||||
total_over_field_count: '0',
|
total_over_field_count: '0',
|
||||||
total_partition_field_count: '2',
|
total_partition_field_count: '2',
|
||||||
|
@ -259,7 +255,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
modelSizeStats: {
|
modelSizeStats: {
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '20.0 MB',
|
|
||||||
total_by_field_count: '3',
|
total_by_field_count: '3',
|
||||||
total_over_field_count: '0',
|
total_over_field_count: '0',
|
||||||
total_partition_field_count: '2',
|
total_partition_field_count: '2',
|
||||||
|
@ -464,7 +459,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
job_id: testData.jobId,
|
job_id: testData.jobId,
|
||||||
result_type: testData.expected.modelSizeStats.result_type,
|
result_type: testData.expected.modelSizeStats.result_type,
|
||||||
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
|
model_bytes_exceeded: testData.expected.modelSizeStats.model_bytes_exceeded,
|
||||||
model_bytes_memory_limit: testData.expected.modelSizeStats.model_bytes_memory_limit,
|
|
||||||
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
|
total_by_field_count: testData.expected.modelSizeStats.total_by_field_count,
|
||||||
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
|
total_over_field_count: testData.expected.modelSizeStats.total_over_field_count,
|
||||||
total_partition_field_count:
|
total_partition_field_count:
|
||||||
|
|
|
@ -60,7 +60,6 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
job_id: expectedJobId,
|
job_id: expectedJobId,
|
||||||
result_type: 'model_size_stats',
|
result_type: 'model_size_stats',
|
||||||
model_bytes_exceeded: '0.0 B',
|
model_bytes_exceeded: '0.0 B',
|
||||||
model_bytes_memory_limit: '15.0 MB',
|
|
||||||
total_by_field_count: '3',
|
total_by_field_count: '3',
|
||||||
total_over_field_count: '0',
|
total_over_field_count: '0',
|
||||||
total_partition_field_count: '2',
|
total_partition_field_count: '2',
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default function({ getService }: FtrProviderContext) {
|
||||||
const ml = getService('ml');
|
const ml = getService('ml');
|
||||||
|
|
||||||
describe('page navigation', function() {
|
describe('page navigation', function() {
|
||||||
this.tags(['includeFirefox', 'mlqa']);
|
this.tags(['skipFirefox', 'mlqa']);
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await ml.api.cleanMlIndices();
|
await ml.api.cleanMlIndices();
|
||||||
await ml.securityUI.loginAsMlPowerUser();
|
await ml.securityUI.loginAsMlPowerUser();
|
||||||
|
|
|
@ -187,44 +187,24 @@ export function MachineLearningJobTableProvider({ getService }: FtrProviderConte
|
||||||
expectedCounts: object,
|
expectedCounts: object,
|
||||||
expectedModelSizeStats: object
|
expectedModelSizeStats: object
|
||||||
) {
|
) {
|
||||||
const countDetails = await this.parseJobCounts(jobId);
|
const { counts, modelSizeStats } = await this.parseJobCounts(jobId);
|
||||||
const counts = countDetails.counts;
|
|
||||||
|
|
||||||
// fields that have changing values are only validated
|
// Only check for expected keys / values, ignore additional properties
|
||||||
// to be present and then removed so they don't make
|
// This way the tests stay stable when new properties are added on the ES side
|
||||||
// the object validation fail
|
for (const [key, value] of Object.entries(expectedCounts)) {
|
||||||
expect(counts).to.have.property('last_data_time');
|
expect(counts)
|
||||||
delete counts.last_data_time;
|
.to.have.property(key)
|
||||||
|
.eql(value, `Expected counts property '${key}' to exist with value '${value}'`);
|
||||||
|
}
|
||||||
|
|
||||||
expect(counts).to.eql(expectedCounts);
|
for (const [key, value] of Object.entries(expectedModelSizeStats)) {
|
||||||
|
expect(modelSizeStats)
|
||||||
const modelSizeStats = countDetails.modelSizeStats;
|
.to.have.property(key)
|
||||||
|
.eql(
|
||||||
// fields that have changing values are only validated
|
value,
|
||||||
// to be present and then removed so they don't make
|
`Expected model size stats property '${key}' to exist with value '${value}')`
|
||||||
// the object validation fail
|
);
|
||||||
expect(modelSizeStats).to.have.property('log_time');
|
}
|
||||||
delete modelSizeStats.log_time;
|
|
||||||
expect(modelSizeStats).to.have.property('model_bytes');
|
|
||||||
delete modelSizeStats.model_bytes;
|
|
||||||
|
|
||||||
// remove categorization fields from validation until
|
|
||||||
// the ES version is updated
|
|
||||||
delete modelSizeStats.categorization_status;
|
|
||||||
delete modelSizeStats.categorized_doc_count;
|
|
||||||
delete modelSizeStats.dead_category_count;
|
|
||||||
delete modelSizeStats.frequent_category_count;
|
|
||||||
delete modelSizeStats.rare_category_count;
|
|
||||||
delete modelSizeStats.total_category_count;
|
|
||||||
|
|
||||||
// MML during clone has changed in #61589
|
|
||||||
// TODO: adjust test code to reflect the new behavior
|
|
||||||
expect(modelSizeStats).to.have.property('model_bytes_memory_limit');
|
|
||||||
delete modelSizeStats.model_bytes_memory_limit;
|
|
||||||
// @ts-ignore
|
|
||||||
delete expectedModelSizeStats.model_bytes_memory_limit;
|
|
||||||
|
|
||||||
expect(modelSizeStats).to.eql(expectedModelSizeStats);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async clickActionsMenu(jobId: string) {
|
public async clickActionsMenu(jobId: string) {
|
||||||
|
|
Loading…
Reference in a new issue