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

ICRAR / ngas
69%
master: 69%

Build:
Build:
LAST BUILD BRANCH: config_use_prepared_stmts_for_clients
DEFAULT BRANCH: master
Repo Added 30 Jun 2017 02:01AM UTC
Files 165
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

LAST BUILD ON BRANCH aiosmtpd
branch: aiosmtpd
CHANGE BRANCH
x
Reset
  • aiosmtpd
  • 98-query-ignore
  • NGAS-163
  • avoid-installing-bsddb3-in-py27
  • bbcp_fixes
  • c_client_warning_fixes
  • centos7-compatibility-changes
  • clone-fix
  • clone-order-fixes
  • correct-janitor-init
  • correct-logging-c
  • coverage-stability
  • direct_sql
  • doc-updates
  • docs-fix
  • document-future-removal-of-27
  • fits_optional_arcfile
  • fix-requests-dependency-specs
  • fs-monitor
  • fs-monitor-fixes
  • github-actions
  • improve-register-error-message
  • issue-103
  • issue-13
  • issue-38
  • issue-44
  • issue-50
  • issue-51
  • janitor-thread-startup
  • macos-hostnames
  • macos-travis-fix
  • macos-travis-update
  • master
  • netifaces-fix
  • next
  • no-create-venv
  • none-reg-parameters
  • partner_sites
  • plugins-importing
  • py311
  • py39
  • python-client-improvements
  • relaxed-netifaces
  • release-12.0
  • remove-2.7-builds
  • remove-test-generic-registration-plugin
  • requests-pinning
  • richer-archiving-event
  • separate-test-servers
  • servers-flag
  • small-improvements
  • smtp-testing
  • stream-proxy-request
  • subscription-def
  • subscription_thread_ng
  • travis-errors
  • travis-fixes
  • travis-focal
  • update-travis-matrix
  • uwe-fixes
  • v11
  • v12
  • v12.0
  • various_improvements
  • volumes

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

Relevant lines Covered
Build:
Build:
19600 RELEVANT LINES 13530 COVERED LINES
4.12 HITS PER LINE
Source Files on aiosmtpd
  • Tree
  • List 163
  • Changed 14
  • Source Changed 0
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
485 aiosmtpd 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 testin... push 12 Jan 2021 01:58AM UTC Rodrigo Tobar travis-ci-com pending completion  
484 aiosmtpd Add Python 3.10 job in Travis Alongside this new job we also install aiosmtdp, which is required to provide the SMTP server functionality needed by unit tests. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org> push 12 Jan 2021 01:44AM UTC Rodrigo Tobar travis-ci-com pending completion  
483 aiosmtpd 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 testin... push 11 Jan 2021 10:02AM UTC Rodrigo Tobar travis-ci-com pending completion  
See All Builds (534)
  • Repo on GitHub
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