Closed
Bug 1392098
Opened 7 years ago
Closed 7 years ago
Write a rule to remove cases of run_test that aren't needed
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement)
Tracking
(firefox57 fixed)
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
Details
Attachments
(2 files)
Bug 982852 made run_test() in xpcshell tests optional. There's still quite a few cases where we do:
function run_test() {
run_next_test();
}
despite the fact that xpcshell's head.js defines this for us. Hence this is just extra noise in test files.
I keep on coming across these (and cleaning them up), so I've decided it is time just to get a rule setup with fix capability and remove them completely.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8899277 [details]
Bug 1392098 - Enable the new ESLint no-useless-run-test rule across the tree.
https://reviewboard.mozilla.org/r/170516/#review176498
Attachment #8899277 -
Flags: review?(dtownsend) → review+
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8899276 [details]
Bug 1392098 - Add an ESLint rule to avoid unnecessary run_test() functions.
https://reviewboard.mozilla.org/r/170514/#review176500
Do you happen to know if eslint's test harness verifies that the fixer is producing valid code?
Attachment #8899276 -
Flags: review?(dtownsend) → review+
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fde66058d330
Add an ESLint rule to avoid unnecessary run_test() functions. r=mossop
https://hg.mozilla.org/integration/autoland/rev/2dd4fb2e079a
Enable the new ESLint no-useless-run-test rule across the tree. r=mossop
Assignee | ||
Comment 8•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8899276 [details]
Bug 1392098 - Add an ESLint rule to avoid unnecessary run_test() functions.
https://reviewboard.mozilla.org/r/170514/#review176500
I just did an experiment that left the closing brace of the function in the code - it correctly returned that there was a parsing error. I've also just seen in the documentation (https://eslint.org/docs/developer-guide/working-with-rules#applying-fixes):
```
After applying fixes, ESLint will run all of the enabled rules again on the fixed code, potentially applying more fixes. This process will repeat up to 10 times, or until no more fixable problems are found.
```
Comment 9•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fde66058d330
https://hg.mozilla.org/mozilla-central/rev/2dd4fb2e079a
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Updated•7 years ago
|
Product: Testing → Firefox Build System
Updated•6 years ago
|
Version: Version 3 → 3 Branch
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•