Skip to content

Commit

Permalink
[ML] Remove no longer needed code from jest tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Mar 15, 2021
1 parent 4dc08c6 commit 868af4e
Showing 1 changed file with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { IScopedClusterClient } from 'kibana/server';

import { validateJob, ValidateJobPayload } from './job_validation';
import { JobValidationMessage } from '../../../common/constants/messages';
import { HITS_TOTAL_RELATION } from '../../../common/types/es_client';
import type { MlClient } from '../../lib/ml_client';

Expand Down Expand Up @@ -277,7 +276,6 @@ describe('ML - validateJob', () => {
});
});

// Failing https://github.com/elastic/kibana/issues/65865
it('basic validation passes, extended checks return some messages', () => {
const payload = getBasicPayload();
return validateJob(mlClusterClient, mlClient, payload).then((messages) => {
Expand All @@ -291,7 +289,6 @@ describe('ML - validateJob', () => {
});
});

// Failing https://github.com/elastic/kibana/issues/65866
it('categorization job using mlcategory passes aggregatable field check', () => {
const payload: any = {
job: {
Expand Down Expand Up @@ -358,7 +355,6 @@ describe('ML - validateJob', () => {
});
});

// Failing https://github.com/elastic/kibana/issues/65867
it('script field not reported as non aggregatable', () => {
const payload: any = {
job: {
Expand Down Expand Up @@ -401,27 +397,4 @@ describe('ML - validateJob', () => {
]);
});
});

// the following two tests validate the correct template rendering of
// urls in messages with {{version}} in them to be replaced with the
// specified version. (defaulting to 'current')
const docsTestPayload = getBasicPayload() as any;
docsTestPayload.job.analysis_config.detectors = [{ function: 'count', by_field_name: 'airline' }];
it('creates a docs url pointing to the current docs version', () => {
return validateJob(mlClusterClient, mlClient, docsTestPayload).then((messages) => {
const message = messages[
messages.findIndex((m) => m.id === 'field_not_aggregatable')
] as JobValidationMessage;
expect(message.url!.search('/current/')).not.toBe(-1);
});
});

it('creates a docs url pointing to the master docs version', () => {
return validateJob(mlClusterClient, mlClient, docsTestPayload, 'master').then((messages) => {
const message = messages[
messages.findIndex((m) => m.id === 'field_not_aggregatable')
] as JobValidationMessage;
expect(message.url!.search('/master/')).not.toBe(-1);
});
});
});

0 comments on commit 868af4e

Please sign in to comment.