Open Bug 1851536 Opened 8 months ago Updated 18 days ago

Improve code coverage by implementing new tests

Categories

(Thunderbird :: General, task)

Tracking

(thunderbird_esr115 fixed)

ASSIGNED
119 Branch
Tracking Status
thunderbird_esr115 --- fixed

People

(Reporter: darktrojan, Assigned: darktrojan)

References

Details

(Keywords: leave-open)

Attachments

(31 files, 1 obsolete file)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

I'll use this bug to create tests for sections of code that aren't already covered by tests.

Includes some rearranging and tidy-up of address book test code.

This fixes a problem where the print preview does not show on the first attempt, then tests that printing works as expected.

Depends on D187419

Attachment #9351512 - Attachment description: Bug 1851536 - Test the UI for exporting an address book. r=#thunderbird-reviewers → Bug 1851536 - Test the UI for exporting an address book. r=mkmelin
Target Milestone: --- → 119 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/f58a18657d70
Test the UI for exporting an address book. r=mkmelin
https://hg.mozilla.org/comm-central/rev/2797148e1ef6
Fix and test printing in the Address Book tab. r=mkmelin

Tests for:

  • Open in New Tab
  • Open in New Window
  • New Folder
  • Rename
  • Delete
  • Properties
  • Settings

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/d535b5a27e31
Test items on the folder pane context menu, part 1. r=mkmelin

See Also: → 1852922

Pushed by vineet@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/ce74ecec0108
Test the subscribe dialog for IMAP and NNTP. r=aleca

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/f73f8590b876
Test the Search Messages dialog. r=mkmelin

Comment on attachment 9355256 [details]
Bug 1851536 - Test the Search Messages dialog. r=#thunderbird-reviewers

[Triage Comment]
Just taking this patch as a dependency for 1847658

Attachment #9355256 - Flags: approval-comm-esr115+

Tests "Mark Folder Read" and "Mark All Folders Read".

Depends on D192291

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/f9780411b518
Test items on the folder pane context menu, part 2. r=mkmelin
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/cc6ea3ba10f5
Add newsgroups to browser_folderPaneContext.js. r=freaktechnik
https://hg.mozilla.org/comm-central/rev/70c5614ae55a
Move test IMAP and NNTP servers into modules. r=freaktechnik

Tests the Empty Trash and Empty Junk items.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/f1f04935b91f
Test items on the folder pane context menu, part 3. r=john.bieling

This tests dragging messages from one folder to another, dragging messages in from the file system and out to the file system.

I've fixed the behaviour so that multiple contacts can be dragged to the file system on all platforms.

Depends on D193761

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/3be0da03bd71
Test dragging messages around about:3pane. r=mkmelin
https://hg.mozilla.org/comm-central/rev/d6be3f51dd37
Fix and test dragging contacts from the Address Book to the file system. r=mkmelin

This includes an incomplete implementation of RFC 2087 for the IMAP fakeserver, and resurrecting a long-dead
function in nsImapIncomingServer which should make future tests involving IMAP a bit easier to write.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/ad171a374390
Test the quota status bar panel and the folder properties dialog quota tab. r=mkmelin

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/b1a9f69a791d
follow-up - Wait for IMAP connection to become idle before cleaning up. r=mkmelin

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/0e7f972b4211
Test setting and clearing tags on messages. r=mkmelin

This adds a test for items related to the content of the message being displayed, and cleans up a few things.

This tests items on the menu that open a compose window.

This tests items on the menu that only apply when opened from the thread tree.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/3f9918a43a42
Test items on the mail context menu, part 1. r=aleca
https://hg.mozilla.org/comm-central/rev/a71a2e4cd1a2
Test items on the mail context menu, part 2. r=aleca
https://hg.mozilla.org/comm-central/rev/60a9947d727b
Test items on the mail context menu, part 3. r=aleca

This is the first of at least two patches testing GuessConfig.
In this patch I'll test only plain-text connections to servers.
Future patches will test full TLS connections and hopefully startTLS connections.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/cc1f70df6bf4
Unit test GuessConfig with plain-text servers. r=freaktechnik
https://hg.mozilla.org/comm-central/rev/2febe348ee47
Unit test GuessConfig with TLS servers. r=freaktechnik

This improves the earlier TLS tests by giving them valid TLS certificates, based on test
certificate authorities which are loaded at the start of the test. This means we can test TLS
servers without relying on overriding invalid certificates, and that means we can properly test
invalid certificates.

We can now check that (with the appropriate preference set) GuessConfig will return details of
servers with expired or untrusted certificates, and that it won't return details of servers with
certificates that don't match the server domain.

This tests that GuessConfig prefers imap.domain.tld, pop3.domain.tld and smtp.domain.tld over
just domain.tld if there are valid servers at those hostnames.

Depends on D198134

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/512568516a7e
Unit test GuessConfig with invalid TLS servers. r=mkmelin
https://hg.mozilla.org/comm-central/rev/196ee4b3660b
Unit test GuessConfig returns servers with known subdomains. r=mkmelin

Although our test servers don't support startTLS, we can make them do enough to test GuessConfig finds them.

Tests a correct configuration and several incorrect configurations. There are many more failure
cases to add, but this is a good start.

I had to fix a bug in Pop3Client, which would call listeners multiple times in case of an error.

Depends on D198925

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/623552bb313d
Unit test GuessConfig with startTLS servers. r=john.bieling
https://hg.mozilla.org/comm-central/rev/c4b183a3d04b
Improve unit testing of FetchConfig. r=mkmelin
https://hg.mozilla.org/comm-central/rev/59c30577c904
Refactor test server and certificates handling. r=john.bieling
https://hg.mozilla.org/comm-central/rev/cb174726c8ea
Add tests for verifyConfig. r=john.bieling

This patch moves tests that are generally independent of the primary UI into their own directory,
which should help with reliability and efficiency of test development.

… and some ways in which they could go wrong.

Depends on D199317

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/18db60a31689
Move tests of widgets into their own directory. r=mkmelin
Attachment #9375936 - Attachment description: Bug 1851536 - Test 13 ways the UI triggers fetching new messages. r=#thunderbird-reviewers → Bug 1851536 - Test the many ways the UI triggers fetching new messages. r=#thunderbird-reviewers

Comment on attachment 9375936 [details]
Bug 1851536 - Test the many ways the UI triggers fetching new messages. r=#thunderbird-reviewers

Revision D199318 was moved to bug 1878172. Setting attachment 9375936 [details] to obsolete.

Attachment #9375936 - Attachment is obsolete: true
See Also: → 1878172
Attachment #9382196 - Attachment description: WIP: Bug 1851536 - Implement a proxy to convert HTTP requests to HTTPS for tests. r=#thunderbird-reviewers → Bug 1851536 - Implement a proxy to convert HTTP requests to HTTPS for tests. r=#thunderbird-reviewers
Attachment #9382197 - Attachment description: WIP: Bug 1851536 - Move test certificate files into their own directory. r=#thunderbird-reviewers → Bug 1851536 - Move test certificate files into their own directory. r=#thunderbird-reviewers

This is much cleaner than passing the test scope to each module and calling registerCleanupFunction
to shut down servers etc..

TestUtils.promiseTestFinished isn't called in XPCShell tests but because they run separately and
everything is cleaned up when the process ends, that doesn't matter.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/2fad2e13c259
Implement a proxy to convert HTTP requests to HTTPS for tests. r=john.bieling
https://hg.mozilla.org/comm-central/rev/a1587a7ec9ca
Move test certificate files into their own directory. r=john.bieling
https://hg.mozilla.org/comm-central/rev/aff3695dce6f
Await `TestUtils.promiseTestFinished` instead of passing test scope around. r=mkmelin
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/0e7b138a0899
Add tests for CardDAV address books with DNS discovery and OAuth2 authentication. r=mkmelin

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/38d88d580d82
Test the Address Book search window. r=mkmelin

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: