Page MenuHomePhorge

Add first unit test for mimemailparser headers
ClosedPublic

Authored by valerio.bozzolan on Dec 3 2024, 15:44.
Tags
None
Referenced Files
F2977776: D25844.1739653318.diff
Fri, Feb 14, 21:01
F2977775: D25844.1739653317.diff
Fri, Feb 14, 21:01
F2977774: D25844.1739653316.diff
Fri, Feb 14, 21:01
F2977728: D25844.1739649495.diff
Fri, Feb 14, 19:58
F2977692: D25844.1739645027.diff
Fri, Feb 14, 18:43
F2964848: D25844.1739404543.diff
Tue, Feb 11, 23:55
F2964824: D25844.1739403705.diff
Tue, Feb 11, 23:41
F2964791: D25844.1739398851.diff
Tue, Feb 11, 22:20

Details

Summary

Uploaded an example email with a lot of accents called 'test_accents.mbox' and
expected headers in the file 'test_accents.headers.txt'.

Better than nothing.

This change also includes a minor refactor in the library loading.

Ref T15960

Test Plan

Manually run the new unit test and see green lights:

arc unit src/applications/metamta/externals/__tests__/PhabricatorExternalMimeMailParserTestCase.php

Double-check that the new class is already recorded:

arc liberate

Just as extra care, re-apply the same test plan of:

D25839

So, for example, run this, and see no exceptions:

./scripts/mail/mail_handler.php < src/applications/metamta/externals/__tests__/data/test_accents.mbox

Diff Detail

Repository
rP Phorge
Branch
unit-test-asd
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1639
Build 1639: arc lint + arc unit

Event Timeline

lol @taavi I've stolen some of your "ä" for the example file test_accents.mbox, I hope you won't send me a lawyer

I hope you won't send me a lawyer

do you really think I could afford one

Thanks. Confirming that this works as expected (after manually changing test_accents.mbox to make the arc unit output fail)

I also tested by feeding some emails from my collection of broken test emails (it's sometimes useful to be a GNOME Evolution docs maintainer) into ./scripts/mail/mail_handler.php after editing mail_handler.php to also include print $headers['from']; print "\n"; print $headers['subject']; print "\n";

This revision is now accepted and ready to land.Dec 3 2024, 22:24
src/applications/metamta/externals/__tests__/data/test_accents.mbox
25

Thanks for the question. This phrase in Italian means:

Great!!! It is now(äää) time for review. Yeah bro.