Open Bug 500753 Opened 15 years ago Updated 2 years ago

add ability to do mochitests tests with fakeserver

Categories

(Thunderbird :: Testing Infrastructure, defect)

defect

Tracking

(Not tracked)

People

(Reporter: Bienvenu, Unassigned)

References

Details

Attachments

(1 file)

Having fakeserver available from mozmill tests would really help with imap testing (and to a lesser extent, Pop3). I can imagine it would help with compose/send issues too. On IRC, Standard8 says that runtest.py needs support for this, and it should be possible since it's similar to what firefox does with httpd.
Blocks: 505545
Component: Build Config → Testing Infrastructure
QA Contact: build-config → testing-infrastructure
Isn't that what http://mxr.mozilla.org/comm-central/source/mail/test/mozmill/shared-modules/test-nntp-helpers.js does?

So this bug is just about extending this to other fakeservers such as imap and pop3?
This bug predates that file. And, from what I recall, we don't actually *use* the fakeserver in that test (as in, spawn the server and use sockets); ISTR there being issues as well with using fakeserver in general from mozmill, but my recollections are two years old at this point.

One usability concern about fakeserver is this: when I first wrote mozmill, I didn't know what I was doing, and it predates most of our xpcshell infrastructure, such as asyncTestUtils or messageGenerator. Five years later, there's a clearer idea of what tests actually look like, so the basic high-level API for using fakeserver should look like:

let gImapServer = createIMAPServer({
  username: "tinderbox",
  password: "password",
  ssl: true,
  port: 1143,
  configuration: "GMail",
  profile: "small-inbox"
}, on_server_ready);
[where all the options have suitable defaults]. In other words, we should have a profile-based system that gives access to a useful suite of messages/folders to specify, and server startup/shutdown should be automatic. [The on_server_ready callback is because the LDAP fakeserver, whenever I get around to that, is definitely not ready immediately, SSL won't be immediately ready, etc.]

Migrating to this kind of API in general is useful, and since Mozmill has no preexisting API already, it's a good place to start with it.
I hacked something up for bug 99019. All the bits and pieces are accessible from Mozmill. So this is "only" about providing a nice API?
Depends on: 904812
OS: macOS → All
Hardware: x86 → All
Summary: add ability to do mozmill tests with fakeserver → add ability to do mochitests tests with fakeserver
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: