-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
Copy pathnode_detail.js
50 lines (42 loc) · 1.45 KB
/
node_detail.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* 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 nodeDetailFixture from './fixtures/node_detail.json';
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
describe('node detail', function () {
// TODO: https://github.com/elastic/stack-monitoring/issues/31
this.tags(['skipCloud']);
const archive =
'x-pack/test/functional/es_archives/monitoring/singlecluster_three_nodes_shard_relocation';
const timeRange = {
min: '2017-10-05T20:31:48.000Z',
max: '2017-10-05T20:35:12.000Z',
};
before('load archive', () => {
return esArchiver.load(archive);
});
after('unload archive', () => {
return esArchiver.unload(archive);
});
it('should summarize node with metrics', async () => {
const { body } = await supertest
.post(
'/api/monitoring/v1/clusters/YCxj-RAgSZCP6GuOQ8M1EQ/elasticsearch/nodes/jUT5KdxfRbORSCWkb5zjmA'
)
.set('kbn-xsrf', 'xxx')
.send({
timeRange,
is_advanced: false,
showSystemIndices: false,
})
.expect(200);
expect(body).to.eql(nodeDetailFixture);
});
});
}