Skip to content

Commit

Permalink
added the management section refactoring from master
Browse files Browse the repository at this point in the history
  • Loading branch information
scampi committed Jun 30, 2016
2 parents 9511486 + 143e733 commit 9e32bbc
Show file tree
Hide file tree
Showing 491 changed files with 13,494 additions and 3,091 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -15,6 +15,7 @@ target
/test/screenshots/diff
/test/screenshots/failure
/test/screenshots/session
/test/screenshots/visual_regression_gallery.html
/esvm
.htpasswd
.eslintcache
Expand Down
44 changes: 15 additions & 29 deletions CONTRIBUTING.md
Expand Up @@ -113,63 +113,49 @@ Once that is complete just run:

```
sh
npm run test && npm run build
npm run test && npm run build -- --skip-os-packages
```

#### Debugging unit tests

The standard `npm run test` task runs several sub tasks and can take several minutes to complete, making debugging failures pretty painful. In order to ease the pain specialized tasks provide alternate methods for running the tests.


`npm run test:quick`
`npm run test:quick`
Runs both server and browser tests, but skips linting

`npm run test:server`
`npm run test:server`
Run only the server tests

`npm run test:browser`
`npm run test:browser`
Run only the browser tests. Coverage reports are available for browser tests by running `npm run test:coverage`. You can find the results under the `coverage/` directory that will be created upon completion.

`npm run test:dev`
Initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests.
`npm run test:dev`
Initializes an environment for debugging the browser tests. Includes an dedicated instance of the kibana server for building the test bundle, and a karma server. When running this task the build is optimized for the first time and then a karma-owned instance of the browser is opened. Click the "debug" button to open a new tab that executes the unit tests.
![Browser test debugging](http://i.imgur.com/DwHxgfq.png)

`npm run mocha [test file or dir]` or `npm run mocha:debug [test file or dir]`
`npm run mocha [test file or dir]` or `npm run mocha:debug [test file or dir]`
Run a one off test with the local project version of mocha, babel compilation, and optional debugging. Great
for development and fixing individual tests.

#### Unit testing plugins
This should work super if you're using the [Kibana plugin generator](https://github.com/elastic/generator-kibana-plugin). If you're not using the generator, well, you're on your own. We suggest you look at how the generator works.

`npm run test:dev -- --kbnServer.testsBundle.pluginId=some_special_plugin --kbnServer.plugin-path=../some_special_plugin`
`npm run test:dev -- --kbnServer.testsBundle.pluginId=some_special_plugin --kbnServer.plugin-path=../some_special_plugin`
Run the tests for just your particular plugin. Assuming you plugin lives outside of the `installedPlugins directory`, which it should.

#### Running browser automation tests:

*The Selenium server that is started currently only runs the tests in a recent version of Firefox.*
*You can use the `PATH` environment variable to specify which version of Firefox to use.*
The following will start Kibana, Elasticsearch and the chromedriver for you. To run the functional UI tests use the following commands

The following will start Kibana, Elasticsearch and Selenium for you. To run the functional UI tests use the following commands

`npm run test:ui`
`npm run test:ui`
Run the functional UI tests one time and exit. This is used by the CI systems and is great for quickly checking that things pass. It is essentially a combination of the next two tasks.

`npm run test:ui:server`
`npm run test:ui:server`
Start the server required for the `test:ui:runner` tasks. Once the server is started `test:ui:runner` can be run multiple times without waiting for the server to start.

`npm run test:ui:runner`
Execute the front-end selenium tests. This requires the server started by the `test:ui:server` task.

##### If you already have ElasticSearch, Kibana, and Selenium Server running:

Set your es and kibana ports in `test/intern.js` to 9220 and 5620, respectively. You can configure your Selenium server to run the tests on Chrome,IE, or other browsers here.

Once you've got the services running, execute the following:

```
sh
npm run test:ui:runner
```
`npm run test:ui:runner`
Execute the front-end browser tests. This requires the server started by the `test:ui:server` task.

#### Browser automation notes:

Expand All @@ -187,12 +173,12 @@ Packages are built using fpm, pleaserun, dpkg, and rpm. fpm and pleaserun can b
apt-get install ruby-dev rpm
gem install fpm -v 1.5.0 # required by pleaserun 0.0.16
gem install pleaserun -v 0.0.16 # higher versions fail at the moment
npm run build:ospackages
npm run build -- --skip-archives
```

To specify a package to build you can add `rpm` or `deb` as an argument.
```sh
npm run build:ospackages -- --rpm
npm run build -- --rpm
```

Distributable packages can be found in `target/` after the build completes.
Expand Down
5 changes: 4 additions & 1 deletion Gruntfile.js
Expand Up @@ -9,7 +9,7 @@ module.exports = function (grunt) {
pkg: grunt.file.readJSON('package.json'),
root: __dirname,
src: __dirname + '/src',
build: __dirname + '/build', // temporary build directory
buildDir: __dirname + '/build', // temporary build directory
plugins: __dirname + '/src/plugins',
server: __dirname + '/src/server',
target: __dirname + '/target', // location of the compressed build targets
Expand Down Expand Up @@ -69,6 +69,9 @@ module.exports = function (grunt) {

grunt.config.merge(config);

// must run before even services/platforms
grunt.config.set('build', require('./tasks/config/build')(grunt));

config.packageScriptsDir = __dirname + '/tasks/build/package_scripts';
// ensure that these run first, other configs need them
config.services = require('./tasks/config/services')(grunt);
Expand Down
10 changes: 5 additions & 5 deletions README.md
@@ -1,4 +1,4 @@
# Kibana 5.0.0-snapshot
# Kibana 5.0.0-alpha4

Kibana is an open source ([Apache Licensed](https://github.com/elastic/kibana/blob/master/LICENSE.md)), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elasticsearch.

Expand Down Expand Up @@ -43,7 +43,7 @@ For the daring, snapshot builds are available. These builds are created after ea

| platform | |
| --- | --- |
| OSX | [tar](http://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-snapshot-darwin-x64.tar.gz) |
| Linux x64 | [tar](http://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-snapshot-linux-x64.tar.gz) [deb](https://download.elastic.co/kibana/kibana-snapshot/kibana_5.0.0-snapshot_amd64.deb) [rpm](https://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0_snapshot-1.x86_64.rpm) |
| Linux x86 | [tar](http://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-snapshot-linux-x86.tar.gz) [deb](https://download.elastic.co/kibana/kibana-snapshot/kibana_5.0.0-snapshot_i386.deb) [rpm](https://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0_snapshot-1.i386.rpm) |
| Windows | [zip](http://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-snapshot-windows.zip) |
| OSX | [tar](http://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-alpha4-SNAPSHOT-darwin-x64.tar.gz) |
| Linux x64 | [tar](http://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-alpha4-SNAPSHOT-linux-x64.tar.gz) [deb](https://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-alpha4-SNAPSHOT-amd64.deb) [rpm](https://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-alpha4-SNAPSHOT-x86_64.rpm) |
| Linux x86 | [tar](http://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-alpha4-SNAPSHOT-linux-x86.tar.gz) [deb](https://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-alpha4-SNAPSHOT-i386.deb) [rpm](https://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-alpha4-SNAPSHOT-i686.rpm) |
| Windows | [zip](http://download.elastic.co/kibana/kibana-snapshot/kibana-5.0.0-alpha4-SNAPSHOT-windows.zip) |
1 change: 1 addition & 0 deletions docs/index.asciidoc
Expand Up @@ -8,6 +8,7 @@
:k4pull: https://github.com/elastic/kibana/pull/
:version: master
:esversion: master
:packageversion: master

include::introduction.asciidoc[]

Expand Down
10 changes: 5 additions & 5 deletions docs/kibana-repositories.asciidoc
Expand Up @@ -26,7 +26,7 @@ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add
+
["source","sh",subs="attributes"]
--------------------------------------------------
echo "deb http://packages.elastic.co/kibana/{version}/debian stable main" | sudo tee -a /etc/apt/sources.list.d/kibana.list
echo "deb https://packages.elastic.co/kibana/{packageversion}/debian stable main" | sudo tee -a /etc/apt/sources.list.d/kibana.list
--------------------------------------------------
+
[WARNING]
Expand Down Expand Up @@ -82,11 +82,11 @@ rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
+
["source","sh",subs="attributes"]
--------------------------------------------------
[kibana-{version}]
name=Kibana repository for {version}.x packages
baseurl=http://packages.elastic.co/kibana/{version}/centos
[kibana-{packageversion}]
name=Kibana repository for {packageversion} packages
baseurl=https://packages.elastic.co/kibana/{packageversion}/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
--------------------------------------------------
+
Expand Down
File renamed without changes.
32 changes: 21 additions & 11 deletions package.json
Expand Up @@ -11,7 +11,7 @@
"dashboarding"
],
"private": false,
"version": "5.0.0-snapshot",
"version": "5.0.0-alpha4",
"build": {
"number": 8467,
"sha": "6cb7fec4e154faa0a4a3fee4b33dfef91b9870d9"
Expand All @@ -30,6 +30,7 @@
"Jon Budzenski <jonathan.budzenski@elastic.co>",
"Juan Thomassie <juan.thomassie@elastic.co>",
"Khalah Jones-Golden <khalah.jones@elastic.co>",
"Lee Drengenberg <lee.drengenberg@elastic.co>",
"Lukas Olson <lukas.olson@elastic.co>",
"Matt Bargar <matt.bargar@elastic.co>",
"Nicolás Bevacqua <nico@elastic.co>",
Expand All @@ -47,8 +48,9 @@
"test:ui:runner": "grunt test:ui:runner",
"test:server": "grunt test:server",
"test:coverage": "grunt test:coverage",
"test:visualRegression": "grunt test:visualRegression",
"build": "grunt build",
"build:ospackages": "grunt build --os-packages",
"release": "grunt release",
"start": "sh ./bin/kibana --dev",
"precommit": "grunt precommit",
"karma": "karma start",
Expand All @@ -59,23 +61,24 @@
"makelogs": "makelogs",
"mocha": "mocha",
"mocha:debug": "mocha --debug-brk",
"sterilize": "grunt sterilize",
"compareScreenshots": "node utilities/compareScreenshots"
"sterilize": "grunt sterilize"
},
"repository": {
"type": "git",
"url": "https://github.com/elastic/kibana.git"
},
"dependencies": {
"@bigfunger/decompress-zip": "0.2.0-stripfix2",
"@elastic/datemath": "2.2.0",
"@bigfunger/jsondiffpatch": "0.1.38-webpack",
"@elastic/datemath": "2.3.0",
"@spalger/angular-bootstrap": "0.12.1",
"@spalger/filesaver": "1.1.2",
"@spalger/leaflet-draw": "0.2.3",
"@spalger/leaflet-heat": "0.1.3",
"@spalger/numeral": "^2.0.0",
"@spalger/test-subj-selector": "0.2.1",
"@spalger/ui-ace": "0.2.3",
"JSONStream": "1.1.1",
"angular": "1.4.7",
"angular-bootstrap-colorpicker": "3.0.19",
"angular-elastic": "2.5.0",
Expand All @@ -95,6 +98,7 @@
"clipboard": "1.5.5",
"commander": "2.8.1",
"css-loader": "0.17.0",
"csv-parse": "1.1.0",
"d3": "3.5.6",
"dragula": "3.7.0",
"elasticsearch": "10.1.2",
Expand All @@ -110,6 +114,7 @@
"good-squeeze": "2.1.0",
"gridster": "0.5.6",
"hapi": "8.8.1",
"highland": "2.7.2",
"httpolyglot": "0.1.1",
"imports-loader": "0.6.4",
"jade": "1.11.0",
Expand All @@ -127,9 +132,10 @@
"marked": "0.3.3",
"minimatch": "2.0.10",
"mkdirp": "0.5.1",
"moment": "2.10.6",
"moment-timezone": "0.4.1",
"moment": "2.13.0",
"moment-timezone": "0.5.4",
"node-uuid": "1.4.7",
"papaparse": "4.1.2",
"raw-loader": "0.5.1",
"request": "2.61.0",
"rimraf": "2.4.3",
Expand All @@ -139,6 +145,8 @@
"semver": "5.1.0",
"style-loader": "0.12.3",
"tar": "2.2.0",
"trunc-html": "1.0.2",
"trunc-text": "1.0.2",
"url-loader": "0.5.6",
"validate-npm-package-name": "2.2.2",
"webpack": "1.12.1",
Expand All @@ -153,6 +161,7 @@
"auto-release-sinon": "1.0.3",
"babel-eslint": "4.1.8",
"chokidar": "1.4.3",
"chromedriver": "2.21.2",
"elasticdump": "2.1.1",
"eslint": "1.10.3",
"eslint-plugin-mocha": "1.1.0",
Expand All @@ -170,10 +179,11 @@
"grunt-s3": "0.2.0-alpha.3",
"grunt-simple-mocha": "0.4.0",
"gruntify-eslint": "1.0.1",
"handlebars": "4.0.5",
"html-entities": "1.1.3",
"husky": "0.8.1",
"image-diff": "1.6.0",
"intern": "3.0.1",
"intern": "3.2.3",
"istanbul-instrumenter-loader": "0.1.3",
"karma": "0.13.9",
"karma-chrome-launcher": "0.2.0",
Expand All @@ -184,14 +194,14 @@
"karma-safari-launcher": "0.1.1",
"license-checker": "3.1.0",
"load-grunt-config": "0.19.1",
"makelogs": "3.0.0-beta3",
"makelogs": "3.0.0",
"marked-text-renderer": "0.1.0",
"mocha": "2.3.0",
"ncp": "2.0.0",
"nock": "2.10.0",
"npm": "2.11.0",
"npm": "2.15.1",
"portscanner": "1.0.0",
"simple-git": "1.8.0",
"simple-git": "1.37.0",
"sinon": "1.17.2",
"source-map": "0.4.4",
"source-map-support": "0.4.0",
Expand Down
3 changes: 3 additions & 0 deletions src/cli/cluster/base_path_proxy.js
Expand Up @@ -34,6 +34,9 @@ export default class BasePathProxy {
config.set('server.basePath', this.basePath);
}

const ONE_GIGABYTE = 1024 * 1024 * 1024;
config.set('server.maxPayloadBytes', ONE_GIGABYTE);

setupLogging(null, this.server, config);
setupConnection(null, this.server, config);
this.setupRoutes();
Expand Down
4 changes: 3 additions & 1 deletion src/cli/serve/__tests__/reload_logging_config.js
Expand Up @@ -23,6 +23,8 @@ function setLoggingJson(enabled) {

describe(`Server logging configuration`, function () {
it(`should be reloadable via SIGHUP process signaling`, function (done) {
this.timeout(60000);

let asserted = false;
let json = Infinity;
const conf = setLoggingJson(true);
Expand Down Expand Up @@ -66,7 +68,7 @@ ${err.stack || err.message || err}`).to.eql(true);
}

function switchToPlainTextLog() {
json = 2; // ignore both "reloading" messages
json = 3; // ignore both "reloading" messages + ui settings status message
setLoggingJson(false);
child.kill(`SIGHUP`); // reload logging config
}
Expand Down
3 changes: 2 additions & 1 deletion src/cli/serve/serve.js
Expand Up @@ -3,6 +3,7 @@ import { statSync } from 'fs';
import { isWorker } from 'cluster';
import { resolve } from 'path';
import { fromRoot } from '../../utils';
import { getConfig } from '../../server/path';
import readYamlConfig from './read_yaml_config';

let canCluster;
Expand Down Expand Up @@ -77,7 +78,7 @@ module.exports = function (program) {
'Path to the config file, can be changed with the CONFIG_PATH environment variable as well. ' +
'Use mulitple --config args to include multiple config files.',
configPathCollector,
[ process.env.CONFIG_PATH || fromRoot('config/kibana.yml') ]
[ getConfig() ]
)
.option('-p, --port <port>', 'The port to bind to', parseInt)
.option('-q, --quiet', 'Prevent all logging except errors')
Expand Down
4 changes: 2 additions & 2 deletions src/cli_plugin/install/__tests__/kibana.js
Expand Up @@ -44,8 +44,8 @@ describe('kibana cli', function () {
workingPath: testWorkingPath,
tempArchiveFile: tempArchiveFilePath,
plugin: 'test-plugin',
version: '5.0.0-snapshot',
plugins: [ { name: 'foo', path: join(testWorkingPath, 'foo'), version: '5.0.0-snapshot' } ]
version: '5.0.0-SNAPSHOT',
plugins: [ { name: 'foo', path: join(testWorkingPath, 'foo'), version: '5.0.0-SNAPSHOT' } ]
};
const errorStub = sinon.stub();

Expand Down
5 changes: 4 additions & 1 deletion src/cli_plugin/install/index.js
@@ -1,8 +1,11 @@
import { fromRoot } from '../../utils';
import fs from 'fs';
import install from './install';
import Logger from '../lib/logger';
import pkg from '../../utils/package_json';
import { getConfig } from '../../server/path';
import { parse, parseMilliseconds } from './settings';
import { find } from 'lodash';

function processCommand(command, options) {
let settings;
Expand All @@ -26,7 +29,7 @@ export default function pluginInstall(program) {
.option(
'-c, --config <path>',
'path to the config file',
fromRoot('config/kibana.yml')
getConfig()
)
.option(
'-t, --timeout <duration>',
Expand Down
3 changes: 2 additions & 1 deletion src/cli_plugin/remove/index.js
Expand Up @@ -2,6 +2,7 @@ import { fromRoot } from '../../utils';
import remove from './remove';
import Logger from '../lib/logger';
import { parse } from './settings';
import { getConfig } from '../../server/path';

function processCommand(command, options) {
let settings;
Expand All @@ -25,7 +26,7 @@ export default function pluginRemove(program) {
.option(
'-c, --config <path>',
'path to the config file',
fromRoot('config/kibana.yml')
getConfig()
)
.option(
'-d, --plugin-dir <path>',
Expand Down

0 comments on commit 9e32bbc

Please sign in to comment.