From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id gEOhJ57HvmVZzAAAe85BDQ:P1 (envelope-from ) for ; Sun, 04 Feb 2024 00:09:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id gEOhJ57HvmVZzAAAe85BDQ (envelope-from ) for ; Sun, 04 Feb 2024 00:09:18 +0100 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=1707001758; a=rsa-sha256; cv=none; b=qAsRcMDVI+lWurgopb6+dIUKOl1TI4mf8cvW7e3wNep8cP+BoT+3sSi1UfuMWBfv2qJp+G PFw0UwZqbqV9Lmj36GeV1oooKp1+UZU4MOtlC1NmluJrNKPmq33rSPOxxT1w5P+a5K+L9x mDZHCAdPEHP2nt/g8Ibj6OA4A2jTX47P/EBZAAyl1aX5U5yQ+6GvhJ08fQ+AS9HB0kD8di e3iSnT4FlTs8ihTPs1ltqHDusSR+F2th5DHAcRGdrOifapQSvHPgqjwgts0qksllBG9rtc zBekfbpx/upWVVaVEyof1kof/kGigLu49ArQ5tY9KB/wZk5R1vg1jOo5WYHckg== 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=1707001758; 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-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=ToYcw5tKC+j58wJEBOLSzb0dqa76TCGWFXkEy6Ekxhw=; b=d2y5SN62s6FlwESMUQTLnz6gn1icI7ZxXh/EUDu/uOzr3E2AMHQLv5eEW3YlZU7KZPjAvw 10xR+WWWUK81uw7SyeU2pdRuzl9HvAH0wRu8RJWKEHbObDhBTL0FGWOs353wP6GwTf8yGB HTCOaL925MeQYgPlsIN/iDjeCJYZzs50i5RU8Cg87P1rKIYpuPzqBgjoyneIR6ZE3iuJpW 4D205oPvjzxJavmNZMevr5pp85karp2TF91RuIK+uF7MWxB9vcEKs5CXaPFdw+3dScQUbN 6oJyXkYSKEtrbZ8e4vILe/IL5vhodtflDenCNdynlhGzwmxr8UVjYESS1Z0PwQ== 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 41BF073C97 for ; Sun, 4 Feb 2024 00:09:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rWP81-0008Be-Kc; Sat, 03 Feb 2024 18:08:53 -0500 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 1rWP80-0008BD-NP for guix-patches@gnu.org; Sat, 03 Feb 2024 18:08:52 -0500 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 1rWP80-0008EP-Fh for guix-patches@gnu.org; Sat, 03 Feb 2024 18:08:52 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rWP8C-0001Hl-1C for guix-patches@gnu.org; Sat, 03 Feb 2024 18:09:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#62202] [PATCH v4 5/6] tests: go: Add mock-git->origin function. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 03 Feb 2024 23:09: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: 62202@debbugs.gnu.org Cc: ngraves@ngraves.fr, zimoun.toutoune@gmail.com Received: via spool by 62202-submit@debbugs.gnu.org id=B62202.17070017134867 (code B ref 62202); Sat, 03 Feb 2024 23:09:03 +0000 Received: (at 62202) by debbugs.gnu.org; 3 Feb 2024 23:08:33 +0000 Received: from localhost ([127.0.0.1]:47254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWP7h-0001GQ-7W for submit@debbugs.gnu.org; Sat, 03 Feb 2024 18:08:33 -0500 Received: from 15.mo584.mail-out.ovh.net ([91.121.62.11]:44939) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWP7d-0001Fd-2K for 62202@debbugs.gnu.org; Sat, 03 Feb 2024 18:08:30 -0500 Received: from director10.ghost.mail-out.ovh.net (unknown [10.108.17.34]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 3B5F425CB8 for <62202@debbugs.gnu.org>; Sat, 3 Feb 2024 23:08:16 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-l9gd2 (unknown [10.110.96.132]) by director10.ghost.mail-out.ovh.net (Postfix) with ESMTPS id E4AA11FDEC; Sat, 3 Feb 2024 23:08:15 +0000 (UTC) Received: from ngraves.fr ([37.59.142.109]) by ghost-submission-6684bf9d7b-l9gd2 with ESMTPSA id 7uFfNV/HvmUrtQUAtmFz7A (envelope-from ); Sat, 03 Feb 2024 23:08:15 +0000 X-OVh-ClientIp: 81.67.146.208 Date: Sun, 4 Feb 2024 00:07:15 +0100 Message-ID: <20240203230807.25751-5-ngraves@ngraves.fr> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240203230807.25751-1-ngraves@ngraves.fr> References: <20240203230807.25751-1-ngraves@ngraves.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 14366482811726389863 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrfedujedgtdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepvdehleeiffehtedvlefhffffjeefgfduhfetkeevheeiteduiedugfekuedtheejnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepiedvvddtvdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekgedpmhhouggvpehsmhhtphhouhht 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-Migadu-Scanner: mx10.migadu.com X-Spam-Score: -6.67 X-Migadu-Queue-Id: 41BF073C97 X-Migadu-Spam-Score: -6.67 X-TUID: +Onv1iqnbS/L * tests/go.scm (mock-git->origin): Add function. (go-module->guix-package test): Use mock-git->origin. Change-Id: I9f9de814fc6c9dcf9772507c9e5bf32c16d81784 --- tests/go.scm | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/tests/go.scm b/tests/go.scm index 4644e1bd1c..cca27506e6 100644 --- a/tests/go.scm +++ b/tests/go.scm @@ -371,6 +371,26 @@ (define (mock-http-get testcase) (values response-header body) (error "mocked http-get Unexpected URL: " url))))) +;; Mock an empty directory by replacing hash. +(define* (mock-git->origin repo-url ref #:key (ref->commit #f)) + (let* ((version (if (pair? ref) + (cdr ref) + #f)) + (vcommit (match ref->commit + (#t commit) + (#f version) + ((? procedure?) (ref->commit version)) + (_ #f)))) + `(origin + (method git-fetch) + (uri (git-reference + (url ,(and (not (eq? repo-url 'null)) repo-url)) + (commit ,vcommit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5"))))) + (test-equal "go-module->guix-package" '(package (name "go-github-com-go-check-check") @@ -403,26 +423,7 @@ (define (mock-http-get testcase) (mock-http-get fixtures-go-check-test)) (mock ((guix http-client) http-fetch (mock-http-fetch fixtures-go-check-test)) - (mock ((guix import utils) git->origin - ;; Mock an empty directory by replacing hash. - (lambda* (repo-url ref #:key (ref->commit #f)) - (let* ((version (if (pair? ref) - (cdr ref) - #f)) - (vcommit (match ref->commit - (#t commit) - (#f version) - ((? procedure?) (ref->commit version)) - (_ #f)))) - `(origin - (method git-fetch) - (uri (git-reference - (url ,(and (not (eq? repo-url 'null)) repo-url)) - (commit ,vcommit))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5")))))) + (mock ((guix import utils) git->origin mock-git->origin) (go-module->guix-package* "github.com/go-check/check"))))))) (test-end "go") -- 2.41.0