-
-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure Travis CI to use headless Chrome for tests #894
Comments
I'm definitely for it, we had issues in the past with phantomJS not supporting few features, and if we can have a full fledge (headless) chrome, that then allow us to have ES6 test, and I'm all for it ! |
@obiot It'd need someone with access to the Travis account for melonJS, though. From sources side the only change needed is swapping PhantomJS to ChromeHeadless in grunt file. |
actually you don't, as all the magic happen in the travis.yml file. So as soon as the package.json is modified, this will be reflected "in" travis. |
love the nyan cat by the way :) 10 07 2017 10:40:12.530:INFO [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Connected on socket MybWDp60p6FCag5AAAAA with id 52316809
292 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_,------,
283 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_| /\_/\
0 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-^|__( o .o)
9 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- "" ""
292 total 283 passed 0 failed 9 skipped |
also when switching to ChromeHeadless, the following errors needs to be addressed : Failed Tests:
ES6 Collections test
Map#set
Chrome 59.0.3071 (Windows 10 0.0.0)
1) Expected true to equal false.
at Object.<anonymous> (tests/spec/es6-collections.js:163:22)
Map#forEach with mutations
Chrome 59.0.3071 (Windows 10 0.0.0)
2) Expected undefined to equal '[1,3,0]'.
at Object.<anonymous> (tests/spec/es6-collections.js:260:39)
me.input
Pointer Event
PointerDown event triggering
Chrome 59.0.3071 (Windows 10 0.0.0)
3) Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
292 total 285 passed 3 failed 4 skipped for the mouse input one it's pretty easy we just need to replace for the es6 collections, it's a bit more tricky. Either we remove the corresponding test, or we modify the outdate polyfill to comply with the latest ES6 Specifications (which I personally believe is a waste of effort) |
last change to autodetect the testing environment and fix the input test (so that we don't need to keep changing the test between phantomjs and chrome) |
let’s see if this one works before switching to ChromeHeadless for karma
enabling Chrome in Travis is way more difficult than I initially thought, so I reverted for now to PhantomJS (no more extra time for me to test today) few results I found and tried to apply : |
FYI I initially followed the below steps : but there is a issue with the "latest" travis environement and sandboxing that prevent it from working |
the missing bit was Chrome is starting now and karma running but 2 tests are failing under the travis environement, and the end of the log is missing, so I'm not able to see which one ..... here is copy/paste of the last lines (the 2 is for the 2 failing tests) : 292
265
2
4
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
-_-_-_-_-_- no idea though how to get the end of the log.... |
log problem solved |
so Chrome working, but 2 tests are failing (so I left it using PhantomJS for now), Left to do : identify the failing tests and assess the issue + solution. signing out on my side for today, I reaaaaaaaalllly have to run |
interesting ... 1st issue, again with the polyfill :
2nd one is weirder though, seems like the float precision is different, leading to a slightly different value on Linux/Chromium [EDIT] fixed, bad code with cheap rounding
|
second issue is fixed for the first, no idea so far on why the weakmap constructor fails on Chromium : @parasyte @agmcleod @kibertoad in case you have any idea.... :P this is the very last thing to fix, and then we can fully switch to Chrome! |
issue seems to be that with the current script Chromium 37 is installed LOG MESSAGES FOR: Chromium 37.0.2062 (Ubuntu 0.0.0) INSTANCE #: 35999929
'Initializing melonJS' have not succeed yet to make it install the latest version, and it's kind of difficult to test everytime.... lunch time ! |
https://docs.travis-ci.com/user/chrome was working without it though...
job done ! 13 07 2017 05:03:39.061:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/
13 07 2017 05:03:39.063:INFO [launcher]: Launching browser ChromeHeadless with unlimited concurrency
13 07 2017 05:03:39.073:INFO [launcher]: Starting browser ChromeHeadless
13 07 2017 05:03:41.754:INFO [HeadlessChrome 0.0.0 (Ubuntu 0.0.0)]: Connected on socket JXLIE6HeptKA6X1VAAAA with id 83669012
292
288
0
4
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
-_-_-_-_-_214m-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
292 total 288 passed 0 failed 4 skipped
LOG MESSAGES FOR: HeadlessChrome 0.0.0 (Ubuntu 0.0.0) INSTANCE #: 83669012
'Initializing melonJS'
Done. Unit tests are now using chrome headless ! Interesting exercise, I learned a lot, just by switching from phantomJS to Chrome :) |
Wow! One concern; Chrome 37 is ancient. It's not much better than the ancient WebkitQT in PhantomJS. |
Chrome 59 is the one currently installed with the Trusty distribution, so aaaall gooood! :) |
See https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-the-Chrome-addon-in-the-headless-mode
Then Chrome could be used as a default engine for executing tests, PhantomJS dropped and ES6 used to write tests :).
The text was updated successfully, but these errors were encountered: