Closed Bug 1776589 Opened 2 years ago Closed 2 years ago

add_setup doesn't work in mochitest-plain, but eslint complains about it for mochitest-plain/chrome tests that mistakenly get browser-style test eslint rules applied to it

Categories

(Testing :: Mochitest, defect)

Default
defect

Tracking

(firefox105 fixed)

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: emilio, Assigned: serg)

References

Details

Attachments

(6 files, 1 obsolete file)

No description provided.

The rule is only enabled for where the browser-chrome test configuration is enabled: https://searchfox.org/mozilla-central/rev/bf6f194694c9d1ae92847f3d4e4c15c2486f3200/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/browser-test.js#65

I suspect this is one of the directories where there are different types of tests in the same directory, which makes it really hard for ESLint to distinguish.

We would either need to split the test directory so that the different types of tests are in different sub-directories, or fix bug 1379669.

Summary: add_setup doesn't work in mochitest-plain, but eslint complains about it. → add_setup doesn't work in mochitest-plain, but eslint complains about it for mochitest-plain/chrome tests that mistakenly get browser-style test eslint rules applied to it

Is it possible to fix this by supporting add_setup in mochitest-plain?

(In reply to Rob Wu [:robwu] from comment #2)

Is it possible to fix this by supporting add_setup in mochitest-plain?

If someone wants to write the patch, sure. add_task in mochitest plain is implemented in https://searchfox.org/mozilla-central/rev/435c4ec4fb9d5b6fe491103f56969492a0038bb6/testing/mochitest/tests/SimpleTest/SimpleTest.js#2030-2036 and we'd need a similar-but-not-the-same thing for add_setup so you'd probably need to do a bunch of refactoring.

When I implemented add_setup and realized the add_task implementation was not shared between xpcshell, mochitest plain/chrome and mochitest-browser, I asked if there was demand for plain/chrome add_setup support and got lukewarm-at-best responses in #developers on matrix, so I didn't bother attempting to write support as the mochitest-plain implementation seemed... hairy, and I basically never have to deal with mochitest-plain myself (and most new DOM/layout/whatever tests also end up using wpt, not mochitest).

The severity field is not set for this bug.
:ahal, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(ahal)
Assignee: nobody → sgalich
Status: NEW → ASSIGNED
Attachment #9288171 - Attachment is obsolete: true

Depends on D153504

Pushed by sgalich@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d984655d9fff
add add_setup to  mochitest-plain r=ahal
https://hg.mozilla.org/integration/autoland/rev/ae7ac848f06d
use add_setup() in ./toolkit/components/passwordmgr r=dimi
Pushed by sgalich@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ddff5dcfb118
use add_setup() in browser/components/aboutlogins r=dimi
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
Pushed by sgalich@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0006685a130f
use add_setup in form manager r=dimi
Pushed by sgalich@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5f018139e892
use add_setup() in browser/extensions/formautofill r=dimi
Flags: needinfo?(ahal)
Pushed by sgalich@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b3410187cec3
use add_setup in dom/fs/test/mochitest r=dom-storage-reviewers,edenchuang
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: