Skip to content
This repository has been archived by the owner on Mar 21, 2018. It is now read-only.

Renderer tests 2 #476

Merged
merged 5 commits into from
May 25, 2016
Merged

Renderer tests 2 #476

merged 5 commits into from
May 25, 2016

Conversation

jsantell
Copy link
Contributor

@jsantell jsantell commented May 19, 2016

Attempting to land renderer tests again -- a few failures.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 42.34% when pulling bd5cad8 on jsantell:renderer-tests-2 into b93be0a on mozilla:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 42.362% when pulling f95ad9c on jsantell:renderer-tests-2 into b93be0a on mozilla:master.

@jsantell jsantell force-pushed the renderer-tests-2 branch from f95ad9c to a041c19 Compare May 19, 2016 23:26
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 42.317% when pulling a041c19 on jsantell:renderer-tests-2 into 094ced1 on mozilla:master.

@jsantell jsantell force-pushed the renderer-tests-2 branch from a041c19 to 265af00 Compare May 20, 2016 05:41
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 42.473% when pulling 265af00 on jsantell:renderer-tests-2 into 15009db on mozilla:master.

@jsantell
Copy link
Contributor Author

So after some digging, it looks like we get an exit code of 3221225477 on windows, which may be from calling require('babel-register')() (electron/electron#3570) to transpile app code, which may be related to running it as an npm script (sass/node-sass#1283).

On Linux on CI, it just fails with error code 1.

No idea.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 42.519% when pulling dc6c03d on jsantell:renderer-tests-2 into 15009db on mozilla:master.

@victorporof
Copy link
Contributor

coverage increased, we should land this

@jsantell
Copy link
Contributor Author

Not using babel in electron-mocha doesn't fix failures.

@jsantell
Copy link
Contributor Author

jsantell commented May 20, 2016

Running renderer tests that does not use any of our application code or babel still results in exit code 1 on linux, and passes on Windows, but the test doesn't even run on Windows somehow.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 42.655% when pulling 50e4116 on jsantell:renderer-tests-2 into 15009db on mozilla:master.

@jsantell jsantell force-pushed the renderer-tests-2 branch 3 times, most recently from 09435ad to e25cfaa Compare May 24, 2016 20:19
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 42.6% when pulling e25cfaa on jsantell:renderer-tests-2 into 62c5895 on mozilla:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 42.6% when pulling 08d845b on jsantell:renderer-tests-2 into 62c5895 on mozilla:master.

@jsantell jsantell force-pushed the renderer-tests-2 branch from 78b0930 to 4faaa9e Compare May 25, 2016 04:48
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 41.917% when pulling 4faaa9e on jsantell:renderer-tests-2 into 0cf32f9 on mozilla:master.

@jsantell
Copy link
Contributor Author

Failing with same error as on CI on local windows install:

 renderer - sanity checks
    √ has access to expected globals
    √ renders basic components


  2 passing (322ms)

Error: Object has been destroyed
    at Error (native)
    at EventEmitter.webContents.send (C:\Users\IEUser\Dev\tofino\.electron\resources\electron.asar\browser\api\web-contents.js:80:17)
    at EventEmitter.<anonymous> (C:\Users\IEUser\Dev\tofino\.electron\resources\electron.asar\browser\guest-view-manager.js:140:28)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
Error: Object has been destroyed
    at Error (native)
    at EventEmitter.webContents.send (C:\Users\IEUser\Dev\tofino\.electron\resources\electron.asar\browser\api\web-contents.js:80:17)
    at EventEmitter.<anonymous> (C:\Users\IEUser\Dev\tofino\.electron\resources\electron.asar\browser\guest-view-manager.js:140:28)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
Build failed.
Error: Child process C:\Users\IEUser\Dev\tofino\node_modules\.bin\electron-mocha.cmd exited with exit code 3221225477
    at ChildProcess.<anonymous> (C:\Users\IEUser\Dev\tofino\build\utils.js:9:1823)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "test"
npm ERR! node v6.2.0
npm ERR! npm  v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test: `cross-env NODE_ENV="production" nyc -s node build/main.js --test`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script 'cross-env NODE_ENV="production" nyc -s node build/main.js --test'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the tofino package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV="production" nyc -s node build/main.js --test
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs tofino
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls tofino
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\IEUser\Dev\tofino\npm-debug.log

and same with linux (same error as CI)

@jsantell jsantell force-pushed the renderer-tests-2 branch from 4faaa9e to 2777bd8 Compare May 25, 2016 17:03
@jsantell
Copy link
Contributor Author

Windows and Linux was failing due to passing in a custom env (with ELECTRON_PATH) into the electron-mocha process, which spawns its own electron process, which something requires a default/current environment (and since the electron-mocha process we use a custom env, we clobber that.)

Fixed via env: Object.assign({}, process.env, { ELECTRON_PATH: getElectronPath() }).

Linux now working (I think).

Windows is failing due to a "Object has been destroyed" error fired by something in the main process, after all tests pass, and the electron app is in the process of being destroyed. Trying to ignore this error doesn't help. Forcing process.exit(code) when mocha is done results in an OOM. Looking into ways of waiting/draining events over IPC before exiting the app/process

@coveralls
Copy link

coveralls commented May 25, 2016

Coverage Status

Coverage increased (+0.1%) to 41.89% when pulling 2777bd8 on jsantell:renderer-tests-2 into b94c5b1 on mozilla:master.

@coveralls
Copy link

coveralls commented May 25, 2016

Coverage Status

Coverage increased (+0.4%) to 42.152% when pulling 47586a0 on jsantell:renderer-tests-2 into b94c5b1 on mozilla:master.

document.body.appendChild(container);

// Require these so we can transpile the client code on the fly
// require('babel-polyfill');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing these and adding in a follow up -- was originally a source of failure, but things are working now and this will be the next step

@victorporof
Copy link
Contributor

r+

…very basic test running in the renderer process. r=vporof'""

This reverts commit b93be0a.
@jsantell jsantell force-pushed the renderer-tests-2 branch from 2faf6d8 to cfb3c4d Compare May 25, 2016 18:56
@jsantell jsantell merged commit cfb3c4d into mozilla:master May 25, 2016
@coveralls
Copy link

coveralls commented May 25, 2016

Coverage Status

Coverage increased (+0.3%) to 42.095% when pulling 2faf6d8 on jsantell:renderer-tests-2 into b94c5b1 on mozilla:master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants