Skip to content

Commit

Permalink
[tests/browser] generate css before testsBundle, include css (elastic…
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Oct 4, 2018
1 parent 1f13ee6 commit e2ec868
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/core_plugins/tests_bundle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default (kibana) => {
}

testGlobs.push(`${plugin.publicDir}/**/__tests__/**/*.js`);
testGlobs.push(`${plugin.publicDir}/**/*.css`);
});
} else {
// add the modules from all of the apps
Expand All @@ -79,6 +80,7 @@ export default (kibana) => {

for (const plugin of plugins) {
testGlobs.push(`${plugin.publicDir}/**/__tests__/**/*.js`);
testGlobs.push(`${plugin.publicDir}/**/*.css`);
}
}

Expand Down
2 changes: 0 additions & 2 deletions tasks/config/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ module.exports = function (grunt) {
// list of files / patterns to load in the browser
files: [
'http://localhost:5610/bundles/vendors.bundle.js',
'http://localhost:5610/bundles/commons.bundle.js',
'http://localhost:5610/bundles/tests.bundle.js',

'http://localhost:5610/bundles/vendors.style.css',
'http://localhost:5610/bundles/commons.style.css',
'http://localhost:5610/bundles/tests.style.css'
],

Expand Down
7 changes: 7 additions & 0 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ module.exports = function (grunt) {
...browserTestServerFlags,
]
}),
browserSCSS: createKbnServerTask({
flags: [
...browserTestServerFlags,
'--optimize',
'--optimize.enabled=false'
]
}),

// used by the test:coverage task
// runs the kibana server to serve the instrumented version of the browser test bundle
Expand Down
4 changes: 2 additions & 2 deletions tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ module.exports = function (grunt) {

grunt.registerTask('test:server', ['checkPlugins', 'run:mocha']);

grunt.registerTask('test:browser', ['checkPlugins', 'run:browserTestServer', 'karma:unit']);
grunt.registerTask('test:browser', ['checkPlugins', 'run:browserSCSS', 'run:browserTestServer', 'karma:unit']);

grunt.registerTask('test:browser-ci', () => {
const ciShardTasks = keys(grunt.config.get('karma'))
.filter(key => key.startsWith('ciShard-'))
.map(key => `karma:${key}`);

grunt.log.ok(`Running UI tests in ${ciShardTasks.length} shards`);

grunt.task.run(['run:browserSCSS']);
grunt.task.run(['run:browserTestServer', ...ciShardTasks]);
});

Expand Down

0 comments on commit e2ec868

Please sign in to comment.