From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qIDMLZhs7GHpyAAAgWs5BA (envelope-from ) for ; Sat, 22 Jan 2022 21:44:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YCF2Jphs7GEyGwEAG6o9tA (envelope-from ) for ; Sat, 22 Jan 2022 21:44:08 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 58FB62F198 for ; Sat, 22 Jan 2022 21:44:08 +0100 (CET) Received: from localhost ([::1]:43226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBNF1-0006ib-Ek for larch@yhetil.org; Sat, 22 Jan 2022 15:44:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBNEw-0006iD-DV for guix-patches@gnu.org; Sat, 22 Jan 2022 15:44:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nBNEw-00081m-41 for guix-patches@gnu.org; Sat, 22 Jan 2022 15:44:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nBNEw-00069S-0T for guix-patches@gnu.org; Sat, 22 Jan 2022 15:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53389] [PATCH 0/9] Replace some mocking with with-http-server*, avoid hardcoding ports, Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Jan 2022 20:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53389 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 53389@debbugs.gnu.org Received: via spool by 53389-submit@debbugs.gnu.org id=B53389.164288418623576 (code B ref 53389); Sat, 22 Jan 2022 20:44:01 +0000 Received: (at 53389) by debbugs.gnu.org; 22 Jan 2022 20:43:06 +0000 Received: from localhost ([127.0.0.1]:38008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBNE1-000689-N3 for submit@debbugs.gnu.org; Sat, 22 Jan 2022 15:43:06 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:51772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBNDy-00067l-RD for 53389@debbugs.gnu.org; Sat, 22 Jan 2022 15:43:03 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by albert.telenet-ops.be with bizsmtp id lwj02601A4UW6Th06wj0yj; Sat, 22 Jan 2022 21:43:01 +0100 Message-ID: From: Maxime Devos Date: Sat, 22 Jan 2022 21:42:56 +0100 In-Reply-To: <87lez7zpgf.fsf_-_@gnu.org> References: <6b1c1d98514b2547907a81a04c1241d9b865d6fa.camel@telenet.be> <20220120130849.292178-1-maximedevos@telenet.be> <87lez7zpgf.fsf_-_@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-FPe4W4kZiOQvf7RirXX4" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1642884181; bh=evgnQWp+2pANLW779fvUEcOf8lrmvacfrvsqaKTq7Mk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=RufrqQWc7hYr68K3YrS9Z5DQkpjn9tERzRfVDxeAXOEmHxN9NEFKti3BafQFuKpWx CcfwoVh+NG/JF3v/Ky9yHAyeWhiVbrBnqUz9wp9fmAuJbPRDxBHrwrPKYfI94PINfa g7UDNaYCnvXJ9d+s79hN70ys3KAUK6iHw7+oOVrJOLAM4iBvoIo4/+eBV8GGPDDq6f aeXL1Skva1vJSFlcdwi0PtCde8TugPHok/6/1IU9YY9yJJUTPFdYVu3GN5FwBjfd2H AKi7YdSZO/E1hK5scEnP4sXWqfpF2cYs/C/argj+rzb+NCd+KpBmvt4sHkTbkJ+ZX0 7Zf/rXM5rkhYg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642884248; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=evgnQWp+2pANLW779fvUEcOf8lrmvacfrvsqaKTq7Mk=; b=npIbn+9GH0yNsdFLE57HywvEmM4J/2dob1E5ZR951Rw53Zdimmhm0l1ncy28u4bm/F4QDT 1vOf8V4ZlaYVsSuoeuq/W7Kqv00atvZk4aTkcVOOxJirDLfCzu357BBD0gPrS8aDMVL/Z1 VrKwjZVILnCbPuv9gQc2uHuzLzEjLkId1ulezrwswr5DAXRP+fIzs9/fALYnhl+NHduhDY 2iGpc1CwYv/0J4r7+A4Cm0nD/uk993Loh9zMwo2oGSUWdJH6dW2LSySei/iaMrWbfDaT0m J9JCbhAFNzROiuGtYtK1ejIe6DEvYjI85VQ2V6RB13Fxhcy0pjZ/WP7cIDR/8Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642884248; a=rsa-sha256; cv=none; b=SP67+Zg6sVcmO99jErEAQjtBK2Qd+qslsIjSfLPyAlUMrkR5U4G5Xgt6N9MDdkCqHaISJ1 pGZAO1SHf3F2gISwk/fCm/1hhKTKbKkukweW5l5OpE6t9uPWIrRhvV+E6nCHAvAstHumMz 1RvT5bJAR/JN47qhUIL/lYpcqbeQPN8gOKEVIzPi8AY4AaFFquwuhMFHpLK6BbJVPwyofE v4N3zEcnHXYxV/OhdnQv3fcRdNzi2EpPNdKq7amf0mTuitcKT9VMCin8ML+u4PrroBZG6Y muFH+jOw5egiLFgZFyhdrOibbkACq//Om3ptbufymFq1JAGCGsJA9S1W9NWeaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=RufrqQWc; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.53 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=RufrqQWc; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 58FB62F198 X-Spam-Score: -4.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: JsCD8x9AVrVz --=-FPe4W4kZiOQvf7RirXX4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op za 22-01-2022 om 17:48 [+0100]: > My first reaction was: have we gone overboard?=C2=A0 :-) >=20 > Since it=E2=80=99s an internal module and a test helper, I=E2=80=99m in f= avor of keeping > it as simple as possible. >=20 I don't see what it matters that this module is only available from a git checkout (or extracted tarball) and that it is only used by tests. Keeping things simple is good, but making it simpler in such a way that it becomes unusable to some tests (tests/minetest.scm) somewhat defeats the purpose of the test helper. > =C2=A0 Can we keep a single =E2=80=98with-http-server=E2=80=99 form > that would cover all cases? We have a single form that covers all cases: with-http-server*. However, the full power of the functinal with-http-server*, accepting an arbitrary mapping from requests to responses, often isn't necessary. For those cases, we have the declarative with-http-server, which is quite a bit simpler to use, but much less flexible. We could remove 'with-http-server' and keep a single macro 'with-http-server*' but I don't think that's what you were going for. This seems a bit like trivial-build-system/copy-build-system. trivial-build-system is rather complicated to use, but can in theory do anything. copy-build-system is rather limited in what it can do, but when it is suitable to the problem, it is very easy to use. There is no attempt to somehow move everything trivial-build-system can do into copy-build-system. There's also the option of letting 'call-with-http-server' test if the (responses+data) is a procedure or a list, and in the first case behave like the old 'with-http-server*' and in the second case like 'with-http-server'. This overloading doesn't seem great though, I would rather have two separate procedures for two separate APIs -- albeit with one implemented using the other. >=20 > We can update existing tests to include the expected URL path (or a > wildcard, if needed), instead of keeping several forms.=C2=A0 We don=E2= =80=99t need > to worry about backward compatibility at all. Always including the URL path in the declarative forms (with-http-server) seems good to me, but it would be a lot of work -- actually, on second though, I ran "git grep -F with-http-server | wc -l" and there were 51 hits, which seems doable. Let's do that in the v2. However, the declarative form is too limiting and not sufficiently expressive for some tests (tests/minetest.scm), tests/minetest.scm doesn't have any use for wildcards, so with-http-server remains unsuitable for some tests. Greetings, Maxime. --=-FPe4W4kZiOQvf7RirXX4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYexsUBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ssVAP93v+UNC96exqMq+RVo4YUMfFJ+ IwzP2NRQ7WQNwWD7ugD8CHO6qlnI7Gyqp5cT4isyyEHSwYdR/9mhhtgdcpw1tgU= =O3S3 -----END PGP SIGNATURE----- --=-FPe4W4kZiOQvf7RirXX4--