Skip to content

Commit

Permalink
[8.14] [ML] Enable transform health rule API tests (#181147) (#181293)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.14`:
- [[ML] Enable transform health rule API tests
(#181147)](#181147)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-04-22T07:49:57Z","message":"[ML]
Enable transform health rule API tests (#181147)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/177215\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"be1248ac98c154fee230d621d22d5af36df20318","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Embedding",":ml","test_api","release_note:skip","Feature:Transforms","Feature:Alerting/RuleTypes","Team:ML","v8.14.0","v8.15.0"],"number":181147,"url":"https://github.com/elastic/kibana/pull/181147","mergeCommit":{"message":"[ML]
Enable transform health rule API tests (#181147)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/177215\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"be1248ac98c154fee230d621d22d5af36df20318"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","labelRegex":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/181147","number":181147,"mergeCommit":{"message":"[ML]
Enable transform health rule API tests (#181147)\n\n##
Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/177215\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests
changed","sha":"be1248ac98c154fee230d621d22d5af36df20318"}}]}]
BACKPORT-->
  • Loading branch information
darnautov authored Apr 22, 2024
1 parent fe4620f commit 339ed39
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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`);
Expand Down

0 comments on commit 339ed39

Please sign in to comment.