refactor: smtpd->aiosmtpd - #8805
Conversation
The test has been working, but in a broken way, for as long as it has existed. The smtpd-based test_smtpserver was masking an exception that did not interfere with the test's effectiveness.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8805 +/- ##
==========================================
- Coverage 88.81% 88.81% -0.01%
==========================================
Files 314 314
Lines 41255 41430 +175
==========================================
+ Hits 36642 36795 +153
- Misses 4613 4635 +22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| # -*- conf-mode -*- | ||
| setuptools>=51.1.0 # Require this first, to prevent later errors | ||
| # | ||
| aiosmtpd>=1.4.6 |
There was a problem hiding this comment.
IMO moving forward, we should try to separate test only dependencies. Not saying we should start with this PR, but better to start somewhere?
There was a problem hiding this comment.
This will help us to have clear SBOM for production server.
There was a problem hiding this comment.
I like the idea, though have some concerns about how we would validate changes to the production dependency list prior to deployment.
I don't think it's practical to start in this PR because there will be quite a few tooling and deployment adjustments needed regardless of how we do it. It'll need to be its own project.
This is a prerequisite for moving to Python 3.12 (see #7929 (comment)). Fixes #8077
The
line_length_limitincrease in commit 5bb3700 is needed because, as indicated in the comment, some of the tests are sending messages that exceed the RFC 5321 line length limit in the DATA section. From what I have found so far, the issue is that datatracker is incorrectly sending<LF>instead of<CRLF>as line endings when sending SMTP messages. It's just possible that this is a test-only bug, but it's likely affecting production. This is causing failures now because aiosmtpd is strict, both about line endings and about line lengths, whereas our previous test server was extremely lenient.While that's embarrassing and should be investigated/fixed soon, I think we should do that separately and run with the
line_length_limitfix for now. That only affects testing code and can only cause new failures, not hide ones we'd have caught before.