[APM] Fix Service maps api test (#116218)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Cauê Marcondes 2021-10-26 11:10:17 -04:00 committed by GitHub
parent 84a3536fe4
commit 06fbfd91f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 2789 deletions

View file

@ -8,7 +8,7 @@
import querystring from 'querystring';
import url from 'url';
import expect from '@kbn/expect';
import { isEmpty, uniq } from 'lodash';
import { isEmpty, orderBy, uniq } from 'lodash';
import archives_metadata from '../../common/fixtures/es_archiver/archives_metadata';
import { PromiseReturnType } from '../../../../plugins/observability/typings/common';
import { FtrProviderContext } from '../../common/ftr_provider_context';
@ -151,8 +151,6 @@ export default function serviceMapsApiTests({ getService }: FtrProviderContext)
">sqlite",
]
`);
expectSnapshot(elements).toMatch();
});
describe('with ML data', () => {
@ -186,60 +184,58 @@ export default function serviceMapsApiTests({ getService }: FtrProviderContext)
expect(dataWithAnomalies).not.to.be.empty();
expectSnapshot(dataWithAnomalies.length).toMatchInline(`7`);
expectSnapshot(dataWithAnomalies.slice(0, 3)).toMatchInline(`
expectSnapshot(orderBy(dataWithAnomalies, 'data.id').slice(0, 3)).toMatchInline(`
Array [
Object {
"data": Object {
"agent.name": "rum-js",
"id": "opbeans-rum",
"service.environment": "testing",
"service.name": "opbeans-rum",
"serviceAnomalyStats": Object {
"actualValue": 1020870.96774194,
"anomalyScore": 0,
"healthStatus": "healthy",
"jobId": "apm-testing-41e5-high_mean_transaction_duration",
"serviceName": "opbeans-rum",
"transactionType": "page-load",
},
},
},
Object {
"data": Object {
"agent.name": "ruby",
"id": "opbeans-ruby",
"agent.name": "dotnet",
"id": "opbeans-dotnet",
"service.environment": "production",
"service.name": "opbeans-ruby",
"service.name": "opbeans-dotnet",
"serviceAnomalyStats": Object {
"actualValue": 62009.3356643357,
"actualValue": 868025.86875,
"anomalyScore": 0,
"healthStatus": "healthy",
"jobId": "apm-production-6117-high_mean_transaction_duration",
"serviceName": "opbeans-ruby",
"serviceName": "opbeans-dotnet",
"transactionType": "request",
},
},
},
Object {
"data": Object {
"agent.name": "python",
"id": "opbeans-python",
"service.environment": "production",
"service.name": "opbeans-python",
"agent.name": "go",
"id": "opbeans-go",
"service.environment": "testing",
"service.name": "opbeans-go",
"serviceAnomalyStats": Object {
"actualValue": 38862.7831325301,
"anomalyScore": 0.0725701910161626,
"actualValue": 102786.319148936,
"anomalyScore": 0,
"healthStatus": "healthy",
"jobId": "apm-testing-41e5-high_mean_transaction_duration",
"serviceName": "opbeans-go",
"transactionType": "request",
},
},
},
Object {
"data": Object {
"agent.name": "java",
"id": "opbeans-java",
"service.environment": "production",
"service.name": "opbeans-java",
"serviceAnomalyStats": Object {
"actualValue": 175568.855769231,
"anomalyScore": 0,
"healthStatus": "healthy",
"jobId": "apm-production-6117-high_mean_transaction_duration",
"serviceName": "opbeans-python",
"serviceName": "opbeans-java",
"transactionType": "request",
},
},
},
]
`);
expectSnapshot(response.body).toMatch();
});
});