Skip to content

Commit

Permalink
[ML] fix url assertion (#66850)
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov authored May 18, 2020
1 parent 10ff9a9 commit a997d1f
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions x-pack/test/api_integration/apis/ml/job_validation/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { USER } from '../../../../functional/services/machine_learning/security_common';
import pkg from '../../../../../../package.json';

const COMMON_HEADERS = {
'kbn-xsrf': 'some-xsrf-token',
Expand Down Expand Up @@ -74,24 +75,22 @@ export default ({ getService }: FtrProviderContext) => {
heading: 'Job ID format is valid',
text:
'Lowercase alphanumeric (a-z and 0-9) characters, hyphens or underscores, starts and ends with an alphanumeric character, and is no more than 64 characters long.',
url:
'https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-job-resource.html#ml-job-resource',
url: `https://www.elastic.co/guide/en/elasticsearch/reference/${pkg.branch}/ml-job-resource.html#ml-job-resource`,
status: 'success',
},
{
id: 'detectors_function_not_empty',
heading: 'Detector functions',
text: 'Presence of detector functions validated in all detectors.',
url: 'https://www.elastic.co/guide/en/machine-learning/master/create-jobs.html#detectors',
url: `https://www.elastic.co/guide/en/machine-learning/${pkg.branch}/create-jobs.html#detectors`,
status: 'success',
},
{
id: 'success_bucket_span',
bucketSpan: '15m',
heading: 'Bucket span',
text: 'Format of "15m" is valid and passed validation checks.',
url:
'https://www.elastic.co/guide/en/machine-learning/master/create-jobs.html#bucket-span',
url: `https://www.elastic.co/guide/en/machine-learning/${pkg.branch}/create-jobs.html#bucket-span`,
status: 'success',
},
{
Expand All @@ -104,8 +103,7 @@ export default ({ getService }: FtrProviderContext) => {
id: 'success_mml',
heading: 'Model memory limit',
text: 'Valid and within the estimated model memory limit.',
url:
'https://www.elastic.co/guide/en/machine-learning/master/create-jobs.html#model-memory-limits',
url: `https://www.elastic.co/guide/en/machine-learning/${pkg.branch}/create-jobs.html#model-memory-limits`,
status: 'success',
},
]);
Expand Down Expand Up @@ -157,24 +155,22 @@ export default ({ getService }: FtrProviderContext) => {
id: 'job_id_invalid',
text:
'Job ID is invalid. It can contain lowercase alphanumeric (a-z and 0-9) characters, hyphens or underscores and must start and end with an alphanumeric character.',
url:
'https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-job-resource.html#ml-job-resource',
url: `https://www.elastic.co/guide/en/elasticsearch/reference/${pkg.branch}/ml-job-resource.html#ml-job-resource`,
status: 'error',
},
{
id: 'detectors_function_not_empty',
heading: 'Detector functions',
text: 'Presence of detector functions validated in all detectors.',
url: 'https://www.elastic.co/guide/en/machine-learning/master/create-jobs.html#detectors',
url: `https://www.elastic.co/guide/en/machine-learning/${pkg.branch}/create-jobs.html#detectors`,
status: 'success',
},
{
id: 'bucket_span_valid',
bucketSpan: '15m',
heading: 'Bucket span',
text: 'Format of "15m" is valid.',
url:
'https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-job-resource.html#ml-analysisconfig',
url: `https://www.elastic.co/guide/en/elasticsearch/reference/${pkg.branch}/ml-job-resource.html#ml-analysisconfig`,
status: 'success',
},
{
Expand Down Expand Up @@ -239,15 +235,14 @@ export default ({ getService }: FtrProviderContext) => {
heading: 'Job ID format is valid',
text:
'Lowercase alphanumeric (a-z and 0-9) characters, hyphens or underscores, starts and ends with an alphanumeric character, and is no more than 64 characters long.',
url:
'https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-job-resource.html#ml-job-resource',
url: `https://www.elastic.co/guide/en/elasticsearch/reference/${pkg.branch}/ml-job-resource.html#ml-job-resource`,
status: 'success',
},
{
id: 'detectors_function_not_empty',
heading: 'Detector functions',
text: 'Presence of detector functions validated in all detectors.',
url: 'https://www.elastic.co/guide/en/machine-learning/master/create-jobs.html#detectors',
url: `https://www.elastic.co/guide/en/machine-learning/${pkg.branch}/create-jobs.html#detectors`,
status: 'success',
},
{
Expand All @@ -262,17 +257,15 @@ export default ({ getService }: FtrProviderContext) => {
fieldName: 'order_id',
text:
'Cardinality of partition_field "order_id" is above 1000 and might result in high memory usage.',
url:
'https://www.elastic.co/guide/en/machine-learning/master/create-jobs.html#cardinality',
url: `https://www.elastic.co/guide/en/machine-learning/${pkg.branch}/create-jobs.html#cardinality`,
status: 'warning',
},
{
id: 'bucket_span_high',
heading: 'Bucket span',
text:
'Bucket span is 1 day or more. Be aware that days are considered as UTC days, not local days.',
url:
'https://www.elastic.co/guide/en/machine-learning/master/create-jobs.html#bucket-span',
url: `https://www.elastic.co/guide/en/machine-learning/${pkg.branch}/create-jobs.html#bucket-span`,
status: 'info',
},
{
Expand All @@ -287,16 +280,15 @@ export default ({ getService }: FtrProviderContext) => {
{
id: 'success_influencers',
text: 'Influencer configuration passed the validation checks.',
url: 'https://www.elastic.co/guide/en/machine-learning/master/ml-influencers.html',
url: `https://www.elastic.co/guide/en/machine-learning/${pkg.branch}/ml-influencers.html`,
status: 'success',
},
{
id: 'half_estimated_mml_greater_than_mml',
mml: '1MB',
text:
'The specified model memory limit is less than half of the estimated model memory limit and will likely hit the hard limit.',
url:
'https://www.elastic.co/guide/en/machine-learning/master/create-jobs.html#model-memory-limits',
url: `https://www.elastic.co/guide/en/machine-learning/${pkg.branch}/create-jobs.html#model-memory-limits`,
status: 'warning',
},
]);
Expand Down

0 comments on commit a997d1f

Please sign in to comment.