Closed Bug 1599991 Opened 11 months ago Closed 11 months ago

Copy mozmill tests to mochitest


(Thunderbird :: Testing Infrastructure, task)

Not set


(Not tracked)

Thunderbird 73.0


(Reporter: darktrojan, Assigned: darktrojan)


(Depends on 2 open bugs)



(1 file)

This bug is about getting all of the tests into the mochitest suite, not necessarily all passing or even all running. This is mostly a mechanical transformation although I've made some extra changes to get the vast majority of the tests running and passing.

Here's what I've done:

  • hg copy'd all of the files from mail/test/mozmill to mail/test/browser to preserve as much history as possible
  • renamed each test file from test-this-feature.js to browser_thisFeature.js to match the naming convention
  • moved support files into their own directory if they didn't already have one
  • added a mochitest manifest to each directory, where necessary copying in prefs from mail/test/mozmill/

In the files themselves:

  • fixed references to the mozmill JSMs since they won't be available at chrome://mozmill any more
  • wrapped functions named testFooBar and setupModule in add_task(…)
  • wrapped functions named teardownModule in registerCleanupFunction(…)
  • called setupTest and teardownTest from test functions, as mochitest doesn't do this
  • replaced all instances of assert_equals, assert_not_equals, assert_true, and assert_false with their equivalent
  • if a test has none of the above, add a report at the end checking the test ran to completion, so that mochitest stops complaining it did nothing

Once these tests are in the tree and we have enough of them running, we can turn mozmill off and make further improvements. Currently the two suites share the JSMs in mail/test/mozmill/shared-modules so I want to keep them unchanged as much as possible.

I think it's best if we don't land this until after merge day next week. I'll put up a patch for review now anyway in case somebody has too much coffee and needs some reading material that will bore them to sleep at night.

Here it is, for your "entertainment".

Attachment #9112223 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9112223 [details] [diff] [review]

Review of attachment 9112223 [details] [diff] [review]:

rs=mkmelin assumig they pass
Attachment #9112223 - Flags: review?(mkmelin+mozilla) → review+

Good work there. Good that there are just some tiny syntactical changes needed to make the tests run on mochitest.
I wonder when all this breaks in the future by mochitest assuming too much about being run in a browser, not TB. All that "browser_" naming does add much confidence.

Pushed by
Copy mozmill tests to mochitest; r=mkmelin

Closed: 11 months ago
Resolution: --- → FIXED

Pushed with some very minor changes to improve the reliability of some tests.

Target Milestone: --- → Thunderbird 73.0
Pushed by
follow-up - Set mail.startup.enabledMailCheckOnce to prevent tests trying to check mail at start-up; rs=bustage-fix DONTBUILD
Depends on: 1601469
Depends on: 1601484
Depends on: 1601517
Depends on: 1601518
Depends on: 1601520
You need to log in before you can comment on or make changes to this bug.