mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Merge pull request #7768 from jbudz/intern-grep
Filter integration tests from npm command
This commit is contained in:
commit
d5dde7640f
3 changed files with 27 additions and 8 deletions
|
@ -149,7 +149,7 @@ Run the tests for just your particular plugin. Assuming you plugin lives outside
|
|||
The following will start Kibana, Elasticsearch and the chromedriver for you. To run the functional UI tests use the following commands
|
||||
|
||||
`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.
|
||||
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. This supports options `--grep=foo` for only running tests that match a regular expression, and `--appSuites=management` for running tests for a specific application.
|
||||
|
||||
`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.
|
||||
|
|
|
@ -7,7 +7,10 @@ module.exports = function (grunt) {
|
|||
runType: 'runner',
|
||||
config: 'test/intern',
|
||||
bail: true,
|
||||
reporters: ['Console']
|
||||
reporters: ['Console'],
|
||||
grep: grunt.option('grep'),
|
||||
functionalSuites: grunt.option('functionalSuites'),
|
||||
appSuites: grunt.option('appSuites')
|
||||
},
|
||||
dev: {},
|
||||
api: {
|
||||
|
|
|
@ -16,17 +16,33 @@ define(function (require) {
|
|||
PageObjects.init(this.remote);
|
||||
support.init(this.remote);
|
||||
});
|
||||
|
||||
require([
|
||||
const supportPages = [
|
||||
'intern/dojo/node!../support/page_objects',
|
||||
'intern/dojo/node!../support',
|
||||
'intern/dojo/node!../support'
|
||||
];
|
||||
|
||||
const requestedApps = process.argv.reduce((previous, arg) => {
|
||||
const option = arg.split('=');
|
||||
const key = option[0];
|
||||
const value = option[1];
|
||||
if (key === 'appSuites' && value) return value.split(',');
|
||||
});
|
||||
|
||||
const apps = [
|
||||
'intern/dojo/node!./apps/discover',
|
||||
'intern/dojo/node!./status_page',
|
||||
'intern/dojo/node!./apps/management',
|
||||
'intern/dojo/node!./apps/visualize',
|
||||
'intern/dojo/node!./apps/console',
|
||||
'intern/dojo/node!./apps/dashboard'
|
||||
], (loadedPageObjects, loadedSupport) => {
|
||||
'intern/dojo/node!./apps/dashboard',
|
||||
'intern/dojo/node!./status_page'
|
||||
].filter((suite) => {
|
||||
if (!requestedApps) return true;
|
||||
return requestedApps.reduce((previous, app) => {
|
||||
return previous || ~suite.indexOf(app);
|
||||
}, false);
|
||||
});
|
||||
|
||||
require(supportPages.concat(apps), (loadedPageObjects, loadedSupport) => {
|
||||
PageObjects = loadedPageObjects;
|
||||
support = loadedSupport;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue