Skip to content

Commit

Permalink
[8.x] Migrate /test/apm_api_integration/tests/span_links to be deploy…
Browse files Browse the repository at this point in the history
…ment-agnostic API tests (elastic#200140) (elastic#200616)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Migrate /test/apm_api_integration/tests/span_links to be
deployment-agnostic API tests
(elastic#200140)](elastic#200140)

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

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

<!--BACKPORT [{"author":{"name":"Milosz
Marcinkowski","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-18T11:54:52Z","message":"Migrate
/test/apm_api_integration/tests/span_links to be deployment-agnostic API
tests (elastic#200140)\n\ncloses elastic#198990\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: kibanamachine
<[email protected]>","sha":"45f7a8c28dd34e057a1791c3eb41c528562304a5","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor"],"number":200140,"url":"https://github.com/elastic/kibana/pull/200140","mergeCommit":{"message":"Migrate
/test/apm_api_integration/tests/span_links to be deployment-agnostic API
tests (elastic#200140)\n\ncloses elastic#198990\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: kibanamachine
<[email protected]>","sha":"45f7a8c28dd34e057a1791c3eb41c528562304a5"}},"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/200140","number":200140,"mergeCommit":{"message":"Migrate
/test/apm_api_integration/tests/span_links to be deployment-agnostic API
tests (elastic#200140)\n\ncloses elastic#198990\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: kibanamachine
<[email protected]>","sha":"45f7a8c28dd34e057a1791c3eb41c528562304a5"}}]}]
BACKPORT-->
  • Loading branch information
miloszmarcinkowski authored Nov 18, 2024
1 parent f50f821 commit 5904f8b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ export default function apmApiIntegrationTests({
loadTestFile(require.resolve('./service_groups'));
loadTestFile(require.resolve('./diagnostics'));
loadTestFile(require.resolve('./service_nodes'));
loadTestFile(require.resolve('./span_links'));
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context';

export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) {
describe('span_links', () => {
loadTestFile(require.resolve('./span_links.spec.ts'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@
import expect from '@kbn/expect';
import { ProcessorEvent } from '@kbn/observability-plugin/common';
import { Readable } from 'stream';
import { FtrProviderContext } from '../../common/ftr_provider_context';
import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace';
import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context';
import { generateSpanLinksData } from './data_generator';

export default function ApiTest({ getService }: FtrProviderContext) {
const registry = getService('registry');
const apmApiClient = getService('apmApiClient');
const apmSynthtraceEsClient = getService('apmSynthtraceEsClient');
export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) {
const apmApiClient = getService('apmApi');
const synthtrace = getService('synthtrace');

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

// FLAKY: https://github.com/elastic/kibana/issues/177520
registry.when('contains linked children', { config: 'basic', archives: [] }, () => {
describe('contains linked children', () => {
let ids: ReturnType<typeof generateSpanLinksData>['ids'];
let apmSynthtraceEsClient: ApmSynthtraceEsClient;

before(async () => {
const spanLinksData = generateSpanLinksData();
apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient();

ids = spanLinksData.ids;

Expand Down

0 comments on commit 5904f8b

Please sign in to comment.