From 8479a38e12e20be83bb49e3890984f69cb8eb643 Mon Sep 17 00:00:00 2001 From: Eric Herot Date: Mon, 14 Dec 2015 11:06:41 -0500 Subject: [PATCH 1/2] Don't bother setting the number of index replicas when creating kibana-int (relates to #3877) --- src/plugins/elasticsearch/lib/__tests__/create_kibana_index.js | 2 -- src/plugins/elasticsearch/lib/__tests__/routes.js | 2 +- src/plugins/elasticsearch/lib/create_kibana_index.js | 3 +-- test/fixtures/scenarios/emptyKibana/kibanaDefinition.js | 3 +-- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plugins/elasticsearch/lib/__tests__/create_kibana_index.js b/src/plugins/elasticsearch/lib/__tests__/create_kibana_index.js index a79877b62eaa..98a6f79c4e1c 100644 --- a/src/plugins/elasticsearch/lib/__tests__/create_kibana_index.js +++ b/src/plugins/elasticsearch/lib/__tests__/create_kibana_index.js @@ -70,8 +70,6 @@ describe('plugins/elasticsearch', function () { .to.have.property('settings'); expect(params.body.settings) .to.have.property('number_of_shards', 1); - expect(params.body.settings) - .to.have.property('number_of_replicas', 1); }); }); diff --git a/src/plugins/elasticsearch/lib/__tests__/routes.js b/src/plugins/elasticsearch/lib/__tests__/routes.js index 5c27598419e9..fee05fc6c39e 100644 --- a/src/plugins/elasticsearch/lib/__tests__/routes.js +++ b/src/plugins/elasticsearch/lib/__tests__/routes.js @@ -76,7 +76,7 @@ describe('plugins/elasticsearch', function () { testRoute({ method: 'POST', url: '/elasticsearch/.kibana', - payload: {settings: { number_of_shards: 1, number_of_replicas: 1 }}, + payload: {settings: { number_of_shards: 1 }}, statusCode: 200 }); diff --git a/src/plugins/elasticsearch/lib/create_kibana_index.js b/src/plugins/elasticsearch/lib/create_kibana_index.js index f8640f2fdc3e..d224afd3fb54 100644 --- a/src/plugins/elasticsearch/lib/create_kibana_index.js +++ b/src/plugins/elasticsearch/lib/create_kibana_index.js @@ -14,8 +14,7 @@ module.exports = function (server) { index: index, body: { settings: { - number_of_shards: 1, - number_of_replicas: 1 + number_of_shards: 1 }, mappings: { config: { diff --git a/test/fixtures/scenarios/emptyKibana/kibanaDefinition.js b/test/fixtures/scenarios/emptyKibana/kibanaDefinition.js index 8fd065772675..699190ad981c 100644 --- a/test/fixtures/scenarios/emptyKibana/kibanaDefinition.js +++ b/test/fixtures/scenarios/emptyKibana/kibanaDefinition.js @@ -1,7 +1,6 @@ module.exports = { settings: { - number_of_shards: 1, - number_of_replicas: 1 + number_of_shards: 1 }, mappings: { config: { From 5bad265168f9271d5cbaa09dee3818abd3011b88 Mon Sep 17 00:00:00 2001 From: spalger Date: Fri, 18 Dec 2015 10:33:27 -0700 Subject: [PATCH 2/2] [es/createKibanaIndex] remove duplicate test and expand another --- .../lib/__tests__/create_kibana_index.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/plugins/elasticsearch/lib/__tests__/create_kibana_index.js b/src/plugins/elasticsearch/lib/__tests__/create_kibana_index.js index 98a6f79c4e1c..8e2648b7dc0a 100644 --- a/src/plugins/elasticsearch/lib/__tests__/create_kibana_index.js +++ b/src/plugins/elasticsearch/lib/__tests__/create_kibana_index.js @@ -60,20 +60,7 @@ describe('plugins/elasticsearch', function () { }); }); - it('should be created with 1 shard and 1 replica', function () { - var fn = createKibanaIndex(server); - return fn.then(function () { - var params = client.indices.create.args[0][0]; - expect(params) - .to.have.property('body'); - expect(params.body) - .to.have.property('settings'); - expect(params.body.settings) - .to.have.property('number_of_shards', 1); - }); - }); - - it('should be created with 1 shard and 1 replica', function () { + it('should be created with 1 shard and default replica', function () { var fn = createKibanaIndex(server); return fn.then(function () { var params = client.indices.create.args[0][0]; @@ -84,7 +71,7 @@ describe('plugins/elasticsearch', function () { expect(params.body.settings) .to.have.property('number_of_shards', 1); expect(params.body.settings) - .to.have.property('number_of_replicas', 1); + .to.not.have.property('number_of_replicas'); }); }); @@ -135,4 +122,3 @@ describe('plugins/elasticsearch', function () { }); }); -