Skip to content
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

Convert the files in the /test/unit folder to ES6 modules #8298

Merged
merged 1 commit into from
Apr 30, 2017

Conversation

timvandermeij
Copy link
Contributor

@timvandermeij timvandermeij commented Apr 16, 2017

The SystemJS module loader has a very low impact on the runtime of the unit tests. Locally, the runtime increased from 20.4 seconds to 21.9 seconds, so that should be fine.

Slightly easier reviewing with https://github.com/mozilla/pdf.js/pull/8298/files?w=1.

@timvandermeij
Copy link
Contributor Author

/botio unittest

@timvandermeij
Copy link
Contributor Author

/botio-linux unittest

@@ -38,33 +38,31 @@

// Modified jasmine's boot.js file to load PDF.js libraries async.

'use strict';
Copy link
Collaborator

@Snuffleupagus Snuffleupagus Apr 17, 2017

Choose a reason for hiding this comment

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

The actual test files are being parsed by SystemJS, which will add a 'use strict'; directive to each module, but unless I'm mistaken this file runs as-is in the browser.

Hence it may be a good idea to keep this line, such that this file still runs in strict mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in the new commit.

@@ -1,5 +1,3 @@
'use strict';
Copy link
Collaborator

Choose a reason for hiding this comment

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

The actual test files are being parsed by SystemJS, which will add a 'use strict'; directive to each module, but unless I'm mistaken this file runs as-is in the browser.

Hence it may be a good idea to keep this line, such that this file still runs in strict mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in the new commit.

@timvandermeij
Copy link
Contributor Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/452829772e172f5/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://54.215.176.217:8877/ce04226cdf08761/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/ce04226cdf08761/output.txt

Total script time: 6.86 mins

  • Unit Tests: Passed

@timvandermeij
Copy link
Contributor Author

/botio-linux-new unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/0b7a14a7dbd5705/output.txt

@timvandermeij
Copy link
Contributor Author

timvandermeij commented Apr 17, 2017

@yurydelendik @brendandahl The Linux bots have some kind of issue with Firefox, but I'm not sure it's related to this patch. Could you check if there are logs or hanging processes? Maybe a reboot would be enough.

The unit tests run fine using Firefox on Linux locally, and also on Travis and the Windows bot.

@yurydelendik
Copy link
Contributor

/botio-linux test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @yurydelendik received. Current queue size: 0

Live output at: http://107.21.233.14:8877/cc003856ca29ba8/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/cc003856ca29ba8/output.txt

Total script time: 31.65 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@Snuffleupagus
Copy link
Collaborator

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.21.233.14:8877/6065694e41a2ecc/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/dedb42833eeec26/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/dedb42833eeec26/output.txt

Total script time: 24.44 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Failed

Full output at http://107.21.233.14:8877/6065694e41a2ecc/output.txt

Total script time: 60.00 mins

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Apr 18, 2017

The SystemJS module loader has a very low impact on the runtime of the unit tests. Locally, the runtime increased from 20.4 seconds to 21.9 seconds, so that should be fine.

Even though the code changes themselves look fine, I cannot help wondering if the slight increase in runtime is somehow connected with the frequent timeouts/issues on the Linux bot that we've seen above?

Anyway, despite the diff looking fine, I'll hold off on landing this for now until we're certain that this PR isn't somehow contributing to the Linux issues.

@timvandermeij
Copy link
Contributor Author

timvandermeij commented Apr 18, 2017

It looks like Firefox doesn't even start the unit tests at all. Really weird because I run it all the time on Linux without issues. Are the bots doing something special, or are there any logs telling us why Firefox won't even start or what it's doing all the time before it times out?

@yurydelendik
Copy link
Contributor

/botio-linux test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @yurydelendik received. Current queue size: 0

Live output at: http://107.21.233.14:8877/6b97f9352f288ce/output.txt

@yurydelendik
Copy link
Contributor

/botio-linux test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @yurydelendik received. Current queue size: 0

Live output at: http://107.21.233.14:8877/36be359da818e30/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Failed

Full output at http://107.21.233.14:8877/36be359da818e30/output.txt

Total script time: 60.00 mins

@Snuffleupagus
Copy link
Collaborator

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.21.233.14:8877/03569c2a1376096/output.txt

@timvandermeij
Copy link
Contributor Author

I have rebased the patch and resolved merge conflicts. The bots have recently received many updates as well, so we should be good now.

@timvandermeij
Copy link
Contributor Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/2140866520f00ef/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 1

Live output at: http://54.215.176.217:8877/6f71668c680625b/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/2140866520f00ef/output.txt

Total script time: 5.05 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/6f71668c680625b/output.txt

Total script time: 6.62 mins

  • Unit Tests: Passed

@timvandermeij
Copy link
Contributor Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/daea6a63404f0f2/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @timvandermeij received. Current queue size: 0

Live output at: http://54.215.176.217:8877/903126dbd75dfd3/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/daea6a63404f0f2/output.txt

Total script time: 5.18 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/903126dbd75dfd3/output.txt

Total script time: 6.62 mins

  • Unit Tests: Passed

@Snuffleupagus
Copy link
Collaborator

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.21.233.14:8877/eccb34d8fc33a46/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/8a50ce356b06d6c/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/eccb34d8fc33a46/output.txt

Total script time: 5.63 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/8a50ce356b06d6c/output.txt

Total script time: 6.47 mins

  • Unit Tests: Passed

@Snuffleupagus
Copy link
Collaborator

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.21.233.14:8877/2e3bc45239cba04/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/9e10abe19ae611d/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/2e3bc45239cba04/output.txt

Total script time: 5.63 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/9e10abe19ae611d/output.txt

Total script time: 6.64 mins

  • Unit Tests: Passed

@Snuffleupagus
Copy link
Collaborator

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.21.233.14:8877/e52b48591f602ab/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/80f578b50f94a53/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/e52b48591f602ab/output.txt

Total script time: 5.23 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/80f578b50f94a53/output.txt

Total script time: 6.60 mins

  • Unit Tests: Passed

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

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

Nice diff stats (+146 −528); thank you for the patch!

@Snuffleupagus Snuffleupagus merged commit 00d6737 into mozilla:master Apr 30, 2017
@timvandermeij timvandermeij deleted the es6-modules-test branch April 30, 2017 19:02
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
Convert the files in the `/test/unit` folder to ES6 modules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants