Add checkPlugins task to check for plugins before running tests.#8981
Add checkPlugins task to check for plugins before running tests.#8981cjcenizal merged 3 commits intoelastic:masterfrom
Conversation
cd60ff6 to
9e71c77
Compare
package.json
Outdated
| "test:coverage": "grunt test:coverage", | ||
| "test:visualRegression": "grunt test:visualRegression", | ||
| "checkLicenses": "grunt licenses", | ||
| "checkPlugins": "grunt checkPlugins", |
There was a problem hiding this comment.
Since this is more of a dependency for other tasks, what do you think about removing the definition here?
tasks/test.js
Outdated
| module.exports = function (grunt) { | ||
| grunt.registerTask('checkPlugins', 'Checks for plugins which may disrupt tests', function checkPlugins() { | ||
| const done = this.async(); | ||
| const pluginsDir = path.resolve('./plugins/'); |
There was a problem hiding this comment.
I was hoping there was a better way to get this path as opposed to assembling it, but that doesn't appear to be the case.
There was a problem hiding this comment.
Most of the folder paths are defined in Gruntfile.js, thoughts on moving this there?
tasks/test.js
Outdated
| const visualRegression = require('../utilities/visual_regression'); | ||
|
|
||
| module.exports = function (grunt) { | ||
| grunt.registerTask('checkPlugins', 'Checks for plugins which may disrupt tests', function checkPlugins() { |
There was a problem hiding this comment.
Since this is in the test task, we should namespace it to keep consistent with the rest of the tasks here. test:checkPlugins
(say test task 5 times fast)
There was a problem hiding this comment.
Test task tes tast tesk tast testass tesp tasp. No sweat!
I was thinking that this task is like checkLicenses, which isn't name-spaced. They're alike in that they both validate some conditions of the code, but don't execute any of it... so they're not really tests, in that sense. I think we should leave the name-space off. Are you OK with that?
tasks/test.js
Outdated
| const done = this.async(); | ||
| const pluginsDir = path.resolve('./plugins/'); | ||
|
|
||
| fs.readdir(pluginsDir, (err, files) => { |
There was a problem hiding this comment.
We should handle the error case as the message given isn't very helpful.
> kibana@6.0.0-alpha1 checkPlugins /Users/tyler/Code/tylersmalley/kibana-6
> grunt checkPlugins
Running "checkPlugins" task
Fatal error: Cannot read property 'filter' of undefined
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/tyler/.nvm/versions/node/v6.9.0/bin/node" "/Users/tyler/.nvm/versions/node/v6.9.0/bin/npm" "run" "checkPlugins"
npm ERR! node v6.9.0
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! kibana@6.0.0-alpha1 checkPlugins: `grunt checkPlugins`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the kibana@6.0.0-alpha1 checkPlugins script 'grunt checkPlugins'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the kibana package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! grunt checkPlugins
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs kibana
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls kibana
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/tyler/Code/tylersmalley/kibana-6/npm-debug.log
|
|
||
| grunt.registerTask('test:server', [ 'esvm:test', 'simplemocha:all', 'esvm_shutdown:test' ]); | ||
| grunt.registerTask('test:browser', ['run:testServer', 'karma:unit']); | ||
| grunt.registerTask('test:server', [ |
|
@jbudz, mind being a second reviewer on this? |
tasks/test.js
Outdated
| const visualRegression = require('../utilities/visual_regression'); | ||
|
|
||
| module.exports = function (grunt) { | ||
| grunt.registerTask('checkPlugins', 'Checks for plugins which may disrupt tests', function checkPlugins() { |
There was a problem hiding this comment.
thoughts on moving this task to its own file?
|
@jbudz When you say "plugins that use these tasks" which tasks are you referring to? |
Backports PR #8981 **Commit 1:** Add checkPlugins task to check for plugins before running tests. * Original sha: 9e71c77 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-11-05T05:02:13Z **Commit 2:** Remove checkPlugins npm script. Gracefully handle error case. * Original sha: 98ec182 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-11-09T20:51:47Z **Commit 3:** Move checkPlugins task into its own module. * Original sha: bba7274 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-11-15T23:40:41Z
Backports PR #8981 **Commit 1:** Add checkPlugins task to check for plugins before running tests. * Original sha: 9e71c77 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-11-05T05:02:13Z **Commit 2:** Remove checkPlugins npm script. Gracefully handle error case. * Original sha: 98ec182 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-11-09T20:51:47Z **Commit 3:** Move checkPlugins task into its own module. * Original sha: bba7274 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-11-15T23:40:41Z
…stic#9094) Backports PR elastic#8981 **Commit 1:** Add checkPlugins task to check for plugins before running tests. * Original sha: 9e71c77 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-11-05T05:02:13Z **Commit 2:** Remove checkPlugins npm script. Gracefully handle error case. * Original sha: 98ec182 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-11-09T20:51:47Z **Commit 3:** Move checkPlugins task into its own module. * Original sha: bba7274 * Authored by CJ Cenizal <cj@cenizal.com> on 2016-11-15T23:40:41Z Former-commit-id: 6d0cee0
Uh oh!
There was an error while loading. Please reload this page.