[ML] Enable transform health rule API tests (#181147)

## Summary

Closes https://github.com/elastic/kibana/issues/177215

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
This commit is contained in:
Dima Arnautov 2024-04-22 09:49:57 +02:00 committed by GitHub
parent 14f2d95fd0
commit be1248ac98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,8 +80,7 @@ export default function ruleTests({ getService }: FtrProviderContext) {
`.internal.alerts-transform.health.alerts-default-000001`
);
// FLAKY: https://github.com/elastic/kibana/issues/177215
describe.skip('rule', async () => {
describe('rule', async () => {
const objectRemover = new ObjectRemover(supertest);
let connectorId: string;
const transformId = 'test_transform_01';
@ -134,9 +133,12 @@ export default function ruleTests({ getService }: FtrProviderContext) {
const aadDocs = await getAllAADDocs(1);
const alertDoc = aadDocs.body.hits.hits[0]._source;
expect(alertDoc[ALERT_REASON]).to.be(`Transform test_transform_01 is not started.`);
expect(alertDoc[TRANSFORM_HEALTH_RESULTS]).to.eql([
{ transform_id: 'test_transform_01', transform_state: 'stopped', health_status: 'green' },
]);
const transformHealthResult = alertDoc[TRANSFORM_HEALTH_RESULTS][0];
expect(transformHealthResult.transform_id).to.be('test_transform_01');
expect(transformHealthResult.transform_state).to.match(/stopped|stopping/);
expect(transformHealthResult.health_status).to.be('green');
expect(alertDoc[ALERT_RULE_CATEGORY]).to.be(`Transform health`);
expect(alertDoc[ALERT_RULE_NAME]).to.be(`Test all transforms`);
expect(alertDoc[ALERT_RULE_TYPE_ID]).to.be(`transform_health`);