[ML] Omit mml success message when mml checks are not run. (#18659)

Updates the behaviour of the job validation's model memory limit checks: The success messages success_mml gets only returned if the checks were actually run. This omits the success message for example in the single metric and population wizard.
This commit is contained in:
Walter Rafelsberger 2018-05-02 10:35:12 +02:00 committed by GitHub
parent d6e2464ff0
commit 92f05ee9b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View file

@ -285,8 +285,7 @@ describe('ML - validateJob', () => {
'job_id_valid',
'detectors_function_not_empty',
'index_fields_valid',
'time_field_invalid',
'success_mml'
'time_field_invalid'
]);
}
);

View file

@ -103,7 +103,7 @@ describe('ML - validateModelMemoryLimit', () => {
return validateModelMemoryLimit(callWithRequest, job, duration).then(
(messages) => {
const ids = messages.map(m => m.id);
expect(ids).to.eql(['success_mml']);
expect(ids).to.eql([]);
}
);
});

View file

@ -120,7 +120,7 @@ export async function validateModelMemoryLimit(callWithRequest, job, duration) {
}
}
if (messages.length === 0) {
if (messages.length === 0 && runCalcModelMemoryTest === true) {
messages.push({ id: 'success_mml' });
}