Skip to content

Commit

Permalink
Merge branch 'master' into gh-7424
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Jun 15, 2016
2 parents 777ebbc + 7af3e7e commit 273c349
Show file tree
Hide file tree
Showing 28 changed files with 238 additions and 168 deletions.
26 changes: 13 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,35 +113,35 @@ 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:
Expand All @@ -151,13 +151,13 @@ Run the tests for just your particular plugin. Assuming you plugin lives outside

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`
`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:
Expand Down Expand Up @@ -187,12 +187,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
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Kibana 5.0.0-snapshot
# Kibana 5.0.0

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
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dashboarding"
],
"private": false,
"version": "5.0.0-snapshot",
"version": "5.0.0",
"build": {
"number": 8467,
"sha": "6cb7fec4e154faa0a4a3fee4b33dfef91b9870d9"
Expand Down Expand Up @@ -48,7 +48,6 @@
"test:server": "grunt test:server",
"test:coverage": "grunt test:coverage",
"build": "grunt build",
"build:ospackages": "grunt build --os-packages",
"start": "sh ./bin/kibana --dev",
"precommit": "grunt precommit",
"karma": "karma start",
Expand Down
32 changes: 17 additions & 15 deletions src/plugins/status_page/public/status_page.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="container state_default state_{{ui.serverState}}">
<div class="container overall_state_default overall_state_{{ui.serverState}}">
<header>
<h1>
Status: <span class="state_color">{{ ui.serverStateMessage }}</span>
<i class="fa state_color state_icon" />
Status: <span class="overall_state_color">{{ ui.serverStateMessage }}</span>
<i class="fa overall_state_color state_icon" />
<span class="pull-right">
{{ ui.name }}
</span>
Expand All @@ -15,27 +15,29 @@ <h1>
</div>
</div>

<div class="row plugin_status_wrapper">
<h3>Installed Plugins</h3>
<div ng-if="!ui.statuses && ui.loading" class="loading_statuses">
<div class="row statuses_wrapper">
<h3>Status Breakdown</h3>

<div ng-if="!ui.statuses && ui.loading" class="statuses_loading">
<span class="spinner"></span>
</div>

<h4 ng-if="!ui.statuses && !ui.loading" class="missing_statuses">
No plugin status information available
<h4 ng-if="!ui.statuses && !ui.loading" class="statuses_missing">
No status information available
</h4>

<table class="plugin_status_breakdown" ng-if="ui.statuses">
<table class="statuses" data-test-subj="statusBreakdown" ng-if="ui.statuses">
<tr class="row">
<th class="col-xs-2">Name</th>
<th class="col-xs-2">Version</th>
<th class="col-xs-4">ID</th>
<th class="col-xs-8">Status</th>
</tr>
<tr ng-repeat="status in ui.statuses" class="status_row plugin_state_default plugin_state_{{status.state}} row">
<td class="col-xs-2 status_name">{{status.name}}</td>
<td class="col-xs-2 status_version">{{status.version}}</td>
<tr
ng-repeat="status in ui.statuses"
class="status status_state_default status_state_{{status.state}} row">

<td class="col-xs-4 status_id">{{status.id}}</td>
<td class="col-xs-8 status_message">
<i class="fa plugin_state_color plugin_state_icon" />
<i class="fa status_state_color status_state_icon" />
{{status.message}}
</td>
</tr>
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/status_page/public/status_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ const chrome = require('ui/chrome')

const data = resp.data;
ui.metrics = data.metrics;
ui.statuses = data.status.statuses;
ui.name = data.name;

ui.statuses = data.status.statuses;

const overall = data.status.overall;
if (!ui.serverState || (ui.serverState !== overall.state)) {
ui.serverState = overall.state;
Expand Down
69 changes: 35 additions & 34 deletions src/plugins/status_page/public/status_page.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
@status-metric-border: #aaa;
@status-metric-title-color: #666;

@status-plugins-bg: #fff;
@status-plugins-border: #bbb;
@status-plugins-headings-color: #666;
@status-statuses-bg: #fff;
@status-statuses-border: #bbb;
@status-statuses-headings-color: #666;

@status-default: #7c7c7c;
@status-green: #94c63d;
Expand Down Expand Up @@ -58,47 +58,48 @@
}
}

// plugin status table section
.plugin_status_wrapper {
// status status table section
.statuses_wrapper {
margin-top: 25px;
margin-left: -5px;
margin-right: -5px;
border-top:2px solid;
background-color: @status-plugins-bg;
background-color: @status-statuses-bg;
padding: 10px;

h3 {
margin-top: 3px;
margin-bottom: 3px;
}

.missing_statuses,
.loading_statuses {
.statuses_loading,
.statuses_missing {
padding: 20px;
text-align: center;
}

.plugin_status_breakdown {
.statuses {
margin-left: 0;
margin-right: 0;
margin-bottom: 30px;

.status_row {
.status {
height:30px;
line-height:30px;
border-bottom:1px solid;
border-bottom-color: @status-plugins-border;
border-bottom-color: @status-statuses-border;
}

th {
color:@status-plugins-headings-color;
color:@status-statuses-headings-color;
font-weight: normal;
height:25px;
line-height:25px;
border-bottom:1px solid;
border-bottom-color: @status-plugins-border;
border-bottom-color: @status-statuses-border;
}

.status_name {
.status_id {
padding:0px 5px;
border-left: 2px solid;
}
Expand All @@ -111,17 +112,17 @@
}
}

//plugin state
.plugin_state(@color, @icon) {
.plugin_state_color {
//status state
.status_state(@color, @icon) {
.status_state_color {
color: @color;
}

.plugin_state_icon:before {
.status_state_icon:before {
content: @icon;
}

.status_name {
.status_id {
border-left-color: @color !important;
}

Expand All @@ -130,49 +131,49 @@
}
}

.plugin_state_default {
.plugin_state(@status-default, @icon-default);
.status_state_default {
.status_state(@status-default, @icon-default);
}

.plugin_state_green {
.plugin_state(@status-green, @icon-green);
.status_state_green {
.status_state(@status-green, @icon-green);
}

.plugin_state_yellow {
.plugin_state(@status-yellow, @icon-yellow);
.status_state_yellow {
.status_state(@status-yellow, @icon-yellow);
}

.plugin_state_red {
.plugin_state(@status-red, @icon-red);
.status_state_red {
.status_state(@status-red, @icon-red);
}

//server state
.state(@color, @icon) {
.state_color {
.overall_state_color {
color: @color;
}

.state_icon:before {
.overall_state_icon:before {
content: @icon;
}

.plugin_status_wrapper {
.statuses_wrapper {
border-top-color: @color;
}
}

.state_default {
.overall_state_default {
.state(@status-default, @icon-default);
}

.state_green {
.overall_state_green {
.state(@status-green, @icon-green);
}

.state_yellow {
.overall_state_yellow {
.state(@status-yellow, @icon-yellow);
}

.state_red {
.overall_state_red {
.state(@status-red, @icon-red);
}
2 changes: 1 addition & 1 deletion src/server/plugins/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module.exports = class Plugin {
server.exposeStaticDir(`/plugins/${id}/{path*}`, this.publicDir);
}

this.status = kbnServer.status.create(this);
this.status = kbnServer.status.createForPlugin(this);
server.expose('status', this.status);

return await attempt(this.externalInit, [server, options], this);
Expand Down
Loading

0 comments on commit 273c349

Please sign in to comment.