Skip to content

Commit

Permalink
Migrate /test/apm_api_integration/tests/span_links to be deployment-a…
Browse files Browse the repository at this point in the history
…gnostic API tests (#200140)

closes #198990
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"
```

-
[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: kibanamachine <[email protected]>
  • Loading branch information
miloszmarcinkowski and kibanamachine authored Nov 18, 2024
1 parent 994d11b commit 45f7a8c
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 45f7a8c

Please sign in to comment.