-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Upgrade to Mochify 5 to run tests in Headless Chrome #1629
Conversation
This brings the number of tests that are executed up to the same number as in Chrome and Firefox (+21). These tests where skipped in PhantomJS due to missing features. It also allows the WebWorker test script to be simplified removing mocaccino, phantomic and phantomjs-prebuilt from the dependencies. Fixes #1405
Uuuh, so the main issue with this PR is that Mochify does requires Node 6 at install time because of the Puppeteer download script being written in a Node 4 incompatible way. This is annoying because we're not even running Mochify on Node 4. Anybody a clever idea how to either exclude Mochify from the install or how to prevent the install script from being executed? |
Circle CI Node 8: |
No clever thoughts on the Node 4 thing. We could just skip it? With regards to the crashing on Node 8: dependencies:
pre:
- sudo apt-get update; sudo apt-get install libx11-xcb1 |
@@ -19,6 +19,8 @@ env: | |||
before_install: | |||
- npm config set strict-ssl false | |||
- npm install coveralls | |||
# Prevent mochify -> puppeteer install script to run unnecessarily | |||
- if [ "x$TRAVIS_NODE_VERSION" != "x8" ]; then npm config set ignore-scripts true; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was new! Cool to know.
So it failed again on Node 4, but I don't understand why. It says it executed this:
But the
|
Oh, I mixed up the Travis config and the Circle CI. Will you update the Circle CI config, @mantoni? |
Yeah, I just experimented with the Travis build as I don't know much about CircleCI yet. I think we could do a similar hack there and maybe only run Mochify on Node 6 and disable the install script otherwise. Once is enough anyway. |
7a0e230
to
538af0c
Compare
Err, I don't really understand what't going on in the CircleCI Node 6 build now. The pre-test thingy sais |
@mantoni For some reason the v6 is running POSIX shell, not Bash, while the other runners use Bash. Version 6:
Version 4:
|
Anyway, it works, so I think this is ready for merge! The change for shell is outside the config, and perhaps something @fearphage might know about? It's probably in the VM setup for Circle CI. |
Well, it doesn't seem to run the browser tests on CircleCI because of that. Testing something else now. |
538af0c
to
879a6a0
Compare
test/webworker/webworker-script.js
Outdated
@@ -4,7 +4,7 @@ | |||
|
|||
// Abort if we are not running in a WebWorker | |||
if (typeof importScripts !== "undefined") { | |||
importScripts("../../pkg/sinon.js"); | |||
importScripts("https://localhost:8080/pkg/sinon.js"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be just "/pkg/sinon.js"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Adjusted in b3cd2d8.
@@ -8,7 +8,7 @@ if (typeof Worker !== "undefined") { | |||
|
|||
describe("WebWorker support", function () { | |||
it("should not crash", function (done) { | |||
var worker = new Worker("file://" + __dirname + "/webworker-script.js"); | |||
var worker = new Worker("https://localhost:8080/test/webworker/webworker-script.js"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto: could be made relative.
Also slightly disturbing is the drop in tests being executed in |
This is an exciting PR, watching from the sidelines (with popcorn) |
b3cd2d8
to
83a9a5d
Compare
83a9a5d
to
93f422a
Compare
I got the conditionals fixed for the CircleCI build. Also, it's necessary to activate npm scripts again after installing or Now there's a new issue with launching chroming:
I tried with a ssh session and don't see what the problem is. The issues that people are seeing with missing libraries seem to be something else – maybe we're going to run into those once we can actually run the chrome binary. The thing is, we have a nicely working Travis build and if CircleCI is giving us a hard time, I don't see the point putting more effort into it. |
@sinonjs/sinon-core I'd rather remove the headless test-runs from CircleCI for now (or comment them out). What do you think? |
.circleci/config.yml
Outdated
@@ -18,12 +18,19 @@ jobs: | |||
name: Install dependencies | |||
command: | | |||
npm config set strict-ssl false | |||
NODE_VERSION=$(node --version) | |||
if [[ ${NODE_VERSION:0:3} != "v6." ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MINOR: if [[ ! "$(node --version)" =~ ^v6 ]]; then
.circleci/config.yml
Outdated
command: | | ||
if [[ ! "$(node --version)" =~ ^v4 ]]; then | ||
NODE_VERSION=$(node --version) | ||
if [[ ${NODE_VERSION:0:3} == "v6." ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MINOR: if [[ "$(node --version)" =~ ^v6 ]]; then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is what I tried first, but it failed saying that =~
was an invalid operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, fair enough. I didn't look at the history.
Since nobody seems to have a strong opinion, I removed the headless test script invocations on CircleCI for now. The tests run successfully on Travis which has to be good enough. If we want to move entirely to CircleCI, the Headless Chromium issue is a blocker. I also realized that we've been generating the coverage reports on each node version in the Travis build. I've put an With these changes the build is green. Merge? |
b98be3b
to
b51d5b9
Compare
We can look into the circleci tests at some point, but I think it should be in a separate PR as long as Travis is running them. |
Changes Unknown when pulling b51d5b9 on headless-chrome into ** on master**. |
I think we should merge this |
Thanks everybody! 🚀 |
* reverts parts of sinonjs#1629
* reverts parts of sinonjs#1629
This brings the number of tests that are executed up to the same number
as in Chrome and Firefox (+21). These tests where skipped in PhantomJS
due to missing features.
It also allows the WebWorker test script to be simplified removing
mocaccino, phantomic and phantomjs-prebuilt from the dependencies.
Fixes #1405
Open issues:
npm run test-coverage
hits only 639 tests while it used to run 1138.