Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APM] Add API test for service maps #70185

Merged
merged 6 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions x-pack/plugins/apm/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ For debugging access Elasticsearch on http://localhost:9220` (elastic/changeme)

### API integration tests
sorenlouv marked this conversation as resolved.
Show resolved Hide resolved

**Start server**
**Start server (basic)**
sorenlouv marked this conversation as resolved.
Show resolved Hide resolved

```
node scripts/functional_tests_server --config x-pack/test/api_integration/config.ts
node scripts/functional_tests_server --config x-pack/test/apm_api_integration/basic/config.ts
```

**Run tests**
**Run tests (basic)**

```
node scripts/functional_test_runner --config x-pack/test/api_integration/config.ts --grep='APM specs'
node scripts/functional_test_runner --config x-pack/test/apm_api_integration/basic/config.ts
sorenlouv marked this conversation as resolved.
Show resolved Hide resolved
```

APM tests are located in `x-pack/test/api_integration/apis/apm`.
APM tests are located in `x-pack/test/apm_api_integration/basic/tests`.
For debugging access Elasticsearch on http://localhost:9220` (elastic/changeme)

### Linting
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/apm_api_integration/basic/tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export default function apmApiIntegrationTests({ loadTestFile }: FtrProviderCont
loadTestFile(require.resolve('./feature_controls'));
loadTestFile(require.resolve('./agent_configuration'));
loadTestFile(require.resolve('./custom_link'));
loadTestFile(require.resolve('./service_maps'));
});
}
27 changes: 27 additions & 0 deletions x-pack/test/apm_api_integration/basic/tests/service_maps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import expect from '@kbn/expect';
import { JsonObject } from 'src/plugins/kibana_utils/common';
import { FtrProviderContext } from '../../common/ftr_provider_context';

// eslint-disable-next-line import/no-default-export
sorenlouv marked this conversation as resolved.
Show resolved Hide resolved
export default function serviceMapsApiTests({ getService }: FtrProviderContext) {
const supertest = getService('supertest');

describe('Service Maps', () => {
it('should only be available to users with Platinum license (or higher)', async () => {
const response = await supertest.get(
'/api/apm/service-map?start=2020-06-28T10%3A24%3A46.055Z&end=2020-06-29T10%3A24%3A46.055Z'
);

expect(response.status).to.be(403);
expect(response.body.message).to.be(
"In order to access Service Maps, you must be subscribed to an Elastic Platinum license. With it, you'll have the ability to visualize your entire application stack along with your APM data."
);
});
});
}
Binary file not shown.
Loading