Skip to content

Commit

Permalink
[APM] Migrate /transactions to deployment agnostic test (#200694)
Browse files Browse the repository at this point in the history
## Summary

Closes #198997
Part of #193245

This PR contains the changes to migrate `transactions` test folder to
Deployment-agnostic testing strategy.

### How to test

- Serverless

```
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.apm.serverless.config.ts
node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.apm.serverless.config.ts
```

It's recommended to be run against
[MKI](https://github.com/elastic/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)

- Stateful
```
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.apm.stateful.config.ts
node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.apm.stateful.config.ts
```

## Checks

- [x] (OPTIONAL, only if a test has been unskipped) Run flaky test suite
- [x] local run for serverless
- [x] local run for stateful
- [x] MKI run for serverless 

<!--ONMERGE {"backportTargets":["8.x"]} ONMERGE-->
  • Loading branch information
rmyz authored Nov 20, 2024
1 parent 88a280c commit d0b5a57
Show file tree
Hide file tree
Showing 16 changed files with 696 additions and 2,560 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default function apmApiIntegrationTests({
loadTestFile(require.resolve('./span_links'));
loadTestFile(require.resolve('./suggestions'));
loadTestFile(require.resolve('./throughput'));
loadTestFile(require.resolve('./transactions'));
loadTestFile(require.resolve('./service_overview'));
});
}
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('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 d0b5a57

Please sign in to comment.