• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ICRAR / ngas / 485
69%
master: 69%

Build:
Build:
LAST BUILD BRANCH: config_use_prepared_stmts_for_clients
DEFAULT BRANCH: master
Ran 12 Jan 2021 01:58AM UTC
Jobs 6
Files 163
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
485

push

travis-ci-com

Rodrigo Tobar
Use aiosmtpd when smtpd is not available

The SMTP server used by tests has currently been based on the smtpd
system module. This module is deprecated though, as slated for removal
in python 3.10, as indicated in #14. If we want to continue testing our
mailing capabilities we therefore need to address this situation.

This commit contains the necessary changes to keep supporting our SMTP
test server using an external python package, aiosmtpd. The package is
the recommended way of moving away from smtpd, and even had a useful
guide on how to port code from one system to another. It also doesn't
require us to keep track of the background thread running the server,
which is a nice addition. Other than its API, it had one difference
though: messages containing newline characters (\n) appear on the other
side with a \r\n sequence, which didn't happen with smtpd. I haven't
invested time to investigate why this is different between the two
packages, but doing a small replace() call on the incoming data suffices
for our purposes.

The aiosmtpd package works only with python 3.6+, which is a narrow list
compared to the one we want to support in NGAS. Because of this we
therefore are maintaining both the smtpd- and the aiosmtpd-based
versions of the SMTP servers, and only when smtpd is not available
we switch to using the aiosmtpd-based solution.

Finally, aiosmtpd requires a coroutine to be implemented. This is of
course not possible in python 2.7 ("async def" doesn't parse). We avoid
this by declaring an awaitable in a more "raw" format (i.e., returning
an object with a __await__ method returning an iterator, etc...)

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>

13530 of 19600 relevant lines covered (69.03%)

4.12 hits per line

Jobs
ID Job ID Ran Files Coverage
1 485.1 (DB=sqlite3) 12 Jan 2021 01:58AM UTC 0
68.72
Travis Job 485.1
2 485.2 (DB=mysql) 12 Jan 2021 01:59AM UTC 0
68.46
Travis Job 485.2
3 485.3 (DB=postgresql) 12 Jan 2021 01:59AM UTC 0
68.48
Travis Job 485.3
5 485.5 12 Jan 2021 01:58AM UTC 0
68.7
Travis Job 485.5
6 485.6 12 Jan 2021 01:58AM UTC 0
68.79
Travis Job 485.6
7 485.7 12 Jan 2021 01:58AM UTC 0
68.88
Travis Job 485.7
Source Files on build 485
  • Tree
  • List 163
  • Changed 14
  • Source Changed 0
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Build #485
  • 20926034 on github
  • Prev Build on aiosmtpd (#484)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc