Skip to content

[Synthetics] Migrate synthetics alerting API tests to deployment agnostic solution#221139

Merged
cesco-f merged 9 commits intoelastic:mainfrom
cesco-f:migrate-synthetics-tests
May 29, 2025
Merged

[Synthetics] Migrate synthetics alerting API tests to deployment agnostic solution#221139
cesco-f merged 9 commits intoelastic:mainfrom
cesco-f:migrate-synthetics-tests

Conversation

@cesco-f
Copy link
Contributor

@cesco-f cesco-f commented May 21, 2025

This PR closes #212954.

Synthetics alerting API tests have been migrated to deployment agnostic solution.

Serverless

node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts

node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --grep="Synthetics Alerting"

Stateful

node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts

node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts --grep="Synthetics Alerting"

@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label May 21, 2025
@cesco-f cesco-f force-pushed the migrate-synthetics-tests branch from 7af4b85 to 77d7f05 Compare May 22, 2025 10:08
@cesco-f cesco-f added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v8.19.0 labels May 22, 2025
@cesco-f cesco-f force-pushed the migrate-synthetics-tests branch 2 times, most recently from 77d7f05 to db0c5cb Compare May 22, 2025 11:14
@cesco-f cesco-f marked this pull request as ready for review May 22, 2025 11:14
@cesco-f cesco-f requested review from a team as code owners May 22, 2025 11:14
Copy link
Contributor

@wayneseymour wayneseymour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed files owned by my team:

  1. x-pack/test/api_integration/deployment_agnostic/default_configs/serverless.config.base.ts
  2. x-pack/test/api_integration/deployment_agnostic/default_configs/stateful.config.base.ts
  3. x-pack/test/api_integration/deployment_agnostic/services/alerting_api.ts

CR only, LGTM, as long as the tests pass, specifically I'm curious about the bool filter added to the alerting api. But again, if the tests pass, I'm good with it.

@cesco-f
Copy link
Contributor Author

cesco-f commented May 22, 2025

Reviewed files owned by my team:

  1. x-pack/test/api_integration/deployment_agnostic/default_configs/serverless.config.base.ts
  2. x-pack/test/api_integration/deployment_agnostic/default_configs/stateful.config.base.ts
  3. x-pack/test/api_integration/deployment_agnostic/services/alerting_api.ts

CR only, LGTM, as long as the tests pass, specifically I'm curious about the bool filter added to the alerting api. But again, if the tests pass, I'm good with it.

In the current implementation of waitForAlertInIndex in the alerting api we can only query the alert by rule id.
There are some tests in Synthetics that are passing additional filters, for example to retrieve only recovered alerts. @wayneseymour

@cesco-f cesco-f force-pushed the migrate-synthetics-tests branch 5 times, most recently from 47893c3 to e6a28bb Compare May 23, 2025 13:55
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/test-suites-xpack 709 707 -2

Total ESLint disabled count

id before after diff
@kbn/test-suites-xpack 731 729 -2

History

@cesco-f cesco-f force-pushed the migrate-synthetics-tests branch from e6a28bb to 9e23dd7 Compare May 26, 2025 06:17
@cesco-f cesco-f force-pushed the migrate-synthetics-tests branch 2 times, most recently from 24e27f4 to f98245c Compare May 26, 2025 08:08
@cesco-f cesco-f added ci:project-deploy-observability Create an Observability project and removed ci:build-serverless-image labels May 26, 2025
@cesco-f cesco-f force-pushed the migrate-synthetics-tests branch from f98245c to ad30646 Compare May 26, 2025 13:21
@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@cesco-f cesco-f force-pushed the migrate-synthetics-tests branch from ad30646 to dc8d196 Compare May 27, 2025 09:31
@elasticmachine
Copy link
Contributor

elasticmachine commented May 29, 2025

💚 Build Succeeded

  • Buildkite Build
  • Commit: b13f203
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-221139-b13f203884ec

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/test-suites-xpack 709 707 -2

Total ESLint disabled count

id before after diff
@kbn/test-suites-xpack 731 729 -2

History

logger: this.logger,
indexName: '.internal.alerts-observability.uptime.alerts-default*',
retryDelay: 1000,
indexName: '.alerts-observability.uptime.alerts-default*',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason why .internal.alerts-observability.uptime.alerts-default was changed to '.alerts-observability.uptime.alerts-default*'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently in stateful the index is .internal.alerts-observability.uptime.alerts-default while in serverless is .ds-.alerts-observability.uptime.alerts-default, so I'm using the alias as suggested by @kdelemme and it works for both environments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explanation!

Copy link
Contributor

@mgiota mgiota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cesco-f Great work! I ran tests locally for both serverless and stateful configurations and everything works fine!

Serverless

Serverless

Stateful
Stateful

@mgiota
Copy link
Contributor

mgiota commented May 29, 2025

I'm curious about the bool filter added to the alerting api

I had similar question, but as long as tests are happy with it, I am happy as well! And yep it makes sense to change it like this, since Synthetics passes additional filters

],
});
expect(recoveredResponse.hits.hits[1]._source).property(
expect(recoveredResponse.hits.hits[0]._source).property(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering why hits[1] was changed to hits[0]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was flaky because we were fetching all the alerts and assuming that the recovered alert was in position 1. But this was not always the case (no idea why) and sometimes it was failing.

So I changed the test to fetch only the recovered alerts, I'm expecting to get only 1 result and so that's why it was changed to hits[0].

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok makes sense! Good job!

@cesco-f cesco-f merged commit fdebd18 into elastic:main May 29, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15321651132

@cesco-f cesco-f deleted the migrate-synthetics-tests branch May 29, 2025 10:20
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Deployment Agnostic] Adding registryUrl configuration for DA tests (#221628)

Manual backport

To create the backport manually run:

node scripts/backport --pr 221139

Questions ?

Please refer to the Backport tool documentation

@cesco-f
Copy link
Contributor Author

cesco-f commented May 29, 2025

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…stic solution (elastic#221139)

This PR closes elastic#212954.

Synthetics alerting API tests have been migrated to deployment agnostic
solution.

### Serverless
```
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts

node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --grep="Synthetics Alerting"
```

### Stateful
```
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts

node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts --grep="Synthetics Alerting"
```
cesco-f added a commit that referenced this pull request May 29, 2025
…nt agnostic solution (#221139) (#221908)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Synthetics] Migrate synthetics alerting API tests to deployment
agnostic solution
(#221139)](#221139)

<!--- Backport version: 10.0.0 -->

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

<!--BACKPORT [{"author":{"name":"Francesco
Fagnani","email":"fagnani.francesco@gmail.com"},"sourceCommit":{"committedDate":"2025-05-29T10:18:52Z","message":"[Synthetics]
Migrate synthetics alerting API tests to deployment agnostic solution
(#221139)\n\nThis PR closes #212954.\n\nSynthetics alerting API tests
have been migrated to deployment agnostic\nsolution.\n\n###
Serverless\n```\nnode scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts\n\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
--grep=\"Synthetics Alerting\"\n```\n\n### Stateful\n```\nnode
scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts\n\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
--grep=\"Synthetics
Alerting\"\n```","sha":"fdebd18bfd5b525d69d4a53911c84d7e2843d01b","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0","author:obs-ux-management"],"title":"[Synthetics]
Migrate synthetics alerting API tests to deployment agnostic
solution","number":221139,"url":"https://github.com/elastic/kibana/pull/221139","mergeCommit":{"message":"[Synthetics]
Migrate synthetics alerting API tests to deployment agnostic solution
(#221139)\n\nThis PR closes #212954.\n\nSynthetics alerting API tests
have been migrated to deployment agnostic\nsolution.\n\n###
Serverless\n```\nnode scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts\n\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
--grep=\"Synthetics Alerting\"\n```\n\n### Stateful\n```\nnode
scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts\n\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
--grep=\"Synthetics
Alerting\"\n```","sha":"fdebd18bfd5b525d69d4a53911c84d7e2843d01b"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/221139","number":221139,"mergeCommit":{"message":"[Synthetics]
Migrate synthetics alerting API tests to deployment agnostic solution
(#221139)\n\nThis PR closes #212954.\n\nSynthetics alerting API tests
have been migrated to deployment agnostic\nsolution.\n\n###
Serverless\n```\nnode scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts\n\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
--grep=\"Synthetics Alerting\"\n```\n\n### Stateful\n```\nnode
scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts\n\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
--grep=\"Synthetics
Alerting\"\n```","sha":"fdebd18bfd5b525d69d4a53911c84d7e2843d01b"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
dmlemeshko added a commit that referenced this pull request Jun 4, 2025
Relocating tests added in #221139 into separate feature flag configs,
that are not run on MKI but only Kibana CI.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
zacharyparikh pushed a commit to zacharyparikh/kibana that referenced this pull request Jun 4, 2025
…stic solution (elastic#221139)

This PR closes elastic#212954.

Synthetics alerting API tests have been migrated to deployment agnostic
solution.

### Serverless
```
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts

node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --grep="Synthetics Alerting"
```

### Stateful
```
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts

node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts --grep="Synthetics Alerting"
```
zacharyparikh pushed a commit to zacharyparikh/kibana that referenced this pull request Jun 4, 2025
…c#222371)

Relocating tests added in elastic#221139 into separate feature flag configs,
that are not run on MKI but only Kibana CI.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Jun 12, 2025
…stic solution (elastic#221139)

This PR closes elastic#212954.

Synthetics alerting API tests have been migrated to deployment agnostic
solution.

### Serverless
```
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts

node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --grep="Synthetics Alerting"
```

### Stateful
```
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts

node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts --grep="Synthetics Alerting"
```
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Jun 12, 2025
…c#222371)

Relocating tests added in elastic#221139 into separate feature flag configs,
that are not run on MKI but only Kibana CI.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
pheyos added a commit that referenced this pull request Jun 20, 2025
…222371) (#224588)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[FTR] add feature flags configs for deployment-agnostic tests
(#222371)](#222371)

Also cherry-picked a few required changes from #218725 which was not
backported.

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2025-06-04T13:57:03Z","message":"[FTR]
add feature flags configs for deployment-agnostic tests
(#222371)\n\nRelocating tests added in #221139 into separate feature
flag configs,\nthat are not run on MKI but only Kibana
CI.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"966f73481d6cfb25c59f363149e302b9b9fa40a2","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","backport:version","v9.1.0","v8.19.0"],"title":"[FTR] add
feature flags configs for deployment-agnostic
tests","number":222371,"url":"https://github.com/elastic/kibana/pull/222371","mergeCommit":{"message":"[FTR]
add feature flags configs for deployment-agnostic tests
(#222371)\n\nRelocating tests added in #221139 into separate feature
flag configs,\nthat are not run on MKI but only Kibana
CI.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"966f73481d6cfb25c59f363149e302b9b9fa40a2"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222371","number":222371,"mergeCommit":{"message":"[FTR]
add feature flags configs for deployment-agnostic tests
(#222371)\n\nRelocating tests added in #221139 into separate feature
flag configs,\nthat are not run on MKI but only Kibana
CI.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"966f73481d6cfb25c59f363149e302b9b9fa40a2"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:obs-ux-management PRs authored by the obs ux management team backport:version Backport to applied version labels ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Synthetics Synthetics Alerting API integration tests to deployment agnostic solution

6 participants