unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: David Bremner <david@tethera.net>
Cc: "notmuch@notmuchmail.org" <notmuch@notmuchmail.org>,
	Ludovic LANGE <ll-notmuchmail@lange.nom.fr>,
	Stefano Zacchiroli <zack@upsilon.cc>
Subject: Re: [PATCH 3/3] test: ruby: simplify basic tests
Date: Mon, 7 Jun 2021 20:29:35 -0500	[thread overview]
Message-ID: <CAMP44s1_5cWg6VV9XF2e0-_s6jt8uq+38HAP1NkFaubhTfW+Tg@mail.gmail.com> (raw)
In-Reply-To: <87pmwxfd0f.fsf@tethera.net>

On Mon, Jun 7, 2021 at 6:53 PM David Bremner <david@tethera.net> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> >>
> >> Is this assuming that the sort order in the CLI is the same as in the
> >> library / bindings? that seems a bit fragile if so.
> >
> > Both the CLI and the bindings are using the same libnotmuch library.
> > If neither of them specify a sort order, the default sort order of
> > libnotmuch would be used (I presume). Exactly the same order I would
> > get if I write a C program that uses libnotmuch and doesn't specify
> > any order.
> >
> > Why would the CLI specify an order the user didn't specify to libnotmuch?
>
> I guess the point is that the CLI is not required to track the library
> precisely, so even if it is a bit theoretical, this change does
> introduce some fragility / technical debt into the test suite.
>
> For better or for worse, the API does not document a default sort order,
> so assuming any particular sort order is probably a mistake. I can
> imagine a future database backend where the "UNSORTED" order is actually
> non-deterministic. If we were to document a default sort order, UNSORTED
> might make the most sense as a default, as it's the highest performance
> (more or less by definition).

We could have test_ruby_unordered and sort both the expected and
actual files to ensure the tests don't break if in the future the
default order changes. But personally I don't see much point in
complicating the tests preemptively. I would rather worry when the
time comes, which might be never.

-- 
Felipe Contreras

      reply	other threads:[~2021-06-08  1:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-01 12:04 [PATCH 0/3] ruby: improve db.query Felipe Contreras
2021-05-01 12:04 ` [PATCH 1/3] ruby: use notmuch_exclude_t enum Felipe Contreras
2021-05-23 12:28   ` David Bremner
2021-05-01 12:04 ` [PATCH 2/3] ruby: add keyword arguments to db.query Felipe Contreras
2021-05-23 12:29   ` David Bremner
2021-05-24  2:23     ` Felipe Contreras
2021-05-01 12:04 ` [PATCH 3/3] test: ruby: simplify basic tests Felipe Contreras
2021-05-23 12:32   ` David Bremner
2021-05-23 22:51     ` Felipe Contreras
2021-06-07 23:53       ` David Bremner
2021-06-08  1:29         ` Felipe Contreras [this message]

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://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMP44s1_5cWg6VV9XF2e0-_s6jt8uq+38HAP1NkFaubhTfW+Tg@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=david@tethera.net \
    --cc=ll-notmuchmail@lange.nom.fr \
    --cc=notmuch@notmuchmail.org \
    --cc=zack@upsilon.cc \
    /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://yhetil.org/notmuch.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).