Migrate server unit tests to async/await
Categories
(DevTools :: Debugger, enhancement, P3)
Tracking
(firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: bhackett1024, Assigned: chujunlu)
Details
Attachments
(7 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
A lot of server unit tests use somewhat complicated promise based logic for performing their actions. Migrating them to async/await would make them easier to read and maintain.
Comment 1•6 years ago
|
||
Thanks for the report Brian!
What specific tests do you have in mind?
Should this be a meta?
Honza
Reporter | ||
Comment 2•6 years ago
|
||
These are the tests in devtools/server/tests/unit
. This issue came up in bug 1512152 in regard to thread front based tests in that directory, though the issue is more general than those tests specifically.
Comment 3•6 years ago
|
||
This'd be so awesome.
I'd like to take a stab at it.
My understanding of the task is to refactor the tests that use new Promise
or use threadFrontTestFinished
. Is that correct? May I submit a patch with some tests that I refactored to make sure I'm on the right track? Thanks! I might break this into more than one patches.
I refactored some of the unit tests to see if I'm on the right direction. If so, I'll continue with other unit tests.
Updated•6 years ago
|
Comment 6•6 years ago
|
||
![]() |
||
Comment 7•6 years ago
|
||
bugherder |
The 3 test_objectgrips-fn-apply
tests and 3 test_objectgrips-property-value
tests used somewhat complicated callbacks returning promise
. I thought they were not easy to read, and I might fail to understand its subtleness. I wondered why the tests were written in that way?
Updated•6 years ago
|
Assignee | ||
Comment 10•6 years ago
|
||
Remove threadFrontTestFinished
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
![]() |
||
Comment 13•6 years ago
|
||
bugherder |
Comment 14•6 years ago
|
||
![]() |
||
Comment 15•6 years ago
|
||
bugherder |
Assignee | ||
Comment 16•6 years ago
|
||
test_breakpoint-25.js
is wip.
Comment 17•6 years ago
|
||
![]() |
||
Comment 18•6 years ago
|
||
bugherder |
Assignee | ||
Comment 19•6 years ago
|
||
Remove threadFrontTestFinished
Assignee | ||
Comment 20•6 years ago
|
||
This should be the last patch for refactoring server xpcshell test. Thanks for the code reviews all the way. I would suggest reviewing and merging part6 first, since part7 removes waitForFinish, an option that part6 test files currently use.
Comment 21•6 years ago
|
||
![]() |
||
Comment 22•6 years ago
|
||
bugherder |
Description
•