Skip to content

Commit

Permalink
Skipping a Kibana test to mirror a fix going into master in PR elasti…
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrhodes committed Oct 26, 2018
1 parent ab4f368 commit 36114c6
Showing 1 changed file with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,38 @@ import * as logstashMetrics from '../../../../../plugins/monitoring/server/lib/m
import * as beatsMetrics from '../../../../../plugins/monitoring/server/lib/metrics/beats/metrics';
import * as apmMetrics from '../../../../../plugins/monitoring/server/lib/metrics/apm/metrics';

export default function ({ getService }) {
export default function({ getService }) {
const es = getService('es');

const metricSets = [
{
metrics: esMetrics.metrics,
name: 'es metrics',
indexTemplate: '.monitoring-es'
indexTemplate: '.monitoring-es',
},
{
metrics: kibanaMetrics.metrics,
name: 'kibana metrics',
indexTemplate: '.monitoring-kibana'
indexTemplate: '.monitoring-kibana',
},
{
metrics: logstashMetrics.metrics,
name: 'logstash metrics',
indexTemplate: '.monitoring-logstash'
indexTemplate: '.monitoring-logstash',
},
{
metrics: beatsMetrics.metrics,
name: 'beats metrics',
indexTemplate: '.monitoring-beats'
indexTemplate: '.monitoring-beats',
},
{
metrics: apmMetrics.metrics,
name: 'apm metrics',
indexTemplate: '.monitoring-beats' // apm uses the same as beats
indexTemplate: '.monitoring-beats', // apm uses the same as beats
},
];

describe('mappings', () => {
describe.skip('mappings', () => {
for (const { indexTemplate, metrics, name } of metricSets) {
let mappings;

Expand All @@ -52,15 +52,20 @@ export default function ({ getService }) {
mappings = get(template, [indexTemplate, 'mappings', 'doc', 'properties']);
});

describe(`for ${name}`, () => { // eslint-disable-line no-loop-func
describe(`for ${name}`, () => {
// eslint-disable-line no-loop-func
for (const metric of Object.values(metrics)) {
for (const field of metric.getFields()) {
it(`${field} should exist in the mappings`, () => { // eslint-disable-line no-loop-func
const propertyGetter = field.split('.').reduce((list, field) => {
list.push(field);
list.push('properties');
return list;
}, []).slice(0, -1); // Remove the trailing 'properties'
it(`${field} should exist in the mappings`, () => {
// eslint-disable-line no-loop-func
const propertyGetter = field
.split('.')
.reduce((list, field) => {
list.push(field);
list.push('properties');
return list;
}, [])
.slice(0, -1); // Remove the trailing 'properties'

const foundMapping = get(mappings, propertyGetter, null);
expect(foundMapping).to.not.equal(null);
Expand Down

0 comments on commit 36114c6

Please sign in to comment.