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
  • Loading branch information
miloszmarcinkowski committed Nov 14, 2024
1 parent 68d95e4 commit c937b4a
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 @@ -28,5 +28,6 @@ export default function apmApiIntegrationTests({
loadTestFile(require.resolve('./latency'));
loadTestFile(require.resolve('./infrastructure'));
loadTestFile(require.resolve('./service_groups'));
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 c937b4a

Please sign in to comment.