mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Merge branch 'feature/hapi-server' of github.com:simianhacker/kibana into feature/hapi-server
This commit is contained in:
commit
a2a9b95428
6 changed files with 38 additions and 5 deletions
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
"name": "kibana",
|
||||
"version": "0.0.0",
|
||||
"authors": [
|
||||
"Spencer Alger <spencer@spenceralger.com>"
|
||||
],
|
||||
|
@ -30,7 +29,7 @@
|
|||
"bluebird": "~2.9.27",
|
||||
"bootstrap": "3.3.4",
|
||||
"d3": "3.5.5",
|
||||
"elasticsearch": "4.1.0",
|
||||
"elasticsearch": "~5.0.0",
|
||||
"Faker": "1.1.0",
|
||||
"FileSaver": "babc6d9d8f",
|
||||
"font-awesome": "4.2.0",
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
"compression": "^1.3.0",
|
||||
"cookie-parser": "^1.3.3",
|
||||
"debug": "^2.1.1",
|
||||
"elasticsearch": "^3.1.1",
|
||||
"elasticsearch": "^5.0.0",
|
||||
"express": "^4.10.6",
|
||||
"glob": "^4.3.2",
|
||||
"good": "^5.1.2",
|
||||
|
|
|
@ -9,8 +9,7 @@ define(function (require) {
|
|||
index: configFile.kibana_index,
|
||||
body: {
|
||||
settings: {
|
||||
number_of_shards : 1,
|
||||
number_of_replicas: 1
|
||||
number_of_shards : 1
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -12,6 +12,7 @@ define(function (require) {
|
|||
host: configFile.elasticsearch,
|
||||
log: 'info',
|
||||
requestTimeout: 0,
|
||||
apiVersion: '1.4',
|
||||
plugins: [function (Client, config) {
|
||||
|
||||
// esFactory automatically injects the AngularConnector to the config
|
||||
|
|
|
@ -30,6 +30,7 @@ module.exports = function (server) {
|
|||
var client = new elasticsearch.Client({
|
||||
host: url.format(uri),
|
||||
ssl: ssl,
|
||||
apiVersion: '1.4',
|
||||
log: function (config) {
|
||||
this.error = function (err) {
|
||||
server.log(['error', 'elasticsearch'], err);
|
||||
|
|
33
test/unit/specs/components/setup/create_kibana_index.js
Normal file
33
test/unit/specs/components/setup/create_kibana_index.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
define(function (require) {
|
||||
describe('Setup: Create Kibana Index', function () {
|
||||
var sinon = require('test_utils/auto_release_sinon');
|
||||
require('test_utils/no_digest_promises').activateForSuite();
|
||||
|
||||
var createKibanaIndex;
|
||||
var es;
|
||||
var Promise;
|
||||
|
||||
beforeEach(module('kibana'));
|
||||
|
||||
beforeEach(inject(function (Private, $injector) {
|
||||
createKibanaIndex = Private(require('components/setup/steps/create_kibana_index'));
|
||||
es = $injector.get('es');
|
||||
Promise = $injector.get('Promise');
|
||||
}));
|
||||
|
||||
it('sets number of shards for kibana index to 1', function () {
|
||||
var es_indices_stub = sinon.stub(es.indices, 'create').returns(Promise.resolve({}));
|
||||
createKibanaIndex();
|
||||
expect(es_indices_stub.calledOnce).to.be(true);
|
||||
expect(es_indices_stub.firstCall.args[0].body.settings.number_of_shards).to.be(1);
|
||||
});
|
||||
|
||||
it('does not set number of replicas for kibana index', function () {
|
||||
var es_indices_stub = sinon.stub(es.indices, 'create').returns(Promise.resolve({}));
|
||||
createKibanaIndex();
|
||||
expect(es_indices_stub.calledOnce).to.be(true);
|
||||
expect(es_indices_stub.firstCall.args[0].body.settings).to.not.have.property('number_of_replicas');
|
||||
});
|
||||
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue