Skip to content

Commit

Permalink
[ML] tests
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed May 12, 2020
1 parent 3c86922 commit a4e75f7
Show file tree
Hide file tree
Showing 4 changed files with 396 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function validateBucketSpan(
}

const messages = [];
const parsedBucketSpan = parseInterval(job.analysis_config.bucket_span, false);
const parsedBucketSpan = parseInterval(job.analysis_config.bucket_span);
if (parsedBucketSpan === null || parsedBucketSpan.asMilliseconds() === 0) {
messages.push({ id: 'bucket_span_invalid' });
return messages;
Expand Down
6 changes: 3 additions & 3 deletions x-pack/test/api_integration/apis/ml/anomaly_detectors/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(body.count).to.eql(2);
expect(body.jobs.length).to.eql(2);
expect(body.jobs[0].job_id).to.eql(`${jobId}_1`);
expect(body.jobs[0]).to.keys(
expect(body.jobs[0]).to.have.keys(
'timing_stats',
'state',
'forecasts_stats',
Expand Down Expand Up @@ -178,7 +178,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(body.count).to.eql(1);
expect(body.jobs.length).to.eql(1);
expect(body.jobs[0].job_id).to.eql(`${jobId}_1`);
expect(body.jobs[0]).to.keys(
expect(body.jobs[0]).to.have.keys(
'timing_stats',
'state',
'forecasts_stats',
Expand All @@ -197,7 +197,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(body.count).to.eql(2);
expect(body.jobs.length).to.eql(2);
expect(body.jobs[0].job_id).to.eql(`${jobId}_1`);
expect(body.jobs[0]).to.keys(
expect(body.jobs[0]).to.have.keys(
'timing_stats',
'state',
'forecasts_stats',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export default function({ loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./bucket_span_estimator'));
loadTestFile(require.resolve('./calculate_model_memory_limit'));
loadTestFile(require.resolve('./cardinality'));
loadTestFile(require.resolve('./validate'));
});
}
Loading

0 comments on commit a4e75f7

Please sign in to comment.