Skip to content

Migrate /diagnostics and /service_nodes to be deployment agnostic#199645

Merged
miloszmarcinkowski merged 16 commits intoelastic:mainfrom
miloszmarcinkowski:198967-apm-migrate-testapm_api_integrationtestsdiagnostics-to-be-deployment-agnostic-api-tests
Nov 14, 2024
Merged

Migrate /diagnostics and /service_nodes to be deployment agnostic#199645
miloszmarcinkowski merged 16 commits intoelastic:mainfrom
miloszmarcinkowski:198967-apm-migrate-testapm_api_integrationtestsdiagnostics-to-be-deployment-agnostic-api-tests

Conversation

@miloszmarcinkowski
Copy link
Copy Markdown
Contributor

@miloszmarcinkowski miloszmarcinkowski commented Nov 11, 2024

closes #198967
closes #198985
part of #193245

How to test

  • 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="APM"
  • 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="APM"

Checklist

  • (OPTIONAL, only if a test has been unskipped) Run flaky test suite
  • serverless
  • stateful
  • MKI

@miloszmarcinkowski miloszmarcinkowski added backport:prev-minor release_note:skip Skip the PR/issue when compiling release notes labels Nov 11, 2024
…testapm_api_integrationtestsdiagnostics-to-be-deployment-agnostic-api-tests
…testapm_api_integrationtestsdiagnostics-to-be-deployment-agnostic-api-tests
…testapm_api_integrationtestsdiagnostics-to-be-deployment-agnostic-api-tests
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7390

[✅] x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts: 25/25 tests passed.
[✅] x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts: 25/25 tests passed.

see run history

…nodes-to-be-deployment-agnostic-api-tests' into 198967-apm-migrate-testapm_api_integrationtestsdiagnostics-to-be-deployment-agnostic-api-tests
@miloszmarcinkowski miloszmarcinkowski marked this pull request as ready for review November 13, 2024 13:11
@miloszmarcinkowski miloszmarcinkowski requested a review from a team as a code owner November 13, 2024 13:11
@miloszmarcinkowski miloszmarcinkowski requested a review from a team November 13, 2024 13:11
})
);

const apmTemplateNames = uniqueTemplateNames.filter((templateName) =>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We filter out only apm and otel index templates for the test, otherwise they differ on serverless and test fails

@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. labels Nov 13, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@github-actions
Copy link
Copy Markdown
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!)

const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1;

describe.skip('Diagnostics: Index pattern settings', () => {
describe('When there is no data', () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When default index templates are deleted, they get recreated automatically. It was introduced here: elastic/elasticsearch#97546

This means we can't perform check against empty response anymore.

const end = new Date('2021-01-01T00:15:00.000Z').getTime() - 1;

describe.skip('Diagnostics: Index Templates', () => {
describe('When there is no data', () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When default index templates are deleted, they get recreated automatically. Introduced here: elastic/elasticsearch#97546

This means we can't perform check against empty response anymore.

@miloszmarcinkowski miloszmarcinkowski changed the title Migrate /test/apm_api_integration/tests/diagnostics to be deployment agnostic Migrate /diagnostics and /service_nodes to be deployment agnostic Nov 13, 2024
Copy link
Copy Markdown
Contributor

@rmyz rmyz left a comment

Choose a reason for hiding this comment

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

LGTM, small change requested

Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
…stsdiagnostics-to-be-deployment-agnostic-api-tests
@miloszmarcinkowski miloszmarcinkowski enabled auto-merge (squash) November 14, 2024 09:34
import { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api';
import { sumBy } from 'lodash';
import { FtrProviderContext } from '../../common/ftr_provider_context';
import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit.

Suggested change
import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace';
import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated all /apm/* tests by adding type-only imports.

Comment on lines +50 to +52
const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient;
const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion();
await apmSynthtraceKibanaClient.installApmPackage(latestVersion);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

createApmSynthtraceEsClient already installs the latest apm package version. Why is this needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for review. Those were remainings from the old test and I didn't notice that apm packge is installed in createApmSynthtraceEsClient. Updated!

Comment on lines +27 to +29
const apmSynthtraceKibanaClient = synthtrace.apmSynthtraceKibanaClient;
const latestVersion = await apmSynthtraceKibanaClient.fetchLatestApmPackageVersion();
await apmSynthtraceKibanaClient.installApmPackage(latestVersion);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Copy Markdown
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the changes.

…testapm_api_integrationtestsdiagnostics-to-be-deployment-agnostic-api-tests
@miloszmarcinkowski miloszmarcinkowski enabled auto-merge (squash) November 14, 2024 13:08
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Nov 14, 2024

💔 Build Failed

  • Buildkite Build
  • Commit: 2e2d110
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-199645-2e2d1106ad0c

Failed CI Steps

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [75679b2]

History

@miloszmarcinkowski miloszmarcinkowski merged commit 04b2d62 into elastic:main Nov 14, 2024
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [APM] Migrate service tests to deployment agnostic (#199812)

Manual backport

To create the backport manually run:

node scripts/backport --pr 199645

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 15, 2024
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 199645 locally

wayneseymour pushed a commit to wayneseymour/kibana that referenced this pull request Nov 18, 2024
…astic#199645)

closes elastic#198967
closes elastic#198985
part of elastic#193245

### How to test

- 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="APM"
```

- 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="APM"
```

-
[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)

### Checklist
- [x] (OPTIONAL, only if a test has been unskipped) Run flaky test suite
- [x] serverless
- [x] stateful
- [x] MKI

---------

Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
…astic#199645)

closes elastic#198967
closes elastic#198985
part of elastic#193245

### How to test

- 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="APM"
```

- 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="APM"
```

-
[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)

### Checklist
- [x] (OPTIONAL, only if a test has been unskipped) Run flaky test suite
- [x] serverless
- [x] stateful
- [x] MKI

---------

Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
…astic#199645)

closes elastic#198967
closes elastic#198985
part of elastic#193245

### How to test

- 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="APM"
```

- 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="APM"
```

-
[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)

### Checklist
- [x] (OPTIONAL, only if a test has been unskipped) Run flaky test suite
- [x] serverless
- [x] stateful
- [x] MKI

---------

Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
@miloszmarcinkowski
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

miloszmarcinkowski added a commit to miloszmarcinkowski/kibana that referenced this pull request Nov 18, 2024
…astic#199645)

closes elastic#198967
closes elastic#198985
part of elastic#193245

### How to test

- 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="APM"
```

- 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="APM"
```

-
[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)

### Checklist
- [x] (OPTIONAL, only if a test has been unskipped) Run flaky test suite
- [x] serverless
- [x] stateful
- [x] MKI

---------

Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
(cherry picked from commit 04b2d62)
miloszmarcinkowski added a commit that referenced this pull request Nov 18, 2024
…ic (#199645) (#200563)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Migrate /diagnostics and /service_nodes to be deployment agnostic
(#199645)](#199645)

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

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

<!--BACKPORT [{"author":{"name":"Milosz
Marcinkowski","email":"38698566+miloszmarcinkowski@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-11-14T15:39:11Z","message":"Migrate
/diagnostics and /service_nodes to be deployment agnostic
(#199645)\n\ncloses #198967\r\ncloses #198985\r\npart of
https://github.com/elastic/kibana/issues/193245\r\n\r\n### How to
test\r\n\r\n- Serverless\r\n\r\n```\r\nnode
scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
--grep=\"APM\"\r\n```\r\n\r\n- Stateful\r\n```\r\nnode
scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
--grep=\"APM\"\r\n```\r\n\r\n-\r\n[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)\r\n\r\n###
Checklist\r\n- [x] (OPTIONAL, only if a test has been unskipped) Run
flaky test suite\r\n- [x] serverless\r\n- [x] stateful\r\n- [x]
MKI\r\n\r\n---------\r\n\r\nCo-authored-by: Sergi Romeu
<sergi.romeu@elastic.co>","sha":"04b2d62fee8731e1a0a6ff230b512d7e94843ce5","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services"],"number":199645,"url":"https://github.com/elastic/kibana/pull/199645","mergeCommit":{"message":"Migrate
/diagnostics and /service_nodes to be deployment agnostic
(#199645)\n\ncloses #198967\r\ncloses #198985\r\npart of
https://github.com/elastic/kibana/issues/193245\r\n\r\n### How to
test\r\n\r\n- Serverless\r\n\r\n```\r\nnode
scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
--grep=\"APM\"\r\n```\r\n\r\n- Stateful\r\n```\r\nnode
scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
--grep=\"APM\"\r\n```\r\n\r\n-\r\n[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)\r\n\r\n###
Checklist\r\n- [x] (OPTIONAL, only if a test has been unskipped) Run
flaky test suite\r\n- [x] serverless\r\n- [x] stateful\r\n- [x]
MKI\r\n\r\n---------\r\n\r\nCo-authored-by: Sergi Romeu
<sergi.romeu@elastic.co>","sha":"04b2d62fee8731e1a0a6ff230b512d7e94843ce5"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199645","number":199645,"mergeCommit":{"message":"Migrate
/diagnostics and /service_nodes to be deployment agnostic
(#199645)\n\ncloses #198967\r\ncloses #198985\r\npart of
https://github.com/elastic/kibana/issues/193245\r\n\r\n### How to
test\r\n\r\n- Serverless\r\n\r\n```\r\nnode
scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
--grep=\"APM\"\r\n```\r\n\r\n- Stateful\r\n```\r\nnode
scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
--grep=\"APM\"\r\n```\r\n\r\n-\r\n[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)\r\n\r\n###
Checklist\r\n- [x] (OPTIONAL, only if a test has been unskipped) Run
flaky test suite\r\n- [x] serverless\r\n- [x] stateful\r\n- [x]
MKI\r\n\r\n---------\r\n\r\nCo-authored-by: Sergi Romeu
<sergi.romeu@elastic.co>","sha":"04b2d62fee8731e1a0a6ff230b512d7e94843ce5"}}]}]
BACKPORT-->
@kibanamachine kibanamachine added v8.17.0 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Nov 18, 2024
miloszmarcinkowski added a commit to miloszmarcinkowski/kibana that referenced this pull request Apr 10, 2025
…astic#199645)

closes elastic#198967
closes elastic#198985
part of elastic#193245

- 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="APM"
```

- 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="APM"
```

-
[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)

- [x] (OPTIONAL, only if a test has been unskipped) Run flaky test suite
- [x] serverless
- [x] stateful
- [x] MKI

---------

Co-authored-by: Sergi Romeu <sergi.romeu@elastic.co>
(cherry picked from commit 04b2d62)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. v8.17.0 v9.0.0

Projects

None yet

6 participants