From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CG4AG2mvPmBWVgAA0tVLHw (envelope-from ) for ; Tue, 02 Mar 2021 21:34:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EIm5FmmvPmDNYAAAB5/wlQ (envelope-from ) for ; Tue, 02 Mar 2021 21:34:33 +0000 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 7AD271EDD2 for ; Tue, 2 Mar 2021 22:34:32 +0100 (CET) Received: from localhost ([::1]:37436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHCf1-0005Ca-JE for larch@yhetil.org; Tue, 02 Mar 2021 16:34:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHCah-00073V-4x for guix-patches@gnu.org; Tue, 02 Mar 2021 16:30:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHCag-0005eh-UK for guix-patches@gnu.org; Tue, 02 Mar 2021 16:30:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lHCag-0007zN-Q3 for guix-patches@gnu.org; Tue, 02 Mar 2021 16:30:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46668] [PATCH]: tests: do not hard code HTTP ports Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 02 Mar 2021 21:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46668 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 46668@debbugs.gnu.org Received: via spool by 46668-submit@debbugs.gnu.org id=B46668.161472057530646 (code B ref 46668); Tue, 02 Mar 2021 21:30:02 +0000 Received: (at 46668) by debbugs.gnu.org; 2 Mar 2021 21:29:35 +0000 Received: from localhost ([127.0.0.1]:54381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHCaF-0007yE-0r for submit@debbugs.gnu.org; Tue, 02 Mar 2021 16:29:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHCaA-0007xx-1C for 46668@debbugs.gnu.org; Tue, 02 Mar 2021 16:29:33 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48918) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHCa4-0005Md-0O; Tue, 02 Mar 2021 16:29:24 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=60174 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lHCa0-0003As-5B; Tue, 02 Mar 2021 16:29:20 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <1728b9290c1b0e248b71c8b35623939853895a7f.camel@telenet.be> <87r1kyri5l.fsf@gnu.org> <3ae8be5f05d73106c867fe2cfc7f619673fd738b.camel@telenet.be> <87h7lupn7h.fsf@gnu.org> Date: Tue, 02 Mar 2021 22:29:18 +0100 In-Reply-To: (Maxime Devos's message of "Tue, 02 Mar 2021 09:15:57 +0100") Message-ID: <87eegxtfbl.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1614720872; 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: content-transfer-encoding:content-transfer-encoding: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; bh=MA65KXYYEuuEZrKDWOQPB8NYU5fRF0YcaORy626357k=; b=IyF/KswOGIC/9bHjHBH4Uf0o3am0lzxU6EyRBDW6r/S3lCfwOQSx403oKOyDenZ7gwXUQS 763TJVfOcnfK3jIimqK8nmuaCQk9XebbfbC170bgln3BUd1tDndQo2RsEg/TJBezTNj/TF Tjl9dpkSWuKBtHuUDlcwQbaqWyPxMGJVtPrMmD2Pt4+NbHyFbnTkW+03ofA7VAOY61SlqZ NuacHQZq399352jJ/n6p/ofdHL7HZU9OgDDBEDNXiXaAuf7ykzGe0f+MyUxpHyNTFE4LMX OR6J38vHkX92b6qrdAuDh5vz8jS4262gACuD/ZUmb86W1ZUrKAYNlImn5ZhD7g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614720872; a=rsa-sha256; cv=none; b=ueTeTvFWClxkdxV/NyOSlDtnPt1YWuJ5Dc9DnOg41xluz8W8jAyfng84c49JgW4Ryl1li0 xlkEJ7ViwA8v6hrOPUBYHIBDhe2HFjL9x4YLNsj0G3pPo4FanhKF1u3l6MlCeO62WM62TX VI6kSD2u+x5XkB8Q17H1glQBmNMasglS8gsIaQOp4RPzWuzwn91aOkNIgQF0HJgSJ3MBAd IFSN9Zs42n06NG7gJTFQdaBuF5hzJfNSOSHhLjaw7cY3ClFgsO5DH4/N064MNHXUGgi1SM cpe5ggv41dXAfwF9B5gs65q3konU1qs7o5rGq56ZAz69b+44Og4EcHiRu2e1mw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.86 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 7AD271EDD2 X-Spam-Score: -2.86 X-Migadu-Scanner: scn0.migadu.com X-TUID: mlaTS+rLuae6 Hi, Maxime Devos skribis: > From 933cb85de0f50c54190e7c60420bef5245a3f2ed Mon Sep 17 00:00:00 2001 > From: Maxime Devos > Date: Sat, 20 Feb 2021 22:04:59 +0100 > Subject: [PATCH] tests: do not hard code HTTP ports > > Previously, test cases could fail if some process was listening > at a hard-coded port. This patch eliminates most of these potential > failures, by automatically assigning an unbound port. This should > allow for building multiple guix trees in parallel outside a build > container, though this is currently untested. > > The test "home-page: Connection refused" in tests/lint.scm still > hardcodes port 9999, however. > > * guix/tests/http.scm > (http-server-can-listen?): remove now unused procedure. > (%http-server-port): default to port 0, meaning the OS > will automatically choose a port. > (open-http-server-socket): remove the false statement claiming > this procedure is exported and also return the allocated port > number. > (%local-url): raise an error if the port is obviously unbound. > (call-with-http-server): set %http-server-port to the allocated > port while the thunk is called. > * tests/derivations.scm: adjust test cases to use automatically > assign a port. As there is no risk of a port conflict now, > do not make any tests conditional upon 'http-server-can-listen?' > anymore. > * tests/elpa.scm: likewise. > * tests/lint.scm: likewise, and add a TODO comment about a port > that is still hard-coded. > * tests/texlive.scm: likewise. Minor comment but nothing blocking: > + (let* ((text (random-text))) > + (with-http-server `((200 ,text)) > + (let ((drv (derivation %store "world" > + "builtin:download" '() > + #:env-vars `(("url" > + . ,(object->string (%local-ur= l)))) > + #:hash-algo 'sha256 > + #:hash (gcrypt:sha256 (string->utf8 text)))= )) > + (and drv (build-derivations %store (list drv)) > + (with-http-server `((200 ,text)) > + (build-derivations %store (list drv) > + (build-mode check))) > + (string=3D? (call-with-input-file (derivation->output-path = drv) > + get-string-all) > + text)))))) It=E2=80=99s a tad confusing that the second =E2=80=98with-http-server=E2= =80=99 is now nested; it shouldn=E2=80=99t change the semantics though, so it=E2=80=99s okay. Anyway, you=E2=80=99re welcome to push to =E2=80=98master=E2=80=99 if =E2= =80=9Cmake check=E2=80=9D agrees. :-) Thanks again! Ludo=E2=80=99.