Skip to content

Commit

Permalink
Merge pull request #6655 from AnalyticalGraphicsInc/chrome-headless
Browse files Browse the repository at this point in the history
Use Chrome Headless instead of Electron
  • Loading branch information
Hannah authored Jul 25, 2018
2 parents a97cb71 + 0348410 commit c5020e1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ language: node_js
node_js:
- "8"
sudo: false
addons:
chrome: stable
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand All @@ -17,7 +19,7 @@ script:

- echo 'test webgl-stub' && echo -en 'travis_fold:start:script.test\\r'
- npm run build
- npm run test -- --browsers Electron --webgl-stub --failTaskOnError --suppressPassed
- npm run test -- --browsers ChromeCI --webgl-stub --failTaskOnError --suppressPassed
- echo -en 'travis_fold:end:script.test\\r'

- echo 'makeZipFile' && echo -en 'travis_fold:start:script.makeZipFile\\r'
Expand All @@ -36,7 +38,7 @@ script:
- echo -en 'travis_fold:end:script.deploy\\r'

- echo 'test webgl-stub release' && echo -en 'travis_fold:start:script test.release\\r'
- npm run test -- --browsers Electron --failTaskOnError --webgl-stub --release --suppressPassed
- npm run test -- --browsers ChromeCI --failTaskOnError --webgl-stub --release --suppressPassed
- echo -en 'travis_fold:end:script test.release\\r'

- echo 'test node' && echo -en 'travis_fold:start:script test.node\\r'
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Contributors/TestingGuide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ You can run or debug the tests by using the first two buttons. The third button

This runner has lots of options, such as only showing failing tests or automatically re-running the tests on a test interval (great for development when combined with `fdefineSuite`!). You can hover over each of the buttons to see what they do.

Instead of using Chrome or Firefox, the WebStorm configuration uses [Electron](https://github.com/atom/electron) as the browser, which runs V8 (Chrome) inside of a node process. We have configured it to run headless so that no browser window pops up while testing. If you ever have a need to run a specific browser from within WebStorm, simply click the `Run tests` combo box and select `edit configuration`. From there it's self-explanatory.'
The WebStorm configuration uses Chrome Headless as the browser, which runs Chrome inside of a node process and no browser window pops up while testing. If you ever have a need to run a specific browser from within WebStorm, simply click the `Run tests` combo box and select `edit configuration`. From there it's self-explanatory.'

To make jumping between the source and spec files easier download the [Cesium WebStorm plugin](https://github.com/AnalyticalGraphicsInc/cesium-webstorm-plugin).

Expand Down
10 changes: 8 additions & 2 deletions Specs/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ module.exports = function(config) {
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers : ['Chrome'],

electronOpts : {
show : false
//In Travis, we need to run with the no-sandbox flag
customLaunchers: {
ChromeCI: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox'
]
}
},

browserNoActivityTimeout : 30000,
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"cloc": "^2.3.3",
"compressible": "^2.0.9",
"compression": "^1.6.2",
"electron": "^1.6.1",
"eslint": "^5.2.0",
"eslint-plugin-html": "^4.0.2",
"event-stream": "^3.3.4",
Expand All @@ -58,7 +57,6 @@
"karma-chrome-launcher": "^2.0.0",
"karma-detect-browsers": "^2.2.3",
"karma-edge-launcher": "^0.4.2",
"karma-electron": "^5.1.1",
"karma-firefox-launcher": "^1.0.0",
"karma-ie-launcher": "^1.0.0",
"karma-jasmine": "^1.1.0",
Expand Down

0 comments on commit c5020e1

Please sign in to comment.