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

Fixing service maps API test #77586

Merged
merged 3 commits into from
Sep 16, 2020
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -86,157 +86,18 @@ export default function serviceMapsApiTests({ getService }: FtrProviderContext)
});

it('returns service map elements filtering by environment not defined', async () => {
const start = encodeURIComponent('2020-06-28T10:24:46.055Z');
const end = encodeURIComponent('2020-06-29T10:24:46.055Z');
const environment = 'ENVIRONMENT_NOT_DEFINED';
const response = await supertest.get(
const { body, status } = await supertest.get(
`/api/apm/service-map?start=${start}&end=${end}&environment=${environment}`
);
expect(response.status).to.be(200);
expectSnapshot(response.body).toMatchInline(`
Object {
"elements": Array [
Object {
"data": Object {
"id": "client~opbeans-node",
"source": "client",
"sourceData": Object {
"agent.name": "rum-js",
"id": "client",
"service.environment": "ENVIRONMENT_NOT_DEFINED",
"service.name": "client",
},
"target": "opbeans-node",
"targetData": Object {
"agent.name": "nodejs",
"id": "opbeans-node",
"service.environment": "ENVIRONMENT_NOT_DEFINED",
"service.name": "opbeans-node",
},
},
},
Object {
"data": Object {
"id": "opbeans-java~>postgresql",
"source": "opbeans-java",
"sourceData": Object {
"agent.name": "java",
"id": "opbeans-java",
"service.environment": "ENVIRONMENT_NOT_DEFINED",
"service.name": "opbeans-java",
},
"target": ">postgresql",
"targetData": Object {
"id": ">postgresql",
"label": "postgresql",
"span.destination.service.resource": "postgresql",
"span.subtype": "postgresql",
"span.type": "db",
},
},
},
Object {
"data": Object {
"id": "opbeans-node~>postgresql",
"source": "opbeans-node",
"sourceData": Object {
"agent.name": "nodejs",
"id": "opbeans-node",
"service.environment": "ENVIRONMENT_NOT_DEFINED",
"service.name": "opbeans-node",
},
"target": ">postgresql",
"targetData": Object {
"id": ">postgresql",
"label": "postgresql",
"span.destination.service.resource": "postgresql",
"span.subtype": "postgresql",
"span.type": "db",
},
},
},
Object {
"data": Object {
"id": "opbeans-node~>redis",
"source": "opbeans-node",
"sourceData": Object {
"agent.name": "nodejs",
"id": "opbeans-node",
"service.environment": "ENVIRONMENT_NOT_DEFINED",
"service.name": "opbeans-node",
},
"target": ">redis",
"targetData": Object {
"id": ">redis",
"label": "redis",
"span.destination.service.resource": "redis",
"span.subtype": "redis",
"span.type": "cache",
},
},
},
Object {
"data": Object {
"id": "opbeans-node~opbeans-java",
"source": "opbeans-node",
"sourceData": Object {
"agent.name": "nodejs",
"id": "opbeans-node",
"service.environment": "ENVIRONMENT_NOT_DEFINED",
"service.name": "opbeans-node",
},
"target": "opbeans-java",
"targetData": Object {
"agent.name": "java",
"id": "opbeans-java",
"service.environment": "ENVIRONMENT_NOT_DEFINED",
"service.name": "opbeans-java",
},
},
},
Object {
"data": Object {
"agent.name": "rum-js",
"id": "client",
"service.environment": "ENVIRONMENT_NOT_DEFINED",
"service.name": "client",
},
},
Object {
"data": Object {
"agent.name": "nodejs",
"id": "opbeans-node",
"service.environment": "ENVIRONMENT_NOT_DEFINED",
"service.name": "opbeans-node",
},
},
Object {
"data": Object {
"id": ">redis",
"label": "redis",
"span.destination.service.resource": "redis",
"span.subtype": "redis",
"span.type": "cache",
},
},
Object {
"data": Object {
"agent.name": "java",
"id": "opbeans-java",
"service.environment": "ENVIRONMENT_NOT_DEFINED",
"service.name": "opbeans-java",
},
},
Object {
"data": Object {
"id": ">postgresql",
"label": "postgresql",
"span.destination.service.resource": "postgresql",
"span.subtype": "postgresql",
"span.type": "db",
},
},
],
expect(status).to.be(200);
const environments = new Set();
body.elements.forEach((element: { data: Record<string, any> }) => {
environments.add(element.data['service.environment']);
});
expectSnapshot(environments).toMatchInline(`
cauemarcondes marked this conversation as resolved.
Show resolved Hide resolved
Set {
"ENVIRONMENT_NOT_DEFINED",
}
`);
});
Expand Down