From: Oleg Pykhalov <go.wigust@gmail.com>
To: "Clément Lassieur" <clement@lassieur.org>
Cc: 30744@debbugs.gnu.org
Subject: [bug#30744] [PATCH] tests: mail: Add test for dovecot.
Date: Thu, 08 Mar 2018 11:24:45 +0300 [thread overview]
Message-ID: <87po4fug8i.fsf@gmail.com> (raw)
In-Reply-To: <87371bsbnu.fsf@lassieur.org> ("Clément Lassieur"'s message of "Thu, 08 Mar 2018 00:34:13 +0100")
[-- Attachment #1: Type: text/plain, Size: 2171 bytes --]
Hello Clément,
Clément Lassieur <clement@lassieur.org> writes:
> Oleg Pykhalov <go.wigust@gmail.com> writes:
>
>> * gnu/tests/mail.scm (%dovecot-os, %test-dovecot): New variables.
>> (run-dovecot-test): New procedure.
>> ---
>> gnu/tests/mail.scm | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
>> 1 file changed, 112 insertions(+), 1 deletion(-)
>
> Thank you for these patches!
Thank you for review!
[…]
>> + (sleep 1) ; give the service time to start talking
>
> Here, it would probably be safer to wait for the PID file to arrive.
> You could use 'wait-for-file' for this, there are examples in other
> tests. Dovecot's PID file is /var/run/dovecot/master.pid.
OK.
>> + (test-eq "accept an email"
>> + #t
>
> Could you use 'test-assert' here?
OK.
[…]
>> + ;; Get a message ID
>> + (string->number
>> + (match (scandir "/home/alice/Maildir/TESTBOX/new/")
>> + ((_ _ message)
>
> Could you write "." ".." here instead of _ _? It makes it easier to
> understand the code.
Seems it's not possible for ".":
--8<---------------cut here---------------start------------->8---
natsu@magnolia ~/src/guix$ ./pre-inst-env make check-system TESTS="dovecot"
Compiling Scheme modules...
LOAD gnu/tests/mail.scm
ERROR: In procedure read:
In procedure scm_i_lreadparen: gnu/tests/mail.scm:378:28: missing close paren
make: *** [Makefile:5227: make-go] Error 1
--8<---------------cut here---------------end--------------->8---
WDYT about replacing "." (or first ‘_’) with ‘cwd’?
I also rename ‘message’ to ‘message-file’ if you don't mind.
So in the end we will have ‘(match … (cwd .. message-file) …)’.
>> + (match (string-split message #\.)
>> + ((message-id _ _) message-id))))))
>
> Here I think it would be great to compare the arrived message and the
> sent message to check that they are the same. If they are the same,
> then the test succeeds. WDYT?
OK.
I'll attach the patch after this email.
Oleg.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2018-03-08 8:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 21:30 [bug#30744] [PATCH 1/2] services: dovecot: Copy dovecot.conf to /etc/dovecot Oleg Pykhalov
2018-03-07 21:32 ` [bug#30744] [PATCH] tests: mail: Add test for dovecot Oleg Pykhalov
2018-03-07 23:34 ` Clément Lassieur
2018-03-08 8:24 ` Oleg Pykhalov [this message]
2018-03-08 8:28 ` Oleg Pykhalov
2018-03-08 9:41 ` Clément Lassieur
2018-03-09 9:31 ` Oleg Pykhalov
2018-03-09 10:16 ` Clément Lassieur
2018-03-09 14:30 ` Oleg Pykhalov
2018-03-07 23:34 ` [bug#30744] [PATCH 1/2] services: dovecot: Copy dovecot.conf to /etc/dovecot Clément Lassieur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87po4fug8i.fsf@gmail.com \
--to=go.wigust@gmail.com \
--cc=30744@debbugs.gnu.org \
--cc=clement@lassieur.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).