From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id JnWbCBTIvmBXAQEAgWs5BA (envelope-from ) for ; Tue, 08 Jun 2021 03:29:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cPAyAxTIvmD3PwAAbx9fmQ (envelope-from ) for ; Tue, 08 Jun 2021 01:29:56 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3100F2CFD4 for ; Tue, 8 Jun 2021 03:29:55 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id C731B271D6; Mon, 7 Jun 2021 21:29:49 -0400 (EDT) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by mail.notmuchmail.org (Postfix) with ESMTPS id 43F7B26BE0 for ; Mon, 7 Jun 2021 21:29:47 -0400 (EDT) Received: by mail-wm1-x336.google.com with SMTP id v206-20020a1cded70000b02901a586d3fa23so752915wmg.4 for ; Mon, 07 Jun 2021 18:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OaimPV9VVvnGcixDYvmllKO8pks2+qDBbPHtvHtKxLc=; b=ff9HANMxTUoE6n8jfoBrVqmIIcrBy98uyv2rVvMmBfvQKYt1SZ480pv1/OJ6TKUzYG JniasASGBr2zy2aRhJ6ACddnXfJSoOE3HvdM9K6pOOktrFAcihYkguLVU8mFB44ul86O qQ3Dpol7O3x7qUF5lkdYqcnRF4KTNWjbzi0yoeqDi+JjSYUxeUk6I8IBHy8aU5bmyMaC Vrhjh1h140HWxTD0z2OWD0h/UOGVK4VFyPr3BOcD6M7pjGXHurbhiwTQu6vTObTfZWaI LlPmhyhId6ilR9Fi3DxHTqCNj4+SThPVFVS9fu5D/qu+L1qXkBv7cgY3IH4ynEMJW76z NDnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OaimPV9VVvnGcixDYvmllKO8pks2+qDBbPHtvHtKxLc=; b=WQeCzWZTMxJnNz60KUoNRaVcoHiEF/vjMFmHO5TBd708043/iaRe8NfdjiNJLkYA5A OLTfJsWmHG/IHf9jgVbwIIhjm54HKpL6yyce8rOQnqXHzyLUG50F1o9E0LFjO1M5yFEg WLYjYlr4CcBjz7V7JC1RqH4GN6p1cBWNku0pfdq33TGrnKWkF5x1JzqwW5Rl5GnhBzMH qVPvLuftQNws4CBaNsjnnk83DG8yCE64o78+NnFJ1CbPVZKQcKE3ppPXF9FEiMIzI7tV GbNzY9wG9PHvXvkvo8L8ue8DRfj0pbrcIWGaizrDPKHfpB8FR6+T7/0AzFy+/nq82KwL 2Khg== X-Gm-Message-State: AOAM530OW9/NE1e62PbnYYNsqNhlccnAWEDmzkll7t6VCCUyX7flMuwo +sq0f3c0skvimXA5pnwlA8TFdjWWYVGE2ktPVf71sVxgqTOOAw== X-Google-Smtp-Source: ABdhPJzAg9oJc8x2ZzCV0HrVq16C/U9HBQ6O/36//Kr1Nj1ZnfdBcPP2ka+meOEEdAEP3EA+whBpSMyT8ileDgc7IAg= X-Received: by 2002:a1c:6a14:: with SMTP id f20mr19307089wmc.37.1623115786075; Mon, 07 Jun 2021 18:29:46 -0700 (PDT) MIME-Version: 1.0 References: <20210501120448.484082-1-felipe.contreras@gmail.com> <20210501120448.484082-4-felipe.contreras@gmail.com> <87zgwlr5pw.fsf@tethera.net> <87pmwxfd0f.fsf@tethera.net> In-Reply-To: <87pmwxfd0f.fsf@tethera.net> From: Felipe Contreras Date: Mon, 7 Jun 2021 20:29:35 -0500 Message-ID: Subject: Re: [PATCH 3/3] test: ruby: simplify basic tests To: David Bremner Message-ID-Hash: JEVJ4KLQKU6BTZALCLWPFH3DIUMHINQU X-Message-ID-Hash: JEVJ4KLQKU6BTZALCLWPFH3DIUMHINQU X-MailFrom: felipe.contreras@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: "notmuch@notmuchmail.org" , Ludovic LANGE , Stefano Zacchiroli X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623115795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Oj+JGw1h5Jg3TaSAl8GJEfapHfn7T+rtsO4J7emKvN4=; b=naDOdIa+d5ZhutDyZSv6hM/tQeOsPytkdC3kCKmAUAyCWBtBf19HkDEiW8syx7DU87odpD mS6CFfWnMPkeszu8y/xhG6uBJ2FB1pE6pUsa2etaUnuLOosoS+/CBxPQQIDuOwSc+rAgr/ UU5STuSYV91HZlGPhw1Ekqw4fUa/BjTV6CRcobxGP40shP9VzEJFoMvhxB2UOxL7ITVY8J LVtk6K2fbDU6b8ji7nML2pUqSn6oIeYXpzE5CL/06+Y7DHW7riFPlMOvNj2VCmV7W4rx5Z FR2D0JR3EUWR4K0jf4IWR7pyzZp6Jscn04qXFITjXCki1evEMetSwbygZBo1fA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623115795; a=rsa-sha256; cv=none; b=JGAccoFEZiOR5+DRXsrv91fvod1CzW8Ao7ECoDtw8++zeg5Qr2V+KnHqTTh0R7dxPgAG2D G0zFomqAkgmkd2yipKzzJ8i72xFTSvXIRYOCjx91Xrx6XqzG/zWXoP4v4lNpbHmWctSqCA T2028ct/V16m4CMXnZL911g6LU8sGa+eRzm+cRI7s/XFfT3l2BSswJMyOOTAZdKfU7hNkS btp/Gxe+u6HBJBb/LRRhGaYTSJ5r36HBjl0MxkBAhwS4rrUxkCvfmxjNH4n+U6OKxuJkIb IcfQQBhCFaGo4p6MwB64n+MS5vsHuL5D50GCezuhpw5o74zBmhQ3koRQaVwXIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=ff9HANMx; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=ff9HANMx; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 3100F2CFD4 X-Spam-Score: -0.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: 7AtqY5HFP/fn On Mon, Jun 7, 2021 at 6:53 PM David Bremner wrote: > > Felipe Contreras 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