Skip to content

Commit

Permalink
[ML] Fix after all hook for Notifications tests (elastic#142711)
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov authored and WafaaNasr committed Oct 14, 2022
1 parent be7c18e commit a71e1e2
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const ml = getService('ml');
const browser = getService('browser');

// Failing: See https://github.com/elastic/kibana/issues/142248
describe.skip('Notifications list', function () {
const configs = [
{ jobId: 'fq_001', spaceId: undefined },
{ jobId: 'fq_002', spaceId: 'space1' },
];

describe('Notifications list', function () {
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp');
await ml.testResources.setKibanaTimeZoneToUTC();

// Prepare jobs to generate notifications
await Promise.all(
[
{ jobId: 'fq_001', spaceId: undefined },
{ jobId: 'fq_002', spaceId: 'space1' },
].map(async (v) => {
configs.map(async (v) => {
const datafeedConfig = ml.commonConfig.getADFqDatafeedConfig(v.jobId);

await ml.api.createAnomalyDetectionJob(
Expand All @@ -45,7 +46,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});

after(async () => {
await ml.api.cleanMlIndices();
for (const { jobId } of configs) {
await ml.api.deleteAnomalyDetectionJobES(jobId);
}
await ml.testResources.cleanMLSavedObjects();
await ml.testResources.deleteIndexPatternByTitle('ft_farequote');
});
Expand Down

0 comments on commit a71e1e2

Please sign in to comment.