-
Notifications
You must be signed in to change notification settings - Fork 781
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
Core: Support running in WorkerGlobalScope #1171
Conversation
This adds support to QUnit for running a test suite inside Web/Service Worker context.
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.
This is because PhantomJS has a broken Web Worker implementation.
What exactly is broken with it? Is it fixed in a newer version?
Regardless, I think we should adopt a different headless browser solution, but I don't want to block landing this on that.
@trentmwillis Basically PhantomJS has a Web Worker implementation since 1.9.8 that doesn't actually work and has never been fixed in any later versions. |
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.
Thanks for the info.
Pulled this down and tested it locally and it seems good to me! I do want at least one other review from a maintainer before merging though.
@qunitjs/qunit-team would appreciate it if one of y'all could review |
<meta charset="UTF-8"> | ||
<title>QUnit Web Worker Test Suite</title> | ||
<link rel="stylesheet" href="../dist/qunit.css"> | ||
<script src="../dist/qunit.js"></script> |
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.
Thought at first that we don't need to load qunit.js
here, but I understand now. You're using it to create an async test and receive the results. LGTM!
Merged. Thanks, @martndemus! |
Yay! Thanks! |
Several of the HTML test suites were previously omitted from CI, as they either couldn't pass on PhantomJS, or were simply forgotten. * Add test/headless.html. Also updated to use `QUnit.on()`, and to hide debug messages when run in CI to avoid adding this noise. * Add test/module-filter.html * Add test/performance-mark.html * Add test/webWorker.html. Ref #1171. * Remove test/each.html. Duplicate of test/index.html. * Remove test/stack-errors.html. Redundant with other tests for "noglobals" and "onUncaughtError" outside test context etc. * Improve test/sandboxed-iframe.html, which was passing CI but failing manually, due to undefined `__grunt_contrib_qunit__`. We now define a fallback locally to ease debugging. Added to test-on-node: test/module-skip.js, test/module-todo.js. These were disabled due to use of hacky `QUnit.done()`, but that was recently fixed with 78bda44. Also add various main tests to test/webWorker.js, which had not been updated in a while. The next commit will add a meta CLI test that ensures that these are all in sync to avoid staleness in the future. Ref #1511.
Several of the HTML test suites were previously omitted from CI, as they either couldn't pass on PhantomJS, or were simply forgotten. * Add test/headless.html. Also updated to use `QUnit.on()`, and to hide debug messages when run in CI to avoid adding this noise. * Add test/module-filter.html * Add test/performance-mark.html. Ref qunitjs#1319. * Add test/webWorker.html. Ref qunitjs#1171. * Remove test/each.html. Duplicate of test/index.html. * Remove test/stack-errors.html. Redundant with other tests for "noglobals" and "onUncaughtError" outside test context etc. * Improve test/sandboxed-iframe.html, which was passing CI but failing manually, due to undefined `__grunt_contrib_qunit__`. We now define a fallback locally to ease debugging. Added to test-on-node: test/module-skip.js, test/module-todo.js. These were disabled due to use of hacky `QUnit.done()`, but that was recently fixed with 78bda44. Also add various main tests to test/webWorker.js, which had not been updated in a while. The next commit will add a meta CLI test that ensures that these are all in sync to avoid staleness in the future. Ref qunitjs#1511.
Several of the HTML test suites were previously omitted from CI, as they either couldn't pass on PhantomJS, or were simply forgotten. * Add test/headless.html. Also updated to use `QUnit.on()`, and to hide debug messages when run in CI to avoid adding this noise. * Add test/module-filter.html * Add test/performance-mark.html. Ref qunitjs#1319. * Add test/webWorker.html. Ref qunitjs#1171. * Remove test/each.html. Duplicate of test/index.html. * Remove test/stack-errors.html. Redundant with other tests for "noglobals" and "onUncaughtError" outside test context etc. * Improve test/sandboxed-iframe.html, which was passing CI but failing manually, due to undefined `__grunt_contrib_qunit__`. We now define a fallback locally to ease debugging. Added to test-on-node: test/module-skip.js, test/module-todo.js. These were disabled due to use of hacky `QUnit.done()`, but that was recently fixed with 78bda44. Also add various main tests to test/webWorker.js, which had not been updated in a while. The next commit will add a meta CLI test that ensures that these are all in sync to avoid staleness in the future. Ref qunitjs#1511.
Several of the HTML test suites were previously omitted from CI, as they either couldn't pass on PhantomJS, or were simply forgotten. * Add test/headless.html. Also updated to use `QUnit.on()`, and to hide debug messages when run in CI to avoid adding this noise. * Add test/module-filter.html * Add test/performance-mark.html. Ref #1319. * Add test/webWorker.html. Ref #1171. * Remove test/each.html. Duplicate of test/index.html. * Remove test/stack-errors.html. Redundant with other tests for "noglobals" and "onUncaughtError" outside test context etc. * Improve test/sandboxed-iframe.html, which was passing CI but failing manually, due to undefined `__grunt_contrib_qunit__`. We now define a fallback locally to ease debugging. Added to test-on-node: test/module-skip.js, test/module-todo.js. These were disabled due to use of hacky `QUnit.done()`, but that was recently fixed with 78bda44. Also add various main tests to test/webWorker.js, which had not been updated in a while. The next commit will add a meta CLI test that ensures that these are all in sync to avoid staleness in the future. Ref #1511.
This adds support to QUnit for running a test suite inside Web/Service
Worker context.
I have written a test for, but haven't yet added them to any of the test
suites. This is because PhantomJS has a broken Web Worker
implementation. The test runs fine in Chrome/Safari/Firefox and likely
any other browser. Guidance on how to proceed with this would be
appreciated.
Closes #1022