From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id sBMUD9vxC2Y2ZwEA62LTzQ:P1 (envelope-from ) for ; Tue, 02 Apr 2024 13:54:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id sBMUD9vxC2Y2ZwEA62LTzQ (envelope-from ) for ; Tue, 02 Apr 2024 13:54:03 +0200 X-Envelope-To: larch@yhetil.org 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+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712058843; a=rsa-sha256; cv=none; b=qNImV23Ue8yCvBgCvMSlVM40sIpQEctmsiapsayOWHrEiWjAxOFDjBuRpa+pH94CVcC49k NahSelKq0VRChVMuiHEe1xCinNGZFxhIzkfslse5j0HCwj5XoHc95BSiLkPrxgouzXp0OC fqnkYSqTz/S2ZSVTsELPlQdpDjlMUxzda8aPGngANBEFrTDxryNy9BWKbUnF5iCcxSh2Om yCvApc1NocLJAH1Es5p/7Yfnzluvh3oIu/41LEJoPl16CXKl3PuSDXLOTFhrUsGfT1sw3w cK5+jaPwuq7zNSxVQcGriRZaXVX+gc22Ntr1+nzr1X0n90DOlK8mnmega8NHBA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712058843; h=from:from:sender:sender:reply-to: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=tf/jM8CakprPlHsPyVXDT8NxJ4kEpfy4hdIYMxn/mtk=; b=HIoj+2EY7W7sSsAPmohHTWHqaegTqcPnlKRgeuPd7CGTKxSztqRoQufkk9apa3GFLgBIq/ 9vXkS0RnWDhghHMTg6U/mwjH0Jhl/Pn0t6dK6Kf4v//Yrh7u6D4nIOS9mCCodky3Umdc8d WQ4wVY/Nz7l8lX+TFq/mdZYoqO/n9WTGE/F2W6WA88wVMqgF6CX/aW+nlGiqBNtpDKxURS WjiwmW5d2bnQeHbO/AMH2h41yIc5MZuh4Pem6QNHRVfn3+sK0isEdyn+tyA5bRDKuEkUK8 6CxigxYrFKLEGbQmI2zt9HDnHJ3+N1EhjaJfhGZcw9NDWrQFtqgzA1YCQ5WcLQ== 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 212ED667DA for ; Tue, 2 Apr 2024 13:54:03 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrchz-0004X7-TI; Tue, 02 Apr 2024 07:53:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrchJ-0004JW-VQ for guix-patches@gnu.org; Tue, 02 Apr 2024 07:53:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rrchJ-0005q4-MN for guix-patches@gnu.org; Tue, 02 Apr 2024 07:53:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rrchL-0004mW-Rr for guix-patches@gnu.org; Tue, 02 Apr 2024 07:53:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62202] [PATCH v4 6/6] tests: juliahub: Add unit tests for (guix import juliahub). Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 02 Apr 2024 11:53:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62202 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch moreinfo To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: zimoun.toutoune@gmail.com, 62202@debbugs.gnu.org Received: via spool by 62202-submit@debbugs.gnu.org id=B62202.171205876718285 (code B ref 62202); Tue, 02 Apr 2024 11:53:03 +0000 Received: (at 62202) by debbugs.gnu.org; 2 Apr 2024 11:52:47 +0000 Received: from localhost ([127.0.0.1]:52899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrch1-0004kI-GZ for submit@debbugs.gnu.org; Tue, 02 Apr 2024 07:52:47 -0400 Received: from 1.mo560.mail-out.ovh.net ([46.105.63.121]:41333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrcgy-0004k5-BW for 62202@debbugs.gnu.org; Tue, 02 Apr 2024 07:52:42 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.109.148.12]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 4V85pp4Dh1z1NNV for <62202@debbugs.gnu.org>; Tue, 2 Apr 2024 11:52:34 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-8tqfp (unknown [10.110.168.37]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 2CCB81FEE0; Tue, 2 Apr 2024 11:52:34 +0000 (UTC) Received: from ngraves.fr ([37.59.142.101]) by ghost-submission-6684bf9d7b-8tqfp with ESMTPSA id fIMaCYLxC2bopgcAuiSuzA (envelope-from ); Tue, 02 Apr 2024 11:52:34 +0000 X-OVh-ClientIp: 81.67.146.208 In-Reply-To: <87plv8bye8.fsf@gnu.org> References: <20240203230807.25751-1-ngraves@ngraves.fr> <20240203230807.25751-6-ngraves@ngraves.fr> <87plv8bye8.fsf@gnu.org> Date: Tue, 02 Apr 2024 13:52:33 +0200 Message-ID: <87edbovv5q.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 17402471912251187815 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudefvddggeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeeuuefgkeeujeeiheeftdfggffggefgfeeljeevhfeuffefjeetheeivefguefhleenucffohhmrghinhephhhtthhpqdhfvghttghhuhhnvgigphgvtghtvgguuhhrlhhurhhluggvfhhinhgvmhhotghkqdhhthhtphdqghgvthhtvghsthgtrghsvghlrghmsggurghurhhlrdhrvghsthenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepiedvvddtvdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheeitddpmhhouggvpehsmhhtphhouhht 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -6.86 X-Migadu-Queue-Id: 212ED667DA X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.86 X-TUID: hKovtO69MLIl On 2024-04-01 22:50, Ludovic Court=C3=A8s wrote: > Hi, > > As part of this v4, I would recommend merging patches 2, 3, and 6, such > that there=E2=80=99s a single self-contained patch adding =E2=80=98guix i= mport > juliahub=E2=80=99. (That=E2=80=99s what we usually do and I find it clea= rer because we > immediately see what goes together.) Will do. > > Nicolas Graves skribis: > >> * tests/juliahub.scm : Add unit tests juliahub-redirect, >> julia-general-registry-parsing, juliahub-fetch. > > Just =E2=80=9CNew file.=E2=80=9D > > Some of the other files lack a commit log; we can add it for you, but > it=E2=80=99d be great if you could do it upfront. Sorry for these past contribution, I do it now. > >> --- >> tests/juliahub.scm | 185 +++++++++++++++++++++++++++++++++++++++++++++ > > Please add it to =E2=80=98Makefile.am=E2=80=99. Will do. > > [...] > >> +(define (mock-http-fetch testcase) >> + (lambda (url . rest) >> + (let ((body (assoc-ref testcase url))) >> + (if body >> + (open-input-string body) >> + (error "mocked http-fetch Unexpected URL: " url))))) >> + >> +(define (mock-http-get testcase) >> + (lambda (url . rest) >> + (let ((body (assoc-ref testcase url)) >> + (response-header >> + (build-response >> + #:version '(1 . 1) > > I strongly encourage using =E2=80=98with-http-server=E2=80=99 using the s= ame strategy > that=E2=80=99s used in =E2=80=98tests/pypi.scm=E2=80=99 and others instea= d of mocking. (=E2=80=98mock=E2=80=99 > is very sensitive to inlining, plus you sorta have to make assumptions > about the code path to be able to mock the right things.) > >> +(test-equal "juliahub-fetch" >> + #t >> + (mock ((web client) http-get >> + (mock-http-get fixtures-juliahub-check-test)) >> + (mock ((guix http-client) http-fetch >> + (mock-http-fetch fixtures-juliahub-check-test)) >> + (mock ((guix import utils) git->origin mock-git->origin) >> + ((@@ (guix import juliahub) juliahub-package?) >> + ((@@ (guix import juliahub) juliahub-fetch) "MyPac= kage")))))) > > Checking for =E2=80=98juliahub-package?=E2=80=99 doesn=E2=80=99t tell us = much; what about > checking the whole package, similar to what is done in other importer > tests? Couldn't manage to get it to work, don't remember why exactly but it was related to gexps. Will retry it when moving to 'with-http-server' as advised.=20 > > Thanks, > Ludo=E2=80=99. --=20 Best regards, Nicolas Graves