Skip to content

Commit

Permalink
Migrate APM metrics tests to agnostic deployment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MiriamAparicio committed Nov 13, 2024
1 parent 06986e4 commit aed0553
Show file tree
Hide file tree
Showing 13 changed files with 947 additions and 927 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ export default function apmApiIntegrationTests({
loadTestFile(require.resolve('./correlations'));
loadTestFile(require.resolve('./entities'));
loadTestFile(require.resolve('./cold_start'));
loadTestFile(require.resolve('./metrics'));
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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('metrics', () => {
loadTestFile(require.resolve('./metrics_charts.spec.ts'));
loadTestFile(require.resolve('./memory/memory_metrics.spec.ts'));
loadTestFile(require.resolve('./serverless/serverless_active_instances.spec.ts'));
loadTestFile(require.resolve('./serverless/serverless_functions_overview.spec.ts'));
loadTestFile(require.resolve('./serverless/serverless_metrics_charts.spec.ts'));
loadTestFile(require.resolve('./serverless/serverless_summary.spec.ts'));
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
import type { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace';
import { config, generateData } from './generate_data';
import { DeploymentAgnosticFtrProviderContext } from '../../../../../ftr_provider_context';

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('2023-01-01T00:00:00.000Z').getTime();
const end = new Date('2023-01-01T00:15:00.000Z').getTime() - 1;
Expand All @@ -33,9 +33,10 @@ export default function ApiTest({ getService }: FtrProviderContext) {
});
}

// FLAKY: https://github.com/elastic/kibana/issues/176990
registry.when('Memory', { config: 'trial', archives: [] }, () => {
describe('Memory', () => {
let apmSynthtraceEsClient: ApmSynthtraceEsClient;
before(async () => {
apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient();
await generateData({ start, end, apmSynthtraceEsClient });
});

Expand Down
Loading

0 comments on commit aed0553

Please sign in to comment.