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

Core: Support running in WorkerGlobalScope #1171

Merged
merged 1 commit into from May 21, 2017
Merged

Core: Support running in WorkerGlobalScope #1171

merged 1 commit into from May 21, 2017

Conversation

ghost
Copy link

@ghost ghost commented Apr 26, 2017

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

@jsf-clabot
Copy link

jsf-clabot commented Apr 26, 2017

CLA assistant check
All committers have signed the CLA.

This adds support to QUnit for running a test suite inside Web/Service
Worker context.
Copy link
Member

@trentmwillis trentmwillis left a 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.

@ghost
Copy link
Author

ghost commented Apr 26, 2017

@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.

@ghost
Copy link
Author

ghost commented Apr 26, 2017

See: ariya/phantomjs#13653

Copy link
Member

@trentmwillis trentmwillis left a 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.

@trentmwillis
Copy link
Member

@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>
Copy link
Member

@Krinkle Krinkle May 19, 2017

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!

@trentmwillis trentmwillis merged commit ed8fb54 into qunitjs:master May 21, 2017
@trentmwillis
Copy link
Member

Merged. Thanks, @martndemus!

@ghost
Copy link
Author

ghost commented May 22, 2017

Yay! Thanks!

@ghost ghost deleted the make-work-on-worker branch May 22, 2017 07:00
Krinkle added a commit that referenced this pull request Aug 9, 2021
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.
Krinkle added a commit to Krinkle/qunit that referenced this pull request Aug 9, 2021
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.
Krinkle added a commit to Krinkle/qunit that referenced this pull request Aug 9, 2021
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.
Krinkle added a commit that referenced this pull request Aug 9, 2021
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants