Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

miloszmarcinkowski
Copy link
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 Backport to (8.x) the previous minor version (i.e. one version back from main) 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
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
})
);

const apmTemplateNames = uniqueTemplateNames.filter((templateName) =>
Copy link
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 Observability Infrastructure & Services User Experience Team labels Nov 13, 2024
@elasticmachine
Copy link
Contributor

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

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!)

const synthtrace = getService('synthtrace');

const start = new Date('2021-01-01T00:00:00.000Z').getTime();
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
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.

@@ -19,27 +18,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon
const start = new Date('2021-01-01T00:00:00.000Z').getTime();
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
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
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
@@ -9,19 +9,18 @@ import expect from '@kbn/expect';
import { apm, timerange } from '@kbn/apm-synthtrace-client';
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
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
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
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
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
Contributor

Choose a reason for hiding this comment

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

Same here

@elasticmachine
Copy link
Contributor

⏳ Build in-progress

  • Buildkite Build
  • Commit: b9a4a03
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-199645-b9a4a033f11d

History

Copy link
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team
Projects
None yet
6 participants