Skip to content

Commit

Permalink
refactor: migrate transactions to deployment agnostic test
Browse files Browse the repository at this point in the history
  • Loading branch information
rmyz committed Nov 18, 2024
1 parent d804b38 commit 95c20b3
Show file tree
Hide file tree
Showing 18 changed files with 791 additions and 2,683 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ export default function apmApiIntegrationTests({
loadTestFile(require.resolve('./diagnostics'));
loadTestFile(require.resolve('./service_nodes'));
loadTestFile(require.resolve('./span_links'));
loadTestFile(require.resolve('./transactions'));
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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 expect from '@kbn/expect';
import archives from '../constants/archives_metadata';
import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context';

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

const archiveName = 'apm_8.0.0';
const { start, end } = archives[archiveName];
const transactionType = 'request';

describe('Breakdown', () => {
describe('Breakdown when data is not loaded', () => {
it('handles the empty state', async () => {
const response = await apmApiClient.readUser({
endpoint: 'GET /internal/apm/services/{serviceName}/transaction/charts/breakdown',
params: {
path: { serviceName: 'opbeans-node' },
query: {
start,
end,
transactionType,
environment: 'ENVIRONMENT_ALL',
kuery: '',
},
},
});

expect(response.status).to.be(200);
expect(response.body).to.eql({ timeseries: [] });
});
});
});
}
Loading

0 comments on commit 95c20b3

Please sign in to comment.