Define typescript interface for options of method to make screenshots

Seems like i fixed it.
Just removed all node_modules, package-lock.json, dist and temp folder.
Then I did pulling upstream and npm install in the tools/gulp

Sorry for panic =)

np glad it works, I was running out of ideas :slight_smile:

What about ideas for why firefox crashes while testing?


tests-log.zip (2.4 KB)

[21:17:06] Starting 'tests-validation-virtualscreen'...
29 07 2019 21:17:06.539:WARN [config]: urlRoot normalized to "/karma/"
29 07 2019 21:17:06.836:WARN [filelist]: Pattern "C:/OpenServer/domains/babylon.js/!./**/*.d.ts" does not match any file.
29 07 2019 21:17:06.836:WARN [filelist]: Pattern "C:/OpenServer/domains/babylon.js/favicon.ico" does not match any file.
29 07 2019 21:17:10.229:INFO [karma-server]: Karma v4.2.0 server started at http://0.0.0.0:3000/karma/
29 07 2019 21:17:10.230:INFO [launcher]: Launching browsers Firefox with concurrency 1
29 07 2019 21:17:10.232:INFO [launcher]: Starting browser Firefox
29 07 2019 21:17:10.339:ERROR [launcher]: Cannot start Firefox

29 07 2019 21:17:10.340:ERROR [launcher]: Firefox stdout:
29 07 2019 21:17:10.340:ERROR [launcher]: Firefox stderr:
29 07 2019 21:17:13.378:INFO [launcher]: Trying to start Firefox again (1/2).
29 07 2019 21:17:13.378:WARN [temp-dir]: Failed to create a temp dir at C:\Users\dok\AppData\Local\Temp\karma-46434293
29 07 2019 21:17:13.433:INFO [Firefox 68.0.0 (Windows 10.0.0)]: Connected on socket 1ab7F-2_xGPrfZK9AAAE with id 46434293
LOG: 'Babylon.js v4.1.0-alpha.11 - WebGL2'
LOG: 'Scripts loaded'
LOG: 'Webgl Version: WebGL 2.0'
LOG: 'Webgl Vendor: Google Inc.'
LOG: 'Webgl Renderer: ANGLE (NVIDIA GeForce GTX 1060 6GB Direct3D11 vs_5_0 ps_5_0)'
LOG: 'Running Basis loader'
LOG: '%c validated', 'color: green'
Firefox 68.0.0 (Windows 10.0.0): Executed 0 of 121 SUCCESS (0 secs / 0 secs)
29 07 2019 21:17:18.655:ERROR [launcher]: Firefox crashed.

Never seen this :frowning: Any translation of the error ?

Oh yes
Tow messages: Firefox is already running, but not responding. To open a new window, the running Firefox process must be completed.

And I attached log file with messages from console.

Firefox v 68.0.1

Could you try closing completely FF before running the process ?

Also it is nice to check before I usually only launch npm start locally and rely on the continuous integration to check my build results for the rest of the process :slight_smile: It speeds up quite a lot my iterations.

Yes, I tryed and searched these processes in in the windows Task Managaer.
Currently http://localhost:1338/tests/validation/index.html pass tests fine in the Firefox

I will continue my research =)

Yup it is really weird but as long as the validation page passes the tests, you are pretty safe to do a PR :slight_smile:

Try with an older firefox should work :frowning:

It is related to Random errors : cannot start Firefox/FirefoxHeadless ยท Issue #93 ยท karma-runner/karma-firefox-launcher ยท GitHub we can repro on FF 68+ :frowning: I ll try to have a fox ASAP

2 Likes

All tests are passed but here that does not contain tests for screenshotTools exclude Custom render target.
And I dont know how can write test. I see folder with tests but currently dont realize how to do it. Have you some guide for this purpose?

Anyway please check my PR ScreenshotTools. Implementation usage of precision in combination height and width params by Dok11 ยท Pull Request #6644 ยท BabylonJS/Babylon.js ยท GitHub

The PR is goood !!! tests might be a bit tricky for this one. You could for instance write a unit test for the new private getSize function ? This might need to mock a bit more the canvas.

That said, the main getScreenshot function is used heavily during the visual tests so the main path is covered Agree it could be neat to cover all of them but this has a low code churn so your PR is all good.

It may be interesting but I need see example of a test or some guide for common approach to writing it in this system

Yes =)

The unit tests are all available in Babylon.js/tests/unit/babylon/src at master ยท BabylonJS/Babylon.js ยท GitHub

And you can find some examples here: Babylon.js/babylon.example.tests.ts at master ยท BabylonJS/Babylon.js ยท GitHub

Adding tests here will automatically be used during the Continuous Integration step.

When it will be available in release? Or how I can use latest build in my projects through package.json?

I will need to release a new npm package tomorrow for other issues, so I guess tomorrow evening. You can not unfortunately point to our repo directly from npm as it does not follow the same structure than the package.

Can that wait tomorrow ?

Ofcourse.
I thought what it may be available like "@babylonjs/core": "^4.1.0.alpha.1",. Somewhere I was seeing that approach for alpha versions.

4.1.0-alpha.12 has been deployed :slight_smile:

1 Like

I remove node_modules and package-lock.json, then run npm i and when try serve app I got errors:

ERROR in node_modules/@babylonjs/loaders/node_modules/@babylonjs/core/Engines/engine.d.ts:8:10 - error TS2305: Module '"/node_modules/@babylonjs/loaders/node_modules/@babylonjs/core/Engines/engine"' has no exported member 'IDisplayChangedEventArgs'.

8 import { IDisplayChangedEventArgs } from "../Engines/engine";
           ~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@babylonjs/loaders/node_modules/@babylonjs/core/Engines/engine.d.ts:2527:5 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'XRWebGLLayer' must be of type '{ new (session: XRSession, context: WebGLRenderingContext): XRWebGLLayer; prototype: XRWebGLLayer; }', but here has type '{ new (session: XRSession, context?: WebGLRenderingContext): XRWebGLLayer; prototype: XRWebGLLayer; }'.

2527 var XRWebGLLayer: {
         ~~~~~~~~~~~~

Do yoy have some idea what I can do with it?